What is it anyway ?● Document Oriented● High performance● Highly available● Horizontally Scalable● Open Source● NoSQL database
Data model - DocumentOriented● Documents (objects) map nicely toprogramming language data types.○ Document = PHP array, ruby hash, python dictionary● Embedded documents and arrays reduceneed for joins.● Dynamic schema makes polymorphismeasier.● 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 embeddeddocuments and arrays.● Optional streaming writes (noacknowledgments).
NoSql - why should I care ?● Data has changed - unstructured dataDynamic 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 biggermachines● Simplicity less ops when things growScalable
Why not anything else ?● Built with developers in mind, not ops● Available on all platforms - client librarybindings 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 atomicoperations within a single document.
RDBMS refugeesDB server mysqld mongodDB client mysql mongoHighest storage unit database databaseLogical data table collectionrow row documentcolumn column fieldJoin Join Embedded DocDistribute partition shard
Hybrid RDBMS-MongoDBApplications● 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 extendedtables 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