Interview :: mongoDB
A database profiler is used to collect data about MongoDB write operations, cursors, database commands on a running mongod instance. You can enable profiling on a per-database or per-instance basis.
The database profiler writes all the data it collects to the system. profile collection, which is a capped collection.
No. it is not possible to configure the cache size for MMAPv1 because MMAPv1 does not allow configuring the cache size.
For the WiredTiger storage engine, you can specify the maximum size of the cache that WiredTiger will use for all data. This can be done using storage.wiredTiger.engineConfig.cacheSizeGB option.
MongoDB uses reader-writer locks for concurrency. Reader-writer locks allow concurrent readers shared access to a resource, such as a database or collection, but give exclusive access to a single write operation.
What is the difference between MongoDB and Redis database?
- Redis is faster than MongoDB.
- Redis has a key-value storage whereas MongoDB has a document type storage.
- Redis is hard to code but MongoDB is easy.
What is the difference between MongoDB and CouchDB?
- MongoDB is faster than CouchDB while CouchDB is safer than MongoDB.
- Triggers are not available in MongoDB while triggers are available in CouchDB.
- MongoDB serializes JSON data to BSON while CouchDB doesn't storedata in JSON format.
What is the difference between MongoDB and Cassandra?
- MongoDB is cross-platform document-oriented database system while Cassandra is high performance distributed database system.
- MongoDB is written in C++ while Cassandra is written in Java.
- MongoDB is easy to administer in the case of failure while Cassandra provides high availability with no single point of failure.
You don't need to create a database manually in MongoDB because it creates automaically when you save the value into the defined collection at first time.