Reputation: 71
I wish to know if there is efficient way to check if a Couchbase document is modified. And there is Scheduled Cron Job which checks every 15 min or some specified time interval.
Going through the contents is always an option but is there an efficient way to do this.
"rev" attribute of document seems to interesting, all I observed each time the document is modified rev attribute of document metadata gets updated. So I thought of using this to check if the document is modified.
Any suggestions please.
Have a nice day. Thank you.
Upvotes: 1
Views: 137
Reputation: 2460
CAS is the right way to check if the document has been modified. Both pessimistic and optimistic locking are also supported by couchbase:
https://blog.couchbase.com/optimistic-or-pessimistic-locking-which-one-should-you-pick/
Upvotes: 2