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.

gcamp
  • 14,622
  • 4
  • 54
  • 85
nil
  • 1,192
  • 9
  • 12

1 Answers1

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)

JasonSmith
  • 72,674
  • 22
  • 123
  • 149
chris polzer
  • 3,219
  • 3
  • 28
  • 44
  • 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? – nil Apr 07 '11 at 01:51
  • 1
    +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. – JasonSmith Apr 07 '11 at 04:25
  • 1
    Thanks, jhs, for clarifying. I wonder why it isn't possible. It certainly makes CouchApps, which are served directly from CouchDB, less self-sufficient. – nil Apr 08 '11 at 17:25