MongoDB 101
Click here to load reader
-
Upload
dharmesh-kakadia -
Category
Technology
-
view
1.276 -
download
0
description
Transcript of MongoDB 101
MongoDB 101Just enough to start playing
What is it anyway ?● Document Oriented● High performance● Highly available● Horizontally Scalable● Open Source● NoSQL database
Data model - Document Oriented● Documents (objects) map nicely to
programming language data types.○ Document = PHP array, ruby hash, python dictionary
● Embedded documents and arrays reduce need for joins.
● Dynamic schema makes polymorphism easier.
● JSON-style, stored as BSON
High Performance● Written in C++● use of memory mapped files● Serialization in BSON for fast parsing● Embedding● Indexes can include keys from embedded
documents and arrays.● Optional streaming writes (no
acknowledgments).
NoSql - why should I care ?● Data has changed - unstructured data
Dynamic schemas
● Performance○ Auto sharding○ replication○ distributed, but integrated cache
● Depends on what is your data○ Key-value○ column oriented ○ graph
● Horizontal vs Vertical● More data needs more machines, not bigger
machines● Simplicity less ops when things grow
Scalable
Why not anything else ?● Built with developers in mind, not ops● Available on all platforms - client library
bindings available for almost all languages (Erlang, Haskell, lua, smalltalk, prolog,..)
● 10gen and great community behind● Near to RDBMS in NoSQL landscape.
Similar to MyISAM storage engine for mysql● MongoDB does have support for atomic
operations within a single document.
RDBMS refugees
DB server mysqld mongod
DB client mysql mongo
Highest storage unit database database
Logical data table collection
row row document
column column field
Join Join Embedded Doc
Distribute partition shard
Hybrid RDBMS-MongoDB Applications● Both has its own advantages● Use right tool for right job● We do need transections, joins and RDBMS● Not as complicated as you might think !!● Think mongodb collections as extended
tables from your RDBMS.
● GridFS● MapReduce support● Sharded and Replica deployment● Aggregation● Indexing● Rest interface● ops - monitoring,backup,security● geo-spatial features● and ... lot more...
A lot of other cool stuff
References● http://www.mongodb.org
● http://www.10gen.com/presentations
● MongoDB- The Definitive Guide
● Tips & Tricks for mongoDB developers
Thanks !!
@dharmeshkakadia