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
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.
language is mapped to a record in database. So if the data is simple and database support it then there is no mismatch. But if the data is polymorphic and have unsupported types then the mapping will be difficult which causes a impedance mismatch. In mongodb data is of JSON format so it can map well to the object.
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)
• 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
directory eg: mkdir -p /data/db • create a configuration file (optional) eg: /etc/mongodb.conf • start the mongodb server sudo mongod -f /etc/mongodb.conf OR use init script. • connect to the database using javascript console mongo You will get connected to test database.