Replication changes in 3.5

Post on 15-Jan-2017

283 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

Transcript

Replication Enhancements inRavenDB 3.5

Jonathan MatheusRavenHQ

jmatheus@ravenhq.com

What we doWe’re the official cloud hosting provider for RavenDB• Simplify getting RavenDB up and running in

production in AWS & Azure• Commoditize dev-ops and support for

RavenDB• Partnership between Nuvem Nine Consulting

& Hibernating Rhino’s founders• Tight-knitted with Raven product team

How Replication Works• All replication is 1-way• 2-way replication is 2 x 1-way replication

setup• Configure replication on each node• PITA for large number of nodes

• Each node tracks it’s replication to destinations

3.0 Failover• Primary goes down... Boo!• Reads will failover to a Secondary… FTW!• Wait, what about writes?

• Optionally enable writes to Secondary• docStore.Conventions.FailoverBehavior• Changes will be replicated to Primary when it

recovers

3.0 Failover - Recovery • Primary comes back up• Whoo-hoo!

• Let’s use it again!• Write against pre-failover

data• Conflicts!

• “Recovery Jitter”

3.0 Failover - Recovery • Jitter likely to happen when:• High rate of change• Long outages

Clustering - Goals• Reduce Jitter during failover recovery• Introduce Leader Election using Raft

• Simplify Ops Setup & Management• Shared setup and configuration of dbs and

replication

Clustering - Replication• Clustering does not change how replication

works• Clustering changes how failover works• Write only to the leader by default

Clustering - Leader Election• Write only to the Leader in the best case

scenario• Old Leader goes down, choose a new Leader• Old leader recovers & becomes a follower

Clustering - How’s A Leader Elected?• Use Raft!• Consensus Algorithm• Majority vote• At least 3 members

demo: http://raft.github.io

Clustering - Things to know• Leader election is server-wide• Not by database

• ClusterBehavior• Read - Leader or All• Write - Leader or Leader w/ Failover

Selective Replication• Pick collections & transform• More like an ETL Export• Not used for failover• No conflict detection

Selective Replication• Prefer fewer replication “endpoints”• Perhaps combine transform files for an endpoint

during deployments• Use conventions to replace properties (lodash)

Failover SLAs• Failover when responses are slow• Weighted• For reads only

top related