14
Replication Enhancements in RavenDB 3.5 Jonathan Matheus RavenHQ [email protected]

Replication changes in 3.5

Embed Size (px)

Citation preview

Page 1: Replication changes in 3.5

Replication Enhancements inRavenDB 3.5

Jonathan MatheusRavenHQ

[email protected]

Page 2: Replication changes in 3.5

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

Page 3: Replication changes in 3.5

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

Page 4: Replication changes in 3.5

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

Page 5: Replication changes in 3.5

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

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

data• Conflicts!

• “Recovery Jitter”

Page 6: Replication changes in 3.5

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

Page 7: Replication changes in 3.5

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

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

replication

Page 8: Replication changes in 3.5

Clustering - Replication• Clustering does not change how replication

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

Page 9: Replication changes in 3.5

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

Page 10: Replication changes in 3.5

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

demo: http://raft.github.io

Page 11: Replication changes in 3.5

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

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

Page 12: Replication changes in 3.5

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

Page 13: Replication changes in 3.5

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

during deployments• Use conventions to replace properties (lodash)

Page 14: Replication changes in 3.5

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