SlideShare a Scribd company logo
NoSQL Data Modeling
Concepts and Cases


Shashank Tiwari
blog: shanky.org | twitter: @tshanky
st@treasuryofideas.com
NoSQL?
NoSQL : Various Shapes and Sizes

• Document Databases


• Column-family Oriented Stores


• Key/value Data stores


• XML Databases


• Object Databases


• Graph Databases
Key Questions

• How do I model data for my application?


• How do I determine which one is right for me?


• Can I easily shift from one database to the other?


• Is there a standard way of storing, accessing, and querying data?
Agenda for this session

• Explore some of the main NoSQL products


• Understand how they are similar and different


• How best to use these products in the stack


•
Document Databases




• also GenieDB, SimpleDB
What is a document db?

• One that stores documents


• Popular options:


  • MongoDB -- C++


  • CouchDB -- Erlang


  • Also Amazon’s SimpleDB


• ...what exactly is a document?
In the real world




• (Source: http://guide.couchdb.org/draft/why.html)
In terms of JSON

• {name: “John Doe”,


• zip: 10001}
What about db schema?

• Schema-less


• Different documents could be stored in a single collection
Data types: MongoDB

• Essential JSON types:


• string


• integer


• boolean


• double
Data types: MongoDB (...cont)

• Additional JSON types


• null, array and object


• BSON types -- binary encoded serialization of JSON like documents


   • date, binary data, object id, regular expression and code


   • (Reference: bsonspec.org)
A BSON example: object id
Data types: CouchDB

• Everything JSON


• Large objects: attachments
CRUD operations for documents

• Create


• Read


• Update


• Delete
MongoDB: Create Document

• use mydb


• w = {name: “John Doe”, zip: 10001};


• db.location.save(w);
Create db and collection

• Lazily created


• Implicitly created


• use mydb


• db.collection.save(w)
MongoDB: Read Document

• db.location.find({zip: 10001});


• { "_id" : ObjectId("4c97053abe67000000003857"), "name" : "John Doe",
  "zip" : 10001 }
MongoDB: Read Document (...cont)

• db.location.find({name: "John Doe"});


• { "_id" : ObjectId("4c97053abe67000000003857"), "name" : "John Doe",
  "zip" : 10001 }
MongoDB: Update Document

• Atomic operations on single documents


• db.location.update( { name:"John Doe" }, { $set: { name: "Jane Doe" } } );
CouchDB: RESTful

• Supports REST verbs: GET, HEAD, PUT, POST, DELETE


• Supports Replication


• Supports the notion of attachments


• Could work in offline modes and supports small footprint profiles
Sorted Ordered Column-family Datastores

• Sorted


• Ordered


• Distributed


• Map
Essential schema
Multi-dimensional View
A Map/Hash View

•{


• "row_key_1" : { "name" : {


•     "first_name" : "Jolly", "last_name" : "Goodfellow"


•     } } },


•    "location" : { "zip": "94301" },
Architectural View (HBase)
The Persistence Mechanism
Model Wrappers (The GAE Way)

• Python


  • Model, Expando, PolyModel


• Java


  • JDO, JPA
HBase Data Access

• Thrift + Avro


• Java API -- HTable, HBaseAdmin


• Hive (SQL like)


• MapReduce -- sink and/or source
Transactions

• Atomic row level


• GAE Entity Groups
Indexes

• Row ordered


• Secondary indexes


• GAE style multiple indexes


  • thinking from output to query
Use cases

• Many Google’s Products


• Facebook Messaging


• StumbleUpon


  • Open TSDB


• Mahalo, Ning, Meetup, Twitter, Yahoo!


• Lily -- open source CMS built on HBase & Solr
Brewer’s CAP Theorem




• http://www.cs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf


• http://theory.lcs.mit.edu/tds/papers/Gilbert/Brewer6.ps
Distributed Systems & Consistency (case: success)
Distributed Systems & Consistency (case: failure)
Binding by Transactions
Consistency Spectrum
Inconsistency Window
RWN Math

• R – Number of nodes that are read from.


• W – Number of nodes that are written to.


• N – Total number of nodes in the cluster.




• In general: R < N and W < N for higher availability
R+W>N

• Easy to determine consistent state


• R + W = 2N


  • absolutely consistent, can provide ACID gaurantee


• In all cases when R + W > N there is some overlap between read and write
  nodes.
R = 1, W = N

• more reads than writes


•W=N


  • 1 node failure = entire system unavailable
R = N, W =1

•W=N


 • Chance of data inconsistency quite high


•R=N


 • Read only possible when all nodes in the cluster are available
R = W = ceiling ((N + 1)/2)
Effective quorum for eventual consistency
Eventual consistency variants

• Causal consistency -- A writes and informs B then B always sees updated
  value


• Read-your-writes-consistency -- A writes a new value and never see the old
  one


• Session consistency -- read-your-writes-consistency within a client session


• Monotonic read consistency -- once seen a new value, never return previous
  value


• Monotonic write consistency -- serialize writes by the same process
Dynamo Techniques

• Consistent Hashing (Incremental scalability)


• Vector clocks (high availability for writes)


• Sloppy quorum and hinted handoff (recover from temporary failure)


• Gossip based membership protocol (periodic, pair wise, inter-process
  interactions, low reliability, random peer selection)


• Anti-entropy using Merkle trees


• (source: http://s3.amazonaws.com/AllThingsDistributed/sosp/amazon-
  dynamo-sosp2007.pdf)
Consistent Hashing
CouchDB MVCC Style




• (Source: http://guide.couchdb.org/draft/consistency.html)
Key/value Stores

• Memcached


• Membase


• Redis


• Tokyo Cabinet


• Kyoto Cabinet


• Berkeley DB
Questions?




• blog: shanky.org | twitter: @tshanky


• st@treasuryofideas.com

More Related Content

What's hot (20)

PPTX
Mongo DB
Pradeep Shanmugam
 
PDF
MongoDB for Coder Training (Coding Serbia 2013)
Uwe Printz
 
PPT
5 Data Modeling for NoSQL 1/2
Fabio Fumarola
 
PPTX
Azure DocumentDB
Neil Mackenzie
 
PPS
SQL & NoSQL
Ahmad Awsaf-uz-zaman
 
PPT
MongoDB - An Agile NoSQL Database
Gaurav Awasthi
 
KEY
NoSQL: Why, When, and How
BigBlueHat
 
KEY
Benefits of using MongoDB: Reduce Complexity & Adapt to Changes
Alex Nguyen
 
PPTX
Cool NoSQL on Azure with DocumentDB
Jan Hentschel
 
PPTX
An Introduction To NoSQL & MongoDB
Lee Theobald
 
PPTX
Azure doc db (slideshare)
David Green
 
PPTX
Introduction à DocumentDB
MSDEVMTL
 
PPTX
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
SpringPeople
 
PPTX
[PASS Summit 2016] Azure DocumentDB: A Deep Dive into Advanced Features
Andrew Liu
 
PDF
The What and Why of NoSql
Matias Cascallares
 
PDF
Introduction to mongo db
Rohit Bishnoi
 
PPTX
MongoDB
Anthony Slabinck
 
PPTX
MongoDB Schema Design by Examples
Hadi Ariawan
 
MongoDB for Coder Training (Coding Serbia 2013)
Uwe Printz
 
5 Data Modeling for NoSQL 1/2
Fabio Fumarola
 
Azure DocumentDB
Neil Mackenzie
 
MongoDB - An Agile NoSQL Database
Gaurav Awasthi
 
NoSQL: Why, When, and How
BigBlueHat
 
Benefits of using MongoDB: Reduce Complexity & Adapt to Changes
Alex Nguyen
 
Cool NoSQL on Azure with DocumentDB
Jan Hentschel
 
An Introduction To NoSQL & MongoDB
Lee Theobald
 
Azure doc db (slideshare)
David Green
 
Introduction à DocumentDB
MSDEVMTL
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
SpringPeople
 
[PASS Summit 2016] Azure DocumentDB: A Deep Dive into Advanced Features
Andrew Liu
 
The What and Why of NoSql
Matias Cascallares
 
Introduction to mongo db
Rohit Bishnoi
 
MongoDB Schema Design by Examples
Hadi Ariawan
 

Viewers also liked (20)

PDF
Big Data Modeling
Hans Hultgren
 
PPTX
Data Modeling for NoSQL
Tony Tam
 
PDF
Data Modeling for Big Data
DATAVERSITY
 
PPTX
Ocean base海量结构化数据存储系统 hadoop in china
knuthocean
 
PDF
Couchdb and me
iammutex
 
PDF
Ooredis
iammutex
 
PDF
Mysql HandleSocket技术在SNS Feed存储中的应用
iammutex
 
PDF
Consistency Models in New Generation Databases
iammutex
 
PPT
8 minute MongoDB tutorial slide
iammutex
 
ODP
Consistency in Distributed Systems
Shane Johnson
 
PDF
Big Challenges in Data Modeling: NoSQL and Data Modeling
DATAVERSITY
 
PPT
skip list
iammutex
 
PDF
آموزش مدیریت بانک اطلاعاتی اوراکل - بخش سوم
faradars
 
PDF
Cache coherence
Shyam Krishna Khadka
 
PDF
Thoughts on Transaction and Consistency Models
iammutex
 
PDF
Data Modeling for Integration of NoSQL with a Data Warehouse
Daniel Upton
 
PDF
Boosting Machine Learning with Redis Modules and Spark
Dvir Volk
 
KEY
Schema Design with MongoDB
rogerbodamer
 
PDF
Coherence and consistency models in multiprocessor architecture
University of Pisa
 
PDF
Consistency in Distributed Systems
DATAVERSITY
 
Big Data Modeling
Hans Hultgren
 
Data Modeling for NoSQL
Tony Tam
 
Data Modeling for Big Data
DATAVERSITY
 
Ocean base海量结构化数据存储系统 hadoop in china
knuthocean
 
Couchdb and me
iammutex
 
Ooredis
iammutex
 
Mysql HandleSocket技术在SNS Feed存储中的应用
iammutex
 
Consistency Models in New Generation Databases
iammutex
 
8 minute MongoDB tutorial slide
iammutex
 
Consistency in Distributed Systems
Shane Johnson
 
Big Challenges in Data Modeling: NoSQL and Data Modeling
DATAVERSITY
 
skip list
iammutex
 
آموزش مدیریت بانک اطلاعاتی اوراکل - بخش سوم
faradars
 
Cache coherence
Shyam Krishna Khadka
 
Thoughts on Transaction and Consistency Models
iammutex
 
Data Modeling for Integration of NoSQL with a Data Warehouse
Daniel Upton
 
Boosting Machine Learning with Redis Modules and Spark
Dvir Volk
 
Schema Design with MongoDB
rogerbodamer
 
Coherence and consistency models in multiprocessor architecture
University of Pisa
 
Consistency in Distributed Systems
DATAVERSITY
 
Ad

Similar to SDEC2011 NoSQL Data modelling (20)

PDF
SDEC2011 NoSQL concepts and models
Korea Sdec
 
PPTX
Introduction to NoSQL
Yan Cui
 
PPTX
Webinar: Building Your First Application with MongoDB
MongoDB
 
PDF
Mongodb my
Alexey Gaziev
 
PDF
MongoDB
SPBRUBY
 
PPTX
MongoDB
Rony Gregory
 
PDF
NoSQL overview #phptostart turin 11.07.2011
David Funaro
 
PPTX
NoSQL and The Big Data Hullabaloo
Andrew Brust
 
PPTX
A Practical Look at the NOSQL and Big Data Hullabaloo
Andrew Brust
 
PDF
Spring one2gx2010 spring-nonrelational_data
Roger Xia
 
PPT
No sql Database
mymail2ashok
 
PPTX
No SQL : Which way to go? Presented at DDDMelbourne 2015
Himanshu Desai
 
PPTX
NoSQL, which way to go?
Ahmed Elharouny
 
PPT
Object Relational Database Management System
Amar Myana
 
PPTX
Drop acid
Mike Feltman
 
PDF
MongoDB: a gentle, friendly overview
Antonio Pintus
 
PDF
Solr cloud the 'search first' nosql database extended deep dive
lucenerevolution
 
PDF
NOsql Presentation.pdf
AkshayDwivedi31
 
PDF
NoSQL Introduction
ForwardSprint
 
SDEC2011 NoSQL concepts and models
Korea Sdec
 
Introduction to NoSQL
Yan Cui
 
Webinar: Building Your First Application with MongoDB
MongoDB
 
Mongodb my
Alexey Gaziev
 
MongoDB
SPBRUBY
 
MongoDB
Rony Gregory
 
NoSQL overview #phptostart turin 11.07.2011
David Funaro
 
NoSQL and The Big Data Hullabaloo
Andrew Brust
 
A Practical Look at the NOSQL and Big Data Hullabaloo
Andrew Brust
 
Spring one2gx2010 spring-nonrelational_data
Roger Xia
 
No sql Database
mymail2ashok
 
No SQL : Which way to go? Presented at DDDMelbourne 2015
Himanshu Desai
 
NoSQL, which way to go?
Ahmed Elharouny
 
Object Relational Database Management System
Amar Myana
 
Drop acid
Mike Feltman
 
MongoDB: a gentle, friendly overview
Antonio Pintus
 
Solr cloud the 'search first' nosql database extended deep dive
lucenerevolution
 
NOsql Presentation.pdf
AkshayDwivedi31
 
NoSQL Introduction
ForwardSprint
 
Ad

More from Korea Sdec (15)

KEY
SDEC2011 Big engineer vs small entreprenuer
Korea Sdec
 
PDF
SDEC2011 Implementing me2day friend suggestion
Korea Sdec
 
PDF
SDEC2011 Introducing Hadoop
Korea Sdec
 
PDF
Sdec2011 shashank-introducing hadoop
Korea Sdec
 
PDF
SDEC2011 Essentials of Pig
Korea Sdec
 
PDF
SDEC2011 Essentials of Mahout
Korea Sdec
 
PDF
SDEC2011 Essentials of Hive
Korea Sdec
 
ZIP
Sdec2011 Introducing Hadoop
Korea Sdec
 
PDF
SDEC2011 Replacing legacy Telco DB/DW to Hadoop and Hive
Korea Sdec
 
PDF
SDEC2011 Rapidant
Korea Sdec
 
PDF
SDEC2011 Mahout - the what, the how and the why
Korea Sdec
 
PDF
SDEC2011 Going by TACC
Korea Sdec
 
PDF
SDEC2011 Glory-FS development & Experiences
Korea Sdec
 
PDF
SDEC2011 Using Couchbase for social game scaling and speed
Korea Sdec
 
PDF
SDEC2011 Arcus NHN memcached cloud
Korea Sdec
 
SDEC2011 Big engineer vs small entreprenuer
Korea Sdec
 
SDEC2011 Implementing me2day friend suggestion
Korea Sdec
 
SDEC2011 Introducing Hadoop
Korea Sdec
 
Sdec2011 shashank-introducing hadoop
Korea Sdec
 
SDEC2011 Essentials of Pig
Korea Sdec
 
SDEC2011 Essentials of Mahout
Korea Sdec
 
SDEC2011 Essentials of Hive
Korea Sdec
 
Sdec2011 Introducing Hadoop
Korea Sdec
 
SDEC2011 Replacing legacy Telco DB/DW to Hadoop and Hive
Korea Sdec
 
SDEC2011 Rapidant
Korea Sdec
 
SDEC2011 Mahout - the what, the how and the why
Korea Sdec
 
SDEC2011 Going by TACC
Korea Sdec
 
SDEC2011 Glory-FS development & Experiences
Korea Sdec
 
SDEC2011 Using Couchbase for social game scaling and speed
Korea Sdec
 
SDEC2011 Arcus NHN memcached cloud
Korea Sdec
 

Recently uploaded (20)

PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
July Patch Tuesday
Ivanti
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
July Patch Tuesday
Ivanti
 

SDEC2011 NoSQL Data modelling

  • 1. NoSQL Data Modeling Concepts and Cases Shashank Tiwari blog: shanky.org | twitter: @tshanky st@treasuryofideas.com
  • 3. NoSQL : Various Shapes and Sizes • Document Databases • Column-family Oriented Stores • Key/value Data stores • XML Databases • Object Databases • Graph Databases
  • 4. Key Questions • How do I model data for my application? • How do I determine which one is right for me? • Can I easily shift from one database to the other? • Is there a standard way of storing, accessing, and querying data?
  • 5. Agenda for this session • Explore some of the main NoSQL products • Understand how they are similar and different • How best to use these products in the stack •
  • 6. Document Databases • also GenieDB, SimpleDB
  • 7. What is a document db? • One that stores documents • Popular options: • MongoDB -- C++ • CouchDB -- Erlang • Also Amazon’s SimpleDB • ...what exactly is a document?
  • 8. In the real world • (Source: http://guide.couchdb.org/draft/why.html)
  • 9. In terms of JSON • {name: “John Doe”, • zip: 10001}
  • 10. What about db schema? • Schema-less • Different documents could be stored in a single collection
  • 11. Data types: MongoDB • Essential JSON types: • string • integer • boolean • double
  • 12. Data types: MongoDB (...cont) • Additional JSON types • null, array and object • BSON types -- binary encoded serialization of JSON like documents • date, binary data, object id, regular expression and code • (Reference: bsonspec.org)
  • 13. A BSON example: object id
  • 14. Data types: CouchDB • Everything JSON • Large objects: attachments
  • 15. CRUD operations for documents • Create • Read • Update • Delete
  • 16. MongoDB: Create Document • use mydb • w = {name: “John Doe”, zip: 10001}; • db.location.save(w);
  • 17. Create db and collection • Lazily created • Implicitly created • use mydb • db.collection.save(w)
  • 18. MongoDB: Read Document • db.location.find({zip: 10001}); • { "_id" : ObjectId("4c97053abe67000000003857"), "name" : "John Doe", "zip" : 10001 }
  • 19. MongoDB: Read Document (...cont) • db.location.find({name: "John Doe"}); • { "_id" : ObjectId("4c97053abe67000000003857"), "name" : "John Doe", "zip" : 10001 }
  • 20. MongoDB: Update Document • Atomic operations on single documents • db.location.update( { name:"John Doe" }, { $set: { name: "Jane Doe" } } );
  • 21. CouchDB: RESTful • Supports REST verbs: GET, HEAD, PUT, POST, DELETE • Supports Replication • Supports the notion of attachments • Could work in offline modes and supports small footprint profiles
  • 22. Sorted Ordered Column-family Datastores • Sorted • Ordered • Distributed • Map
  • 25. A Map/Hash View •{ • "row_key_1" : { "name" : { • "first_name" : "Jolly", "last_name" : "Goodfellow" • } } }, • "location" : { "zip": "94301" },
  • 28. Model Wrappers (The GAE Way) • Python • Model, Expando, PolyModel • Java • JDO, JPA
  • 29. HBase Data Access • Thrift + Avro • Java API -- HTable, HBaseAdmin • Hive (SQL like) • MapReduce -- sink and/or source
  • 30. Transactions • Atomic row level • GAE Entity Groups
  • 31. Indexes • Row ordered • Secondary indexes • GAE style multiple indexes • thinking from output to query
  • 32. Use cases • Many Google’s Products • Facebook Messaging • StumbleUpon • Open TSDB • Mahalo, Ning, Meetup, Twitter, Yahoo! • Lily -- open source CMS built on HBase & Solr
  • 33. Brewer’s CAP Theorem • http://www.cs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf • http://theory.lcs.mit.edu/tds/papers/Gilbert/Brewer6.ps
  • 34. Distributed Systems & Consistency (case: success)
  • 35. Distributed Systems & Consistency (case: failure)
  • 39. RWN Math • R – Number of nodes that are read from. • W – Number of nodes that are written to. • N – Total number of nodes in the cluster. • In general: R < N and W < N for higher availability
  • 40. R+W>N • Easy to determine consistent state • R + W = 2N • absolutely consistent, can provide ACID gaurantee • In all cases when R + W > N there is some overlap between read and write nodes.
  • 41. R = 1, W = N • more reads than writes •W=N • 1 node failure = entire system unavailable
  • 42. R = N, W =1 •W=N • Chance of data inconsistency quite high •R=N • Read only possible when all nodes in the cluster are available
  • 43. R = W = ceiling ((N + 1)/2) Effective quorum for eventual consistency
  • 44. Eventual consistency variants • Causal consistency -- A writes and informs B then B always sees updated value • Read-your-writes-consistency -- A writes a new value and never see the old one • Session consistency -- read-your-writes-consistency within a client session • Monotonic read consistency -- once seen a new value, never return previous value • Monotonic write consistency -- serialize writes by the same process
  • 45. Dynamo Techniques • Consistent Hashing (Incremental scalability) • Vector clocks (high availability for writes) • Sloppy quorum and hinted handoff (recover from temporary failure) • Gossip based membership protocol (periodic, pair wise, inter-process interactions, low reliability, random peer selection) • Anti-entropy using Merkle trees • (source: http://s3.amazonaws.com/AllThingsDistributed/sosp/amazon- dynamo-sosp2007.pdf)
  • 47. CouchDB MVCC Style • (Source: http://guide.couchdb.org/draft/consistency.html)
  • 48. Key/value Stores • Memcached • Membase • Redis • Tokyo Cabinet • Kyoto Cabinet • Berkeley DB
  • 49. Questions? • blog: shanky.org | twitter: @tshanky • st@treasuryofideas.com