acid vs base in nosql: another false dichotomy
TRANSCRIPT
Dan Sullivan, PrincipalDS Applied Technologies
NoSQL Now! 2015August 18-20, 2015San Jose, California
ACID vs BASE:Yet Another False
Dichotomy
My Background◆ Data Architect / Engineer
◆ NoSQL and relational data modeler◆ Big data◆ Analytics, machine learning and text
mining◆ Cloud computing
◆ Author◆ No SQL for Mere Mortals◆ Contributor to TechTarget
◆ SearchDataManagement◆ SearchCloudComputing◆ SearchAWS
Overview◆ Quick Intro to ACID and BASE
◆ CAP Theorem
◆ Tradeoffs
◆ Finding a Sweet Spot on the Spectrum
◆ Questions
*Quick Intro to ACID and BASE
Image: blog.mark-taylor.com/Arizona/borrego/2014/08/08/what-is-your-bodys-ph-level/
*ACID
◆ Atomicity - All operations in a transaction succeed or fail together. No partial sets of operations.
◆ Consistency - The database is never in an inconsistent state.
◆ Isolation - Transactions do not interfere with one another
◆ Durability - Transactions are persistent over time and database restarts.
Image: http://www.mhhe.com/physsci/chemistry/chang7/esp/folder_structure/cr/m3/s3/
*BASE
◆ Basic Availability - Tolerate partial failure
◆ Soft State - state of database may change
◆ Eventual Consistency - may be inconsistent in short term, consistent in long term
Image: http://www.mhhe.com/physsci/chemistry/chang7/esp/folder_structure/cr/m3/s3/
*Just Say No To Food Fights
Image: www.zephoria.org/lakoff/2004/10/jon-stewart-on-crossfire.html
*CAP Theorem
Consistency Availability
Partition Tolerance
*You Can’t Have It All
*Actually, you can but … vertical scaling will cost you
*What are You Willing to Sacrifice?
Image: 9gagofthrones.com/tag/ned-stark-dead/
*Consistency? Which One?
◆ Causal
◆ Read-Your-Writes Consistency
◆ Session Consistency
◆ Monotonic Read Consistency
◆ Monotonic Write Consistency
Image: www.pitara.com
*Tradeoffs
*Write Consistency: How Low Can You Go?
◆ Consistency level of NoSQL DB specifies number of successful writes needed
◆ Lower consistency level can yield lower latency operations
◆ Higher consistency yields potentially higher availability
Image: www.bigtrends.com
*Read Consistency: Do You See What I
See?
◆ Network Partitions Fail
◆ Writes are not replicated immediately
◆ Possibly,same query different result
Image: www.pitara.com
*What is Your Tolerance?
Image: www.rosstraining.com (modified)
Inconsistency
*Finding a Sweet Spot on the ACID-
BASE Spectrum
*Partitioning
◆ Functional Partitioning◆ Decompose data by function◆ Use constraints to ensure integrity◆ Isolate constraints to a functional group◆ Vertically scale by functional group
◆ When Functional Partitioning is Not Enough Shard◆ Split functional groups of data across database servers◆ Benefits fo scalability and availability ◆ Introduces CAP Theorem Constraints
*Out of the Database and Into the Application
◆ Without ACID transactions in database, application handles more data management
◆ Balance low latency with high availability
◆ Application code becomes complex when need strong consistency and wide-area replication
Image: http://www.learnamericanenglishonline.com/
*Questions to Ask
◆ Can you tolerate inconsistency across functional groups?
◆ Which type of consistency is needed?
◆ Is short term inconsistency acceptable?
◆ Can an end user ever see the effect of an inconsistent state?
Image: http://www.learnamericanenglishonline.com/
*Where is this Leading?Image: http://www.learnamericanenglishonline.com/
“Google is living a few years in the future and sending the rest of us messages.”Doug Cutting
Hadoop Co-creator
◆ Increasing Support for ACID in NoSQL
◆ Fine-grained Management of CAP Constraints◆ Paxos state machines◆ Replication controlled at application level◆ Synchronous replication (Google Megastore), longer latency
◆ Point in time Consistency
◆ Better methods to deal with clock uncertainty
*From the Makers of BigTable
Image: http://static.googleusercontent.com/media/research.google.com/en//archive/spanner-osdi2012.pdf
Inconsistency
Questions?