Science of mongodb
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Science of mongodb

on

  • 2,009 views

 

Statistics

Views

Total Views
2,009
Views on SlideShare
2,008
Embed Views
1

Actions

Likes
3
Downloads
18
Comments
0

1 Embed 1

https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • A system is consistent if an update is applied to all nodes at the same time. This pretty much means that standard database replication is not strongly consistent. Any system using a replica for reads runs the risk of using stale data.\n
  • A system in available if all clients can access some form of the data even during a partial failure.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Since we need to maintain partition tolerance, what are we willing to sacrifice?\n
  • In the case of choosing consistency over availability, the cluster will maintain integrity by refusing some requests. It may shut down, refuse writes, or refuse reads/writes for the chunks of data that are unavailable. (hint: This is what Mongo does)\n
  • If a cluster chooses availability over consistency during a failure, it will still respond to all requests. Stale reads and conflicting writes are often the outcome of this.\n
  • \n
  • This means during times of failure, we are sacrificing availability\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Mongo handles this in a pretty simple way, avoid complex transactions.\n
  • \n
  • Once again, without complex transactions, this really isn’t a problem\n
  • \n
  • \n
  • \n
  • \n

Science of mongodb Presentation Transcript

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