couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hahn <m...@boutiquing.com>
Subject Re: Updates
Date Thu, 02 Jun 2011 20:16:06 GMT
>  You will have far more flexibility this way (eg, in writing an update
handler
> that gets the current revision and handles {"error":"conflict"}
> intelligently) ...

But if you use update handlers I see no reason not to call them from the
client.  You are only sending over the changes.  Also you have the
flexibility to make changes in the server, like you want, by changing the
update handler.  I think you are hurting your own argument.

On Thu, Jun 2, 2011 at 5:23 AM, MK <mk@cognitivedissonance.ca> wrote:

> On Wed, 1 Jun 2011 18:46:10 +0200
> Daniele Testa <daniele.testa@gmail.com> wrote:
>
> > Personally, I find it very cumbersome to have to do a GET every time I
> > need to do a PUT. It also makes the update slower, as I need to do 2
> > requests (sometimes over slow connections).
>
> That's only an issue if you are querying couch directly from outside.
> If instead you treat it the way you would treat any other kind of DB
> server -- as an internal mechanism -- then your requests are on local
> loopback, there is no hardware bottleneck, and the request cycle is
> simply a form of IPC.
>
> Ie, don't query couch from the client.  Do your primary server logic
> whatever way you normally would, in PHP or whatever, and have that make
> queries to couch on localhost and return data to the client.  You will
> have far more flexibility this way (eg, in writing an update handler
> that gets the current revision and handles {"error":"conflict"}
> intelligently) than you will trying to use couch built-ins (views,
> shows, updates, etc) on their own.  It means some more memory
> overhead if you are not otherwise running apache (or whatever), but
> that's all.
>
> --
> "Enthusiasm is not the enemy of the intellect." (said of Irving Howe)
> "The angel of history[...]is turned toward the past." (Walter Benjamin)
>
>


-- 
Mark Hahn
Website Manager
mark@boutiquing.com
949-229-1012

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message