XDCR MUST never be used for bi-directionnal replication of buckets containing Mobile data.
XDCR MAY NOT be used for uni-directionnal replication of buckets containing Mobile data (MAY BE possible if the destination bucket is a passive cluster).
§Can I do active/active XDCR replication between two or more Couchbase clusters?
When not possible, SG-replicate should be used instead. It is the only process that can guaranty the uniqueness of sequence within a cluster.
That being said, today, in Couchbase Server / Sync Gateway, nothing prevents the user to make such a disastrous mistake.
When trying to define a XDCR replication between a source and target bucket containing Mobile Data (this bucket type can be easily identified because of _sync, _seq and other specific Mobile document types), I propose to :
- popup a warning / confirmation message at Couchbase Console UI level asking the user if he really wants to continue to run the replication (and inform him of a risks and potential data loss/dysfunction of Mobile logic because of a corrupted sequence number)
- add --force-XDCR option at REST level / xdcr-replicate Couchbase CLI tool (if not present, the same warning message should popup as well).
This is to prevent accidental data corruption (like we or some of our customers have unfortunately already experienced).