This session will address Cassandra's tunable consistency model and cover how developers and companies should adopt a more Optimistic Software Design model.
1. Eventual Consistency != Hopeful
Consistency
Embracing Optimistic Design in the
Persistence Layer
#Cassandra13
2. Who am I?
Christos Kalantzis
Netflix Inc.
Manager â Cloud Persistence Engineering
@chriskalan
ckalantzis@netflix.com
www.linkedin.com/in/christoskalantzis
#Cassandra13
3. C* Replication & Consistency Recap
âą C* is eventually Consistent
â That means it WILL get thereâŠeventually
âą Eventually is not:
â A day from now
â A minute from now
â A second from now
âą In most cases it is milliseconds
#Cassandra13
4. âą C* has tunable consistency
â All
â Quorum
â One
C* Replication & Consistency Recap
#Cassandra13
5. Remember When...?
âą In early 2000s, Read was scaled out by adding
replication Slaves to a Master DB.
âą Writes went to a single Master, Reads went to
Slaves
#Cassandra13
9. C* Consistency Concerns
âą âI want high consistency in my Reads/Writes just like I
had in my RDBMS setupâ
â You never really had it.
âą âI want my DB to catch integrity issuesâ
â Weâve been turning FK off for years!
âą See Rails, Grails & other MVC frameworks
âą Can I trust that C* will replicate my data when writing
at CL 1â
#Cassandra13
10. Netflix Experiment
âą Created a multi-datacenter C* 1.1.7 cluster of 48 nodes in
each DC
âą Put load on C* Cluster
â 100K total operations per second (50 K in each DC)
âą Wrote 1,000,000 records at CL1 in one DC
âą Read same 1,000,000 records at CL1 in other DC
âą ALL records were read successfully
âą You can trust it!
#Cassandra13
12. Optimistic vs. Pessimistic Design
âą Pessimistic Design
â Design with high consistency, you punish your
users 99.9% of the time
âą Higher consistency = higher latency
âą Diminished user experience
#Cassandra13
13. Optimistic vs. Pessimistic Design
âą Optimistic Design
â Trust your data store
âą Know your business and your application
â Always ask yourself, is it really that important?
âą Handle edge cases through contingency plans
#Cassandra13
14. Low Consistency Example 1
Amazon
âą Inventory system sometimes sells items not
available
âą Cancel the order
âą They offer credit of 10% towards future
purchase
#Cassandra13
15. Low Consistency Example 2
Banks
âą The most eventual consistent system
âą Write a check, which may or may not be covered
âą Bank will âbounceâ the check
âą Recoup funds if possible and charge a handsome
fee
#Cassandra13
16. Hurdles Faced
âą Engineers are stubborn!
â 1+1=2 .. not eventually 2
âą Middle management is scared
â Itâs a feat you convinced them to use C*
â Now you got to convince them to accept low consistency?
âą Engaging Product team to implement some type of
contingency plans
#Cassandra13
17. How to Overcome those Hurdles
âą Prove it through a POC
âą Show them the benefits of an improved user
experience
â Its all about the user
âą You may be working for the wrong company
â Weâre hiring!
â jobs.netflix.com
#Cassandra13