Tagging in CouchBase

Any solutions for Tagging in couchbase.

Is Append operation holds a lock on the object ?

1 Answer

« Back to question.

Hello,

So let me answer your question in 2 steps:

1- Just to be sure you know it, the "append" operation does not do anything with JSON. It just append the object at the end of the object stored into Couchbase value. (It is NOT appending a 'thing' to a JSON attribute). Take a look to this part of the documentation:
http://www.couchbase.com/docs/couchbase-sdk-net-1.1/couchbase-sdk-net-up...

2- To do Tagging, as you may know Couchbase API use the full JSON document back and forth, and you do the parsing and JSON work yourself in the application. (and I am supposing here that you put the tags inside the document)
So if you want to be sure that only 1 person/thread update the document you have to use the "Check and Swap" (CAS) approach, and associated operations. You have a full example here:
https://github.com/couchbaselabs/DeveloperDay/blob/master/DotNet/Couchba...

Regards
Tug
@tgrall

Thanks Tug for the Reply.

I did find a way to use/store tags in the cache. The concern I have is, if I lose the node which has the tags, I am going to lose all the data which is used to remove the entries. I also dont want to turn on persistance across all the nodes, as i dont want to persist the other data except tags.

Not sure, if I can store the tags data in certain buckets and replicate only those buckets.

Thanks

I think you should put the tags and document in the same bucket with the persistence.

Why not doing it?