![Page 1: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/1.jpg)
Couchbase Server and Cross Datacenter Replication
Anil KumarTechnical Product Manager
![Page 2: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/2.jpg)
XDCR: Cross Datacenter Replication
US DATA CENTER
EUROPE DATA CENTER
ASIA DATA CENTER
http://blog.groosy.com/wp-content/uploads/2011/10/internet-map.jpg
![Page 3: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/3.jpg)
Cross Datacenter Replication – The basics
• Replicate your Couchbase data across clusters
• Clusters may be spread across geos
• Configured on a per-bucket basis
• Supports unidirectional and bidirectional operation
• Application can read and write from both clusters (active – active replication)
• Replication throughput scales out linearly
• Different from intra-cluster replication
![Page 4: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/4.jpg)
Intra-cluster Replication
![Page 5: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/5.jpg)
Cross Datacenter Replication (XDCR)
![Page 6: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/6.jpg)
XDCR Architecture
![Page 7: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/7.jpg)
33 2
Single node - Couchbase Write Operation with XDCR
Managed Cache
Dis
k Q
ueue
Disk
Replication Queue
App Server
Couchbase Server Node
Doc 1Doc 1
Doc 1
To other node
XDCR Engine
Doc 1
To other cluster
![Page 8: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/8.jpg)
Internal Data Flow
1. Document written to managed cache
2. Document added to intra-cluster replication queue
3. Document added to disk queue
4. XDCR push replicates to other clusters
![Page 9: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/9.jpg)
XDCR in actionCOUCHBASE SERVER CLUSTERNYC DATA CENTERACTIVE
Doc
Doc 2
SERVER 1
Doc 9
SERVER 2 SERVER 3
RAM
Doc Doc Doc
ACTIVE
Doc
Doc
Doc RAM
ACTIVE
Doc
Doc
DocRAM
DISK
Doc Doc Doc
DISK
Doc Doc Doc
DISK
COUCHBASE SERVER CLUSTERSF DATA CENTER
ACTIVE
Doc
Doc 2
SERVER 1
Doc 9
SERVER 2 SERVER 3
RAM
Doc Doc Doc
ACTIVE
Doc
Doc
Doc RAM
ACTIVE
Doc
Doc
DocRAM
DISK
Doc Doc Doc
DISK
Doc Doc Doc
DISK
![Page 10: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/10.jpg)
Bucket-level XDCR
Bucket A
Bucket B
Bucket C
Cluster 1
Bucket A
Bucket B
Bucket C
Cluster 2
![Page 11: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/11.jpg)
Continuous Reliable Replication
• All data mutations replicated to destination cluster
• Multiple streams round-robin across vBuckets in parallel (32 default)
• Automatic resume after network disruption
![Page 12: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/12.jpg)
Cluster Topology Aware
• Automatically handles node addition and removal in source and destination clusters
![Page 13: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/13.jpg)
Efficient• Couchbase Server de-duplicates writes to disk
With multiple updates to the same document only the last version is written to disk
Only this last change written to disk is passed to XDCR
• Document revisions are compared between clusters prior to transfer
![Page 14: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/14.jpg)
Active-Active Conflict Resolution
• Couchbase Server provides strong consistency at the document level within a cluster
• XDCR provides eventual consistency across clusters
• If a document is mutated on both clusters, both clusters will pick the same “winner”
• In case of conflict, document with the most updates will be considered the “winner”
{ … } 33{ … }
Doc 1 on DC1Doc 1 on DC2
Winner
![Page 15: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/15.jpg)
Configuration and Monitoring
![Page 16: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/16.jpg)
STEP 1: Define Remote Cluster
![Page 17: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/17.jpg)
STEP 2: Start Replication
![Page 18: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/18.jpg)
Monitor Ongoing Replications
![Page 19: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/19.jpg)
Detailed Replication Progress• Source Cluster
• Destination Cluster
![Page 20: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/20.jpg)
XDCR Topologies and Use Case
![Page 21: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/21.jpg)
Unidirectional
• Hot spare / Disaster Recovery
• Development/Testing copies
![Page 22: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/22.jpg)
Bidirectional
• Multiple Active Masters
• Disaster Recovery
• Datacenter Locality
![Page 23: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/23.jpg)
Chain
![Page 24: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/24.jpg)
Data aggregation
![Page 25: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/25.jpg)
Data propagation
![Page 26: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/26.jpg)
XDCR in the Cloud
• Server Naming Optimal configuration using DNS name that resolves to internal address
for intra-cluster communication and public address for inter-cluster communication
• Security XDCR traffic is not encrypted, plan topology accordingly Consider 3rd party Amazon VPN solutions
![Page 27: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/27.jpg)
Impact of XDCR on the cluster
Your clusters need to be sized for XDCR
• XDCR is CPU intensive Configure the number of parallel streams based on your CPU capacity
• You are doubling your I/O usage I/O capacity needs to be sized correctly
• You will need more memory particularly for bidirectional XDCR Memory capacity needs to be sized correctly
![Page 28: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/28.jpg)
Q & A
![Page 29: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/29.jpg)
Coming September 13
Featured speakers include:
http://www.couchbase.com/couchbase-sf-2013
![Page 30: Webinar - Using Cross Datacenter Replication for Disaster Recovery and Data Locality](https://reader036.vdocument.in/reader036/viewer/2022062407/55d56d52bb61eb19128b45eb/html5/thumbnails/30.jpg)
Thank you
Get Couchbase Server from http://www.couchbase.com/download