Company
Date Published
Author
Priya Rajagopal, Senior Director, Product Management
Word count
4522
Language
English
Hacker News points
None

Summary

Document conflicts in distributed environments, particularly mobile settings with unreliable network connections, can arise when multiple devices update the same document concurrently. Couchbase Mobile 2.0 addresses this with "Automatic Conflict Resolution" or "Conflict-free" mode, which automatically handles conflicts, eliminating conflicting revisions in the database. This system utilizes a default conflict resolver, obviating the need for developers to manually address conflicts, unless they choose to be notified and take specific actions. The mode employs a "Last Write Always Wins" policy as default, although a "Fail On Conflict" option is available for developers who wish to be notified of and manage conflicts manually. The conflict-free approach reduces database size by minimizing the need to store older revision metadata. The Sync Gateway in this version ensures no conflicting revisions by rejecting those causing conflicts, with handling occurring client-side during pull replication. While this mode simplifies conflict management, it raises concerns about data loss in offline scenarios, prompting discussions about potential enhancements for custom conflict resolution.