MongoDB is a document-oriented DBMS. Data in MongoDB is stored in documents, which are combined into collections. Each document is a JSON-like structure. Drawing an analogy with relational DBMSs, we can say that collections correspond to tables and documents correspond to rows in tables. Maximum document size in MongoDB 2.x is 16 Mb (in earlier versions - only 4 Mb);


    Unlike RDBMS, MongoDB doesn't require any description of the database schema - it can gradually change as the application evolves, which is handy;

    Indexes are supported, including arrays and nested documents, as well as geospatial indexes. Unique and composite indexes are supported;

    MongoDB also has atomic operations, compare-and-swap, cursors, write without confirmation, and even MapReduce;

    Collection size in MongoDB can be limited to the number of documents or megabytes. If the collection gets too large, old documents will be deleted. This feature can come in handy if you're going to store some temporary data in MongoDB;

    The MongoDB interface looks a lot like DBIx::Class. We get ORM out of the box. JavaScript functions can be used in queries;

    MongoDB supports journaling as well as asynchronous replication of two kinds - master-slave replication and replica sets. The MongoDB developers recommend using the latter. A replica set is the same as a master-slave, but if a master fails, a new master is automatically selected among the replicas. After resuming its work, the former master becomes a replica;

    Perhaps the most significant feature of MongoDB is that documents can be automatically segmented across multiple replica sets. Segmentation is by range; a segment key (shard key) is used to assign a document to a specific range. The data is distributed among the replica sets so that each set contains approximately the same amount of data. If the cluster becomes overloaded, you can simply add another replica set to it - data redistribution will occur automatically;

    You can store binary data in MongoDB documents - pictures, mp3 and so on. However, for data larger than 1 MB, it is recommended to use GridFS. GridFS is a convention for storing arbitrarily sized files in MongoDB, supported by all official drivers.