MongoDB is currently the best free open source NoSQL database for documentation. If you are preparing to participate in the technical interview of MongoDBNoSQL database, you 'd better take a look at the following MongoDBNoSQL interview Q &. These MongoDBNoSQL interview questions and answers cover the basic concepts of NoSQL databases. MongoDB interview NoSQL
MongoDB is currently the best free open source NoSQL database for documentation. If you are preparing to attend a technical interview with The MongoDB NoSQL database, you 'd better take a look at the following MongoDB NoSQL interview Q &. These MongoDB NoSQL interview questions and answers cover the basic concepts of NoSQL databases, such as Replication, Sharding, transactions and locks, Profiler, Nuances, and logs. Let's take a look at the following interview questions and answers for these MongoDB NoSQL databases:
1. what do you mean by NoSQL databases? What is the direct difference between NoSQL and RDBMS? Why should I use and not use NoSQL databases? What are the advantages of NoSQL databases?
I wrote a complete blog to answer these questions.
2. what types of NoSQL databases are available?
NoSQL database type
For example: MongoDB, Cassandra, CouchDB, Hypertable, Redis, Riak, Neo4j, HBASE, Couchbase, MemcacheDB, RevenDB and Voldemort are the examples of NoSQL databases. read more.
3. What is the most basic difference between MySQL and MongoDB?
Both MySQL and MongoDB are free and open-source databases. There are many basic differences between MySQL and MongoDB, including data representation, query, relationship, transaction, schema design and definition, standardization, speed and performance. By comparing MySQL and MongoDB, we are actually comparing relational and non-relational databases. Read more
4. how do you compare MongoDB, CouchDB, and CouchBase?
Both MongoDB and CouchDB are document-oriented databases. MongoDB and CouchDB are the most typical examples of open-source NoSQL databases. They all have nothing to do with document storage. MongoDB and CouchDB have many differences in data model implementation, interfaces, object storage, and replication methods.
For details, see the following link:
MongDB vs CouchDB
CouchDB vs CouchBase
5. Why does MongoDB become the best NoSQL database?
The following features make MongoDB the best NoSQL database:
FILE-oriented
High performance
High Availability
Scalability
Rich query languages
What are the nuances of the 6.32-bit system?
Journaling activates additional memory ing files. This will further reduce the size of the 32-bit database. Therefore, journaling is disabled by default on 32-bit systems.
7. will journal playback encounter problems when the entry is incomplete (for example, a midway fault happens?
The write operations of each journal (group) are the same. unless it is complete, it will not be played back during the recovery process.
8. what is the role of analyzer in MongoDB?
MongoDB includes a database analyzer that displays the performance characteristics of each operation in the database. With this analyzer, you can find queries (or write operations) that are slower than expected. with this information, for example, you can determine whether to add indexes.
9. what is a namespace?
MongoDB stores BSON objects in collection. The database name and cluster name are linked in a period called namespace ).
10. if a user removes an object attribute, will this attribute be deleted from the storage layer?
Yes. the user removes the attribute and the object will be saved again (re-save ()).
11. Can I use log features for secure backup?
Yes.
12. are null values allowed?
For object members, yes. However, users cannot add null values to the database cluster because the null value is not an object. However, you can add an empty object {}.
13. is the update operation immediately fsync to the disk?
No. disk write operations are delayed by default. The write operation may arrive at the disk in two or three seconds (within 60 seconds by default. For example, if the database receives one thousand incremental operations on one object within one second, it only refreshes the disk once. (Note that although the fsync option is valid on the command line and after getLastError_old ??).
14. how to execute the transaction/lock?
MongoDB does not use traditional locks or complex rollback transactions because it is designed to be lightweight, fast, and predictable high performance. It can be analogous to the automatic submission mode of MySQL MylSAM. By streamlining the support for transactions, the performance is improved, especially in a system that may pass through multiple servers.
15. Why is my data file so large?
MongoDB actively pre-allocates reserved space to prevent file system fragments.
16. How long does it take to enable backup fault recovery?
It takes 10 to 30 seconds to declare that the primary database is down and select a backup database as the new primary database. During this period, operations on the primary database will fail-including write and strong consistent read operations. However, you can still execute the final consistency query (eventually consistent query) on the second Database (in slaveOk mode), even during this time.
17. what is master or primary?
It is the primary node/member responsible for processing all write operations in the current backup cluster (replica set. In a backup cluster, when a fault occurs, another member becomes primary.
18. what is secondary or slave?
The second day copies the corresponding operation from the current primary. It is achieved by tracking and copying oplog (local. oplog. rs.
19. Do I have to call getLastError to make sure the write operation takes effect?
No. No matter whether you call the getLastError (also called "Safe Mode") server, the operations are the same. GetLastError is called only to confirm that the write operation has been successfully submitted. Of course, you often want to confirm, but the security and effectiveness of write operations are not determined by this.
20. Should I start out with sharded or with a non-sharded MongoDB environment? Should I start a sharded cluster or a non-sharded MongoDB environment?
For ease of development, we recommend that you start a MongoDB environment in non-sharded cluster mode unless one server is insufficient to store your initial dataset. Upgrading from non-cluster sharding to cluster sharding is seamless. Therefore, you do not need to consider sharding when your dataset is not large ).
21. how does sharding and replication work?
Each shard is a logical set of partition data. A shard may consist of a single server or cluster. we recommend that you use a cluster for each shard.
22. When will the data be extended to multiple shards?
MongoDB Sharding is based on the range. Therefore, all objects in a collection are stored in a chunk. The option to obtain data from multiple shards is available Only when there is an extra block (Only when there is more than 1 chunk is there an option for multiple shards to get data .). Currently, the size of each default block is 64 Mb, so you need at least 64 Mb space to implement a migration.
23. what happens when I try to update a document on a chunk being migrated?
The update operation will immediately occur on the old shard, and the change will be copied to the new shard before the ownership transfer (ownership transfers.
24. what if I initiate a query when a shard is stopped or slow?
If a shard (shard) is stopped, an error is returned when the "Partial" option is set for the query. If the response of a shard (shard) is slow, MongoDB will wait for its response.
25. can I delete the old files in the moveChunk directory?
No problem. these files are temporary files generated during the sharding (shard) balancing operation. Once these operations have been completed, the relevant temporary files should also be deleted. Currently, manual cleanup is required, so please be careful when releasing the space of these files.
26. how can I view the Mongo link in use?
Db. _ adminCommand ("connPoolStats ");
27. if the block movement operation (moveChunk) fails, do I need to manually clear some transfer documents?
No. the mobile operation is consistent and deterministic. after one failure, the mobile operation will continue to retry. after completion, data only appears in the new shard (shard ).
28. if I am using replication technology (replication), can I use journaling in part while not in other parts?
Yes.
The above is the interview Q & A _ MySQL content for 28 MongoDB NoSQL databases. For more information, see PHP Chinese network (www.php1.cn )!