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

Science of mongodb

on

  • 1,979 views

 

Statistics

Views

Total Views
1,979
Views on SlideShare
1,978
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 Science of mongodb Presentation Transcript

  • 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!