Couchdb uses uuids as keys for documents, but we can also chose our own. Choosing the right key is critical to leverage couchdb's replication protocol well for conflict resolution. Lets look at passwords. If we use a uuid as password key (_id), then if you add the same password on two devices and you sync you get two entries, which is going to confuse the hell out of the password manager, which means we need to reconcile that manually, and audit a ton of code to make sure we don't do something stupid. Instead, if we define the key (_id) to be "httpRealm" and "formSubmitURL|usernameField|passwordField" for the two password types, we get conflict resolution for free by couchdb. It will make sure we only have one password for each and unilateral password changes will be dealt with by couchdb as part of branch reconciliation.
In short, what I heard yesterday ("lets copy data in case of conflict") is a noble theory, but I am afraid wrong in practice, and I would like to hear comments on the observation above.
Thanks, Andreas _______________________________________________ Sync-dev mailing list [email protected] https://mail.mozilla.org/listinfo/sync-dev

