Update run on master node?
What would be the best approach to route requests in a couchbase environment to the couchbase server that is acting as a master for a piece of data?
The reason I ask is that my "Game" object has grown to be 450 kb (after some serious tweaking of the JSON, it was originally 2.5 MB). I'm worried about sending that data over and over to the various web servers just so they can do an update and send it back over. JSON compresses well, but I wasn't sure if the objects are transferred via text or some form of compression (GZIP?).
Is this something I should be concerned about, or am I over complicating the situation?
Likewise, is the best approach to have couchbase on dedicated servers or should each website have its own instance of the couchbase server? (One approach leads towards specialized nodes and the other is obviously very conductive to cloud deployment and scalability where every server is the "same").
You misunderstood my question.
The act of writing on the master node makes 100% sense. However, to do that write, I must first read the data to the web server and then do the manipulation. From there, I can then issue a write, which will retransfer the new data to the proper server and write it.
My question was if couchbase had something akin to "stored procedures". Where I can issue a much smaller data packet (parameters) and have the whole write operation (including the initial read and then the manipulation) happen on the master node.
If not, I know that I can tap into the same logic that the client uses to identify the master server and send my request to a custom written queue / rpc mechanism.
This question is being raised since my object is getting rather large (around 500 KB, and I expect it to hit 1 MB) and the amount of network traffic seems to me to be rather excessive.
Also, when paired with my earlier question about locating objects on the same node via a modification to the key hashing algorithm, this may allow for a more highly available system. I'm still researching my options.
There is nothing akin to stored procedures. It's possible there never will be as mutation of data at query time has proven to be a bit of a security exploit vector.
Couchbase does support up to 20MByte objects, but I can certainly see different contexts in which it'll make sense to break this up.
(sorry for the super long delay in reply! just happened to notice this thread)
Couchbase Client Libraries automatically route data to the master for any given key/_id. You cannot actually do a write on a non-master for a given key.
Also, have a look at the documentation about buckets (http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-architectur...), as that may meet your needs for using a single cluster with multiple apps.