MongoDB● Document oriented a. Objects are mapped as documents b. Documents can be embedded c. Dynamically typed● No Schema● High availability a. Replication through sharding. b. Automatic failover● Easy scaling a. Auto shrading ( auto partitioning data across servers)● Speed
Programming Language SupportSupported by all the popular programminglanguages (C++, Java, Python, Ruby, Go, Haskeletc...) and web frameworks ( Rails, Django etc).
Interesting FactThere are MongoDB systems that exceed one million operations per second.
MongoDB document modelKey Key Value Field Document Collection Database
Why should we use Mongodb● Easy to scale● Coding velocity (agility)● No impedance mismatch● Allows dynamic schema ( No Schema, agility)● Easier to store and manipulate polymorphic data● Variety of Indexing● A MapReduce tool.
Impedance MismatchIn object relational mapping an object inprogramming language is mapped to a record indatabase. So if the data is simple and databasesupport it then there is no mismatch.But if the data is polymorphic and have unsupportedtypes then the mapping will be difficult whichcauses a impedance mismatch.In mongodb data is of JSON format so it can mapwell to the object.
Where should we avoid MongoDB● Problems with SQL support.● Systems with heavy emphasis on complex transactions such as banking.● Data Warehousing whose underlying database are schema based.
Indexing● Indexing can be done on a field● Indexing can be done on an embedded object.● Sparse indexing - Indexing based existence of field.● TTL index● Geospatial Index ( Location based access)● Geohaystack index (Bucket based small regions)
MongoDB/Utilities● mongodump => Dump tool for backup and snapshot● mongorestore => Restore a dump● mongoexport => Export a single collection to JSON or CSV● mongoimport => Import from JSON or CSV● mongofiles => Utility for putting and getting files from MongoDB GridFS● mongostat => Performance statistics tool
Edda - Admin Tool● Edda provides a graphical visualization of mongodb servers .● Edda provides an easy way to check the status in multiserver configuration.
Companies Using MongoDB● Foursquare● MTV networks● Disney● Customlnk● Sourceforge● Wowmakers● and many others ....