{"id":2783,"date":"2017-02-20T06:01:13","date_gmt":"2017-02-20T14:01:13","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2783"},"modified":"2017-02-23T12:22:31","modified_gmt":"2017-02-23T20:22:31","slug":"timestamp-based-conflict-resolution-xdcr-qes-perspective","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/","title":{"rendered":"Timestamp-based conflict resolution in XDCR &#8211; a QE&#8217;s perspective"},"content":{"rendered":"<p><b>Introduction<\/b><\/p>\n<p><span style=\"font-weight: 400\">Cross Datacenter Replication (XDCR) \u00a0is an important core feature of Couchbase that helps users in disaster recovery and data locality. Conflict resolution is an inevitable challenge faced by XDCR when a document is modified in two different locations before it has been synchronized between the locations. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Until 4.6, Couchbase only supported a revision ID-based strategy to handle conflict resolution. In this strategy, a document\u2019s revision ID, which is updated every time it is modified, is used as the first field to decide the winner. If the revision ID of both contestants are same, then CAS, TTL, and flags are used in the same order to resolve the conflict. This strategy works best for applications designed to work based on a \u201cMost updates is best\u201d policy. For example, a ticker app used by conductors in a train which updates a counter stored by cb server to count the number of passengers will work best with this policy and hence perform accurately with revision ID-based conflict resolution.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Starting with 4.6, Couchbase will be supporting an additional strategy called timestamp-based conflict resolution. Here, the timestamp of a document which is stored in CAS is used as the first field to decide the winner. In order to keep consistent ordering of mutations, Couchbase uses a hybrid logical clock (HLC), which is a combination of a physical clock and a logical clock. If the timestamp of both the contestants are same, then revision ID, TTL, and flags are used in the same order to resolve conflicts. This strategy is adapted to facilitate applications which are designed based on a \u201cMost recent update is best\u201d policy. For example, a flight tracking app that stores the estimated arrival time of a flight in Couchbase Server will perform accurately with this conflict resolution. Precisely, this mechanism can be summarized as \u201cLast write wins\u201d.<\/span><\/p>\n<p><span style=\"font-weight: 400\">One should understand that the most updated document need not essentially be the most recent document and vice versa. So the user really needs to understand the application\u2019s design, needs, and data pattern before deciding on which conflict resolution mechanism to use. For the same reason, Couchbase has designed the conflict resolution mechanism as a bucket level parameter. The users need to decide and select the strategy they wish to follow while creating the buckets. Once a bucket is created with a particular conflict resolution mechanism via UI, Rest API, or CLI, it cannot be changed. The user will have to delete and recreate the bucket to change the strategy. Also to avoid confusions and complications, Couchbase has restricted XDCR from being set up in mixed mode, i.e source and destination buckets cannot have different conflict resolution strategies selected. They both have to use either revision ID-based, or timestamp based conflict resolution. If the user tries to set up otherwise via UI, Rest API, or CLI, there will be an error message displayed.<\/span><\/p>\n<p><b>Timestamp-based conflict resolution Use Cases<\/b><\/p>\n<p><b>High Availability with Cluster Failover<\/b><\/p>\n<p><span style=\"font-weight: 400\">Here, all database operations go to Datacenter A and are replicated via XDCR to Datacenter B. If the cluster located in Datacenter A fails then the application fails all traffic over to Datacenter B.<\/span><\/p>\n<p><b>Datacenter Locality<\/b><\/p>\n<p><span style=\"font-weight: 400\">Here, two active clusters operate on discrete sets of documents. This ensures no conflicts are generated during normal operation. A bi-directional XDCR relationship is configured to replicate their updates to each other. When one cluster fails, application traffic can be failed over to the remaining active cluster.<\/span><\/p>\n<p><b>How does Timestamp-based conflict resolution ensure safe failover?<\/b><\/p>\n<p><span style=\"font-weight: 400\">Timestamp-based conflict resolution requires that applications only allow traffic to the other Datacenter after the maximum of the following two time periods has elapsed:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The replication latency between A and B. This allows any mutations in-flight to be received by Datacenter B.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The absolute time skew between Datacenter A and Datacenter B. This ensures that any writes to Datacenter B occur after the last write to Datacenter A, after the calculated delay, at which point all database operations would go to Datacenter B.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">When availability is restored to Datacenter A, applications must observe the same time period before redirecting their traffic. For both of the use cases described above, using timestamp-based conflict resolution ensures that the most recent version of any document will be preserved.<\/span><\/p>\n<p><b>How to configure NTP for Timestamp-based conflict resolution?<\/b><\/p>\n<p><span style=\"font-weight: 400\">A prerequisite that users should keep in mind before opting for timestamp-based conflict resolution is that they need to use synchronized clocks to ensure the accuracy of this strategy. Couchbase advises them to use Network Time Protocol (NTP) to synchronize time across multiple servers. The users will have to configure their clusters to periodically synchronize their wall clocks with a particular NTP server or a pool of NTP peers to ensure availability. Clock synchronization is key to the accuracy of the Hybrid Logical Clock used by Couchbase to resolve conflicts based on timestamps.<\/span><\/p>\n<p><span style=\"font-weight: 400\">As a QE, testing timestamp-based conflict resolution was a good learning experience. One of the major challenges was learning how NTP works. The default setup for all the testcases is to enable NTP, start the service, sync up the wall clock with <\/span><span style=\"font-weight: 400\">0.north-america.pool.ntp.org, and then proceed with the test. These steps were achieved using the following commands in setup:<\/span><\/p>\n<p><span style=\"font-weight: 400\">~$ chkconfig ntpd on<\/span><\/p>\n<p><span style=\"font-weight: 400\">~$ \/etc\/init.d\/ntpd start<\/span><\/p>\n<p><span style=\"font-weight: 400\">~$ ntpdate -q 0.north-america.pool.ntp.org<\/span><\/p>\n<p><span style=\"font-weight: 400\">Once the test is done and results are verified, NTP service is stopped and disabled using the following commands:<\/span><\/p>\n<p><span style=\"font-weight: 400\">~$ chkconfig ntpd off<\/span><\/p>\n<p><span style=\"font-weight: 400\">~$ \/etc\/init.d\/ntpd stop<\/span><\/p>\n<p><span style=\"font-weight: 400\">This is vanilla setup where all the individual nodes sync up their wall clock with 0.north-america.pool.ntp.org<\/span><b>. <\/b><span style=\"font-weight: 400\">It was interesting to automate test cases where nodes sync up their wall clock with a pool of NTP peers, source and destination cluster sync with different NTP pools (A (0.north-america.pool.ntp.org) -&gt; B (3.north-america.pool.ntp.org)) and each cluster in a chain topology of length 3 (A (EST) \u00a0-&gt; B (CST) -&gt; C (PST)) are in different timezones. We had to manually configure these scenarios, observe the behaviour and then automate it out.<\/span><\/p>\n<p><b>How did we test NTP based negative scenarios?<\/b><\/p>\n<p><span style=\"font-weight: 400\">Next challenge was to test scenarios where NTP is not running on the Couchbase nodes and there is a time skew between the source and destination. Time skew might also occur If the wall clock time difference across clusters is high. Any time synchronization mechanism will take some time to sync the clocks resulting in a time skewed window. Note that Couchbase only gives an advisory warning while creating a bucket with timestamp-based conflict resolution stating that the user should ensure a time synchronization mechanism is in place in all the nodes. It does not validate and restrict users from creating such a bucket if a time synchronization mechanism as such is not present. So it is quite possible that the user might ignore this warning, create a bucket with timestamp based conflict resolution and see weird behaviour when there is a time skew. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Let us consider one such situation here:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Create default bucket on source and target cluster with timestamp based conflict resolution<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Setup XDCR from source to target<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Disable NTP on both clusters<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Make wall clock of target cluster slower than source cluster by 5 minutes<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Pause replication<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Create a doc D1 at time T1 in target cluster<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Create a doc D2 with same key at time T2 in source cluster<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Update D1 in target cluster at time T3<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Resume replication<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Observe that D2 overwrites D1 even though T1 &gt; T2 &gt; T3 and last update to D1 in target cluster should have won<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">Here last write by timeline did not win as the clocks were skewed and not in sync leading to incorrect doc being declared as the winner. This shows how important time synchronization is for the timestamp based conflict resolution strategy. Figuring out all such scenarios and automating them was indeed a challenge.<\/span><\/p>\n<p><b>How did we test complex scenarios with Timestamp-based Conflict Resolution?<\/b><\/p>\n<p><span style=\"font-weight: 400\">Up next was determining a way to validate the correctness of this timestamp based conflict resolution against revision ID based strategy. We needed to perform the same steps in a XDCR setup and verify that the results were different based on the bucket\u2019s conflict resolution strategy. In order to achieve this, we created two different buckets, one configured to use revID based conflict resolution and other to use timestamp based. Now follow these steps on both buckets parallely:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Setup XDCR and pause replication<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Create doc D1 in target at time T1<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Create doc D2 with same key in source at time T2<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Update doc D2 in source at time T3<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Update doc D2 in source again at time T4<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Update doc D1 in target at time T5<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Resume replication<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">In the first bucket which is configured to use revID based conflict resolution, doc D1 at target will be overwritten by D2 as it has been mutated the most. Whereas in the second bucket which is configured to use timestamp based conflict resolution, doc D1 at target will be declared winner and retained as it is the latest to be mutated. Figuring out such scenarios and automating them made our regression exhaustive and robust.<\/span><\/p>\n<p><b>How did we test HLC correctness?<\/b><\/p>\n<p><span style=\"font-weight: 400\">Final challenge was to test the monotonicity of the hybrid logical clock (HLC) used by Couchbase in timestamp based conflict resolution. Apart from verifying that the HLC remained the same between an active vbucket and its replica, we had some interesting scenarios as follows:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">C1 (slower) -&gt; C2 (faster) &#8211; mutations made in C1 will lose based on timestamp and C2 will always win &#8211; so HLC of C2 should not change after replication<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">C1 (faster) -&gt; C2 (slower) &#8211; mutations made in C1 will always win based on timestamp &#8211; so HLC of C2 should be greater than what it was before replication due to monotonicity<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Same scenario as 1, even though HLC of C2 did not change due to replication, any updates on C2 should increase its HLC owing to monotonicity<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Similarly, for scenario described in 2, apart from C2\u2019s HLC being greater than what it was before replication, more updates to docs on C2 should keep its HLC increasing owing to monotonicity<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">Thus, all these challenges made testing timestamp based conflict resolution a rewarding QE feat.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Cross Datacenter Replication (XDCR) \u00a0is an important core feature of Couchbase that helps users in disaster recovery and data locality. Conflict resolution is an inevitable challenge faced by XDCR when a document is modified in two different locations before [&hellip;]<\/p>\n","protected":false},"author":185,"featured_media":2826,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"ppma_author":[9051],"class_list":["post-2783","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Timestamp-based conflict resolution in XDCR - a QE&#039;s perspective - The Couchbase Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Timestamp-based conflict resolution in XDCR - a QE&#039;s perspective\" \/>\n<meta property=\"og:description\" content=\"Introduction Cross Datacenter Replication (XDCR) \u00a0is an important core feature of Couchbase that helps users in disaster recovery and data locality. Conflict resolution is an inevitable challenge faced by XDCR when a document is modified in two different locations before [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-20T14:01:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-02-23T20:22:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/02\/shutterstock_23860333.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Arunkumar Senthilnathan, Sr Software Engineer, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arunkumar Senthilnathan, Sr Software Engineer, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/\"},\"author\":{\"name\":\"Arunkumar Senthilnathan, Sr Software Engineer, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/734f9203ff8f2fcfadc2aeedb7dae3d1\"},\"headline\":\"Timestamp-based conflict resolution in XDCR &#8211; a QE&#8217;s perspective\",\"datePublished\":\"2017-02-20T14:01:13+00:00\",\"dateModified\":\"2017-02-23T20:22:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/\"},\"wordCount\":1723,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/shutterstock_23860333.jpg\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/\",\"name\":\"Timestamp-based conflict resolution in XDCR - a QE's perspective - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/shutterstock_23860333.jpg\",\"datePublished\":\"2017-02-20T14:01:13+00:00\",\"dateModified\":\"2017-02-23T20:22:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/shutterstock_23860333.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/shutterstock_23860333.jpg\",\"width\":1000,\"height\":667,\"caption\":\"Couchbase NoSQL Database\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Timestamp-based conflict resolution in XDCR &#8211; a QE&#8217;s perspective\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/734f9203ff8f2fcfadc2aeedb7dae3d1\",\"name\":\"Arunkumar Senthilnathan, Sr Software Engineer, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/f658cea464efa0d9b678a48bb7d92350\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/594f261f5e6ad4385db60fd4e68a9051eb633bea03e493db6430617312385ccf?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/594f261f5e6ad4385db60fd4e68a9051eb633bea03e493db6430617312385ccf?s=96&d=mm&r=g\",\"caption\":\"Arunkumar Senthilnathan, Sr Software Engineer, Couchbase\"},\"description\":\"Arunkumar Senthilnathan is a Sr. Software Engineer at Couchbase from past four years. Arunkumar is responsible for development on Enhanced UI automation to work with new angular UI \u2013 conducted multiple bug bashes with the team and filed 65+ valid bugs.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/arunkumar-senthilnathan-2\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Timestamp-based conflict resolution in XDCR - a QE's perspective - The Couchbase Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/","og_locale":"en_US","og_type":"article","og_title":"Timestamp-based conflict resolution in XDCR - a QE's perspective","og_description":"Introduction Cross Datacenter Replication (XDCR) \u00a0is an important core feature of Couchbase that helps users in disaster recovery and data locality. Conflict resolution is an inevitable challenge faced by XDCR when a document is modified in two different locations before [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-02-20T14:01:13+00:00","article_modified_time":"2017-02-23T20:22:31+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/02\/shutterstock_23860333.jpg","type":"image\/jpeg"}],"author":"Arunkumar Senthilnathan, Sr Software Engineer, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Arunkumar Senthilnathan, Sr Software Engineer, Couchbase","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/"},"author":{"name":"Arunkumar Senthilnathan, Sr Software Engineer, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/734f9203ff8f2fcfadc2aeedb7dae3d1"},"headline":"Timestamp-based conflict resolution in XDCR &#8211; a QE&#8217;s perspective","datePublished":"2017-02-20T14:01:13+00:00","dateModified":"2017-02-23T20:22:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/"},"wordCount":1723,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/shutterstock_23860333.jpg","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/","url":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/","name":"Timestamp-based conflict resolution in XDCR - a QE's perspective - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/shutterstock_23860333.jpg","datePublished":"2017-02-20T14:01:13+00:00","dateModified":"2017-02-23T20:22:31+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/shutterstock_23860333.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/shutterstock_23860333.jpg","width":1000,"height":667,"caption":"Couchbase NoSQL Database"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/timestamp-based-conflict-resolution-xdcr-qes-perspective\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Timestamp-based conflict resolution in XDCR &#8211; a QE&#8217;s perspective"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/734f9203ff8f2fcfadc2aeedb7dae3d1","name":"Arunkumar Senthilnathan, Sr Software Engineer, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/f658cea464efa0d9b678a48bb7d92350","url":"https:\/\/secure.gravatar.com\/avatar\/594f261f5e6ad4385db60fd4e68a9051eb633bea03e493db6430617312385ccf?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/594f261f5e6ad4385db60fd4e68a9051eb633bea03e493db6430617312385ccf?s=96&d=mm&r=g","caption":"Arunkumar Senthilnathan, Sr Software Engineer, Couchbase"},"description":"Arunkumar Senthilnathan is a Sr. Software Engineer at Couchbase from past four years. Arunkumar is responsible for development on Enhanced UI automation to work with new angular UI \u2013 conducted multiple bug bashes with the team and filed 65+ valid bugs.","url":"https:\/\/www.couchbase.com\/blog\/author\/arunkumar-senthilnathan-2\/"}]}},"authors":[{"term_id":9051,"user_id":185,"is_guest":0,"slug":"arunkumar-senthilnathan-2","display_name":"Arunkumar Senthilnathan, Sr Software Engineer, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/594f261f5e6ad4385db60fd4e68a9051eb633bea03e493db6430617312385ccf?s=96&d=mm&r=g","author_category":"","last_name":"Senthilnathan","first_name":"Arunkumar","job_title":"","user_url":"","description":"Arunkumar Senthilnathan is a Sr. Software Engineer at Couchbase from past four years. Arunkumar is responsible for development on Enhanced UI automation to work with new angular UI \u2013 conducted multiple bug bashes with the team and filed 65+ valid bugs."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/185"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2783"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2783\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/2826"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2783"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}