The subject matter of this specification generally relates to reconciling conflicts between replicas of data. In one aspect, a system obtains a first document that includes a first replica of an object used by an application at a first device and a second document that includes a second replica of the object used by the application at a second device. The system generates a merged document from the first document and the second document. The system determines that the first value for the first key was modified at the first device at a later time than the first value for the first key was modified at the second device. In response, the system includes, in the merged document, the first value for the first key in the first document and, for each descendant element of the first element, a value for the descendant element's key in the first document.
展开▼