Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
The Science ofMongoDB  @ethangunderson      MongoDC 2011
Hiring
1)CAP?2)What does MongoDB do about it?3)Compare and Contrast4)ACID?5)How it relates to MongoDB
Questions?Comments?Shout Out!
CAP Theorem
Eric Brewer
ConsistencyAvailabilityPartition Tolerance
Consistency  All clients have thesame view of the data
AvailabilityAll clients have access       to all data
Partition Tolerance       The system’s  properties hold true in   the case of partitions
Pick Two
CAThis is not a real option.
You Canʼt SacrificePartition Tolerance http://codahale.com/you-  cant-sacrifice-partition-         tolerance/
When a failure happens, what am I sacrificing?    Consistency         or    Availability?
CP The system sacrifices availability in order tomaintain data consistency
AP  The system sacrificesconsistency to ensure the most uptime as possible
What is Mongo?
CPSince, by default, Mongo routes  all requests to a master, it is        strongly consistent
MasterSlave            Slave
MasterSlave            Slave
MasterSlave            Slave
Replica Set   Replica Set
Replica Set   Replica Set
Optionally AP
Master Client:slaveOK           Slave           Slave
(Amazon Dynamo)
AP As long as one node isup, the cluster can service    read/write requests
foo: 12foo: nil   foo: 35
ACID
AtomicityAll transactions are  “all or nothing”
Consistency All transactions takethe database from onevalid state to the next
Isolation  Transactions cannotaccess data modified in another uncompleted      transaction
DurabilityThe ability to recovercommitted transaction      updates
Consistency    !=Consistency
Thanks!
Science of mongodb
Science of mongodb
Science of mongodb
Science of mongodb
Science of mongodb
Upcoming SlideShare
Loading in …5
×

Science of mongodb

2,603 views

Published on

Published in: Technology, Education
  • Be the first to comment

Science of mongodb

  1. 1. The Science ofMongoDB @ethangunderson MongoDC 2011
  2. 2. Hiring
  3. 3. 1)CAP?2)What does MongoDB do about it?3)Compare and Contrast4)ACID?5)How it relates to MongoDB
  4. 4. Questions?Comments?Shout Out!
  5. 5. CAP Theorem
  6. 6. Eric Brewer
  7. 7. ConsistencyAvailabilityPartition Tolerance
  8. 8. Consistency All clients have thesame view of the data
  9. 9. AvailabilityAll clients have access to all data
  10. 10. Partition Tolerance The system’s properties hold true in the case of partitions
  11. 11. Pick Two
  12. 12. CAThis is not a real option.
  13. 13. You Canʼt SacrificePartition Tolerance http://codahale.com/you- cant-sacrifice-partition- tolerance/
  14. 14. When a failure happens, what am I sacrificing? Consistency or Availability?
  15. 15. CP The system sacrifices availability in order tomaintain data consistency
  16. 16. AP The system sacrificesconsistency to ensure the most uptime as possible
  17. 17. What is Mongo?
  18. 18. CPSince, by default, Mongo routes all requests to a master, it is strongly consistent
  19. 19. MasterSlave Slave
  20. 20. MasterSlave Slave
  21. 21. MasterSlave Slave
  22. 22. Replica Set Replica Set
  23. 23. Replica Set Replica Set
  24. 24. Optionally AP
  25. 25. Master Client:slaveOK Slave Slave
  26. 26. (Amazon Dynamo)
  27. 27. AP As long as one node isup, the cluster can service read/write requests
  28. 28. foo: 12foo: nil foo: 35
  29. 29. ACID
  30. 30. AtomicityAll transactions are “all or nothing”
  31. 31. Consistency All transactions takethe database from onevalid state to the next
  32. 32. Isolation Transactions cannotaccess data modified in another uncompleted transaction
  33. 33. DurabilityThe ability to recovercommitted transaction updates
  34. 34. Consistency !=Consistency
  35. 35. Thanks!

×