Interview :: mongoDB
MongoDB client drivers supports all the popular programming languages so there is no issue of language, you can use any language that you want.
Does MongoDB database have tables for storing records?
No. Instead of tables, MongoDB uses "Collections" to store data.
Yes. MongoDB databases have dynamic schema. There is no need to define the structure to create collections.
MongoDB's cache is not configurable. Actually MongoDb uses all the free spaces on the system automatically by way of memory mapped files.
MongoDB doesn't use traditional locking or complex transaction with Rollback. MongoDB is designed to be light weighted, fast and predictable to its performance. It keeps transaction support simple to enhance performance.
Because MongoDB uses memory mapped files so when you run a 32-bit build of MongoDB, the total storage size of server is 2 GB. But when you run a 64-bit build of MongoDB, this provides virtually unlimited storage size. So 64-bit is preferred over 32-bit.
Yes, These files can be deleted once the operations are done because these files are made as backups during normal shard balancing operation. This is a manual cleanup process and necessary to free up space.
If a shard is down and you even do query then your query will be returned with an error unless you set a partial query option. But if a shard is slow them Mongos will wait for them till response.
A query is called covered query if satisfies the following two conditions:
- The fields used in the query are part of an index used in the query.
- The fields returned in the results are in the same index.
Covered query makes the execution of the query faster because indexes are stored in RAM or sequentially located on disk. It makes the execution of the query faster.
Covered query makes the fields are covered in the index itself, MongoDB can match the query condition as well as return the result fields using the same index without looking inside the documents.