MongoDB Interview Questions and Answers

What do you mean by 32 bit nuances in MongoDB?

The 32 bit is extra memory mapped file activity with journaling. This will further constraints the limited database size of 32 bit include. So, the new journaling by default is disabled on 32 bit systems.

 Is an update fsync to disk immediately?

No, write to disk are lazy by default. A write may hit disk a two seconds later.

For example, if the database receives a thousand grows into an object within one second, it will only be flushed into disk once. Note fsync options are present, though both at the command line and via getLastError_old.

Mention how to do transactions and locking?

MongoDB does not use the traditional pr complex transactions with rollback as it is created to be lightweight and fast and predictable in its performance. So, it can be thought of an analogue to the MySQL MyISAM and automatic model. By the keeping transaction support extremely simple, performance is enhanced only in a system that may run against many servers.

Explain why my data files so large?

MongoDB does aggressive reallocation reserved space to avoid file system fragmentation.

Mention which language you can use with MongoDB?

MongoDB users drivers supports all the most popular programming languages so there is no problem of language you can utilize any language that you want.

What do you understand by Sharding in MongoDB?

Procedure of storing data records across more machines is provided as Sharding. The Sharding is a MongoDB method to meet the demands of the data increase. Sharding is the horizontal partition of data into a search engine or databases. Each partition is provided as shard and database shard.

Mention how can you see the connection used by MongoDB?

To see the connection used by MongoDB use db_adminCommand (“connPoolStats”);

What is the replica set in MongoDB?

In MongoDB a replica set is a group of mango instances that host the same data set. In which one node is primary 2nd node is secondary. From primary to the secondary node a whole data replicates.

Mention what are the difference between MongoDB and CouchDB?

The MongoDB and CouchDB both are the best example of an open source NoSQL database. In other word MongoDB and CouchDB are document oriented databases. So, we can say that, MongoDB and CouchDB both storage data but there is a big difference between them in terms of implementation of their data, interfaces, models, object storage and replication method etc.