Storing arrays in a document
I'm relatively new to the NoSQL universe, and I'm looking for some guidance with the Memcached Java client and Couchbase.
Referring to Rags' presentation on Slideshare, if my model consists of Player, Plant and Player_Plant List, how do I go about storing the Player_Plant list in a distributed app scenario. If I have an in-memory Java object for Player1_Plant on one app server instance and I use client.set() to update the value, I could potentially be blindly overwritting changes done by another app instance. Do we use CAS operations to handle situations like these?
CASValue<Object> cas = client.gets("Player1_Plant");
CASResponse response = client.cas( "Player1_Plant" , cas.getCas(), mapper.writeValueAsString(player1_plantList));
...and then check the response?
And in what situations or use-cases are client.append() and client.prepend() used? Can they work with JSON?