Resolving replication conflicts entirely within CouchDB
Asked Answered
T

1

9

Is it possible to resolve conflicts caused by database replication entirely within CouchDB? I know it has its own internal algorithm for deciding which revision to use, but can an application register a custom javascript function to deal with conflicts in an application-specific way?

The CouchDB guide and wiki both seem only to suggest using external application code to resolve conflicts.

Thirzia answered 6/4, 2011 at 21:7 Comment(0)
P
3

No, it is not possible to resolve conflicts automatically (or triggered somehow) within CouchDB.

It always up to the developers, to resolve conflicts, that's true.

In MVCC system automatic conflict resolution feels awkward. What for do we store the previous versions and grant non locking access?

(Correct me if I am wrong, please)

Presage answered 6/4, 2011 at 23:42 Comment(3)
We are in agreement on it being up to the developer to decide how best to resolve conflicts in an application. My question was meant to be about where this conflict resolution logic is placed. Can it be a javascript function stored within CouchDB?Thirzia
+1 and I'll update your answer to make "no" more clear. I agree with nil: the developer must resolve conflicts, not necessarily the user. Dropbox and GMail are two services that seem to resolve conflicts transparently all the time. Unfortunately, at this time, it must all be done by connecting to couch as a normal client.Lacerta
Thanks, jhs, for clarifying. I wonder why it isn't possible. It certainly makes CouchApps, which are served directly from CouchDB, less self-sufficient.Thirzia

© 2022 - 2024 — McMap. All rights reserved.