Loading presentation...

Present Remotely

Send the link below via email or IM


Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.



No description

Jeremy Jones

on 13 August 2010

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of MongoDB

The of Document Databases, Key-Value Stores, and RDBMs Best Features mongo DB MongoDB bridges the gap between key-value stores (which are fast and highly scalable) and traditional RDBMS systems (which provide rich queries and deep functionality). MongoDB (from "hu us") is a scalable, high-performance, open source, document-oriented database. Written in C++. mongo MongoDB Features Document-oriented storage JSON-style documents with dynamic
schemas offer simplicity and power. Full Index Support Index on any attribute,
just like you're used to. Replication &
High Availability Mirror across LANs and WANs
for scale and peace of mind. Auto-Sharding Scale horizontally without compromising functionality. Querying Rich, document
based queries. Fast In-Place Updates Atomic modifiers for contention-free performance. Map/Reduce Flexible aggregation
and data processing. GridFS Store files of any size without complicating your stack.
Use Documents to Select Documents db.users.find({}) Empty document finds (returns)
ALL documents in the collection A "Collection" is essentially a table db.users.find({'last_name': 'Smith'}) Return all documents where the
field 'last_name' contains the
value 'Smith' db.users.find({'last_name': 'Smith', 'first_name': 'John'}) Return all documents where the
field 'last_name' contains the
value 'Smith' AND 'first_name'
contains 'John' (SELECT * FROM users) (SELECT * FROM users WHERE last_name='Smith') (SELECT * FROM users WHERE
last_name='Smith' AND
first_name='John' db.users.find({'last_name': 'Smith',
'first_name': 'John'}, {ssn:1}) Return the field 'ssn' where the
field 'last_name' contains the
value 'Smith' AND 'first_name'
contains 'John' (SELECT ssn FROM users WHERE
last_name='Smith' AND
first_name='John') db.users.find({'last_name': 'Smith',
'first_name': 'John'}, {ssn:0}) Return every field except 'ssn' where
'last_name' contains the 'Smith'
AND 'first_name' contains 'John' (SELECT first_name, last_name
last_name='Smith' AND
first_name='John') Limits MongoDB also supports skip and limit for easy paging. Here we page through the first 30 users 10 at a time. db.users.find().skip(10).limit(10) db.users.find().limit(10) db.users.find().skip(20).limit(10) First 10 records Third 10 records Second 10 records mongoDB supports all
of the expected compairison
Operators <, <=, >, >= $ne, $in, $nin, etc. As well as many built-in
modifier functions sort(), group(), limit(), skip(), snapshot(), and count() For more info see mongoDB's website
http://www.mongodb.org/ Questions? NoSQL Style Style Database NoSQL is a movement promoting a loosely defined class of non-relational data stores that typically do not require fixed table schemas, avoid join operations and scale horizontally. Notable production implementations include Google's BigTable and Amazon's Dynamo. The many publicly available open source variants include MongoDB and Cassandra. Joins Are Expensive I/O latency Must inspect every record for join conditions
Sometimes more than once Database Optimazation usually maeans
Join Optimazation.

Indexes increase performance when finding join conditions
Denormalization deals with I/O latency (and reduces or eliminates the need to join at all) Remember this one
It's important. RDBMs are easy to scale vertically
but hard to scale horizontally. To scale vertically, you increase the performance of a single server instance

This means adding CPU, Memory, Disk space, etc. To scale horizontally, you increase the number of server instances. i.e. clustering While many RDBMs do support clustering, it usualy leaves the developer with most of the work. NoSQL databases are designed around the idea of horizontal scale. Why Live? Three Key Features Dynamic Schema Single Table Clustering No big schema changes Almost as fast as memcache ...and Jeremy's favorite Really easy clustering
Full transcript