3 ms·
CouchDB and by extension Cloudant are really cool. Change feeds and replication are first class citizens if you wish, not some side-feature. This means 3 thin
by rdtsc 13y ago
CouchDB and by extension Cloudant are really cool.
Change feeds and replication are first class citizens if you wish, not some side-feature.
This means 3 things for me:
* Can build your own cluster topology. Replicate in a star pattern, in a circle with overlapped neighbors, in a hierarchy. You decide. Replication is explicit and configurable.
* Ideal for real-time applications. Having client poll for changes can grind things down. CouchDB support continuous updates and changes feed. It can go via long polling, event sourcing, can still to GET's with a 'since' parameters. Up to the user.
* Having to handle merge conflicts explicitly. MVCC semantics is not hidden or hand-waved away with a timestamp-last-writer-wins-unless-your-ntp-is-messed-up. Conflicts are first class citizens as well and one needs to know how to handle. That is good for some case but bad in others. I like it. For example one can attach an application specific conflict resolver that knows how to solve conflicts for that particular database in an application specific manner. Riak is another database that handles explicit conflicts well.
BTW: Just noticed CouchDB 1.5 was just released.
http://www.apache.org/dist/couchdb/notes/1.5.0/apache-couchdb-1.5.0.html http://www.apache.org/dist/couchdb/notes/1.5.0/apache-couchd...
Will have to play with the new Admin UI and Node.JS query server.
- skrebbel 13y agoWith regard to your 3rd point, conflicts that happen during replication aren't actually first class citizens, if memory serves me well. If you change the same field on two databases at roughly the same time, some heuristic determines who wins.
- rdtsc 13y agoThat is true but the conflict is preserved in the database. So a change feed set up to monitor conflicts will notice it immediately. You do have to set up the monitor and conflict resolver. From the CAP standpoint your system is available but not consistent for a short period of time because initially on a GET during a conflicted document you might get one version but after the custom merge resolve runs, it could end up replacing with another. That is the price to pay for availability, and it works best if applications on top are designed to work with it. It is not always possible so this, so it is a tool that is good in some cases but not in all cases.
- mlmilleratmit 13y agoThere is indeed a deterministic but arbitrary choice of the "winner", but there is a big difference with other systems -- no data is discarded. The hash tree branches and both edits are saved. You can choose which branch of the tree you want to start editing, and you can listen to a feed for documents that have conflicting edits and resolve them according to your application logic. The real choice is to never discard data.