couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MK ...@cognitivedissonance.ca>
Subject Re: Updates
Date Thu, 02 Jun 2011 12:23:48 GMT
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)


Mime
View raw message