MongoDB

  Home  Databases Programming  MongoDB


“MongoDB frequently Asked Questions by expert members with experience in MongoDB. These questions and answers will help you strengthen your technical skills, prepare for the new job test and quickly revise the concepts”



39 MongoDB Questions And Answers

21⟩ Explain do I have to call getLastError to make a write durable?

No. If you don't call getLastError (aka "Safe Mode") the server does exactly the same behavior as if you had. The getLastError call simply lets one get confirmation that the write operation was successfully committed. Of course, often you will want that confirmation, but the safety of the write and its durability is independent.

 141 views

22⟩ What is a secondary or slave?

A secondary is a node/member which applies operations from the current primary. This is done by tailing the replication oplog (local.oplog.rs).

Replication from primary to secondary is asynchronous, however the secondary will try to stay as close to current as possible (often this is just a few milliseconds on a LAN).

 129 views

23⟩ What is a master or primary?

This is a node/member which is currently the primary and processes all writes for the replica set. In a replica set, on a failover event, a different member can become primary.

 135 views

24⟩ Explain how long does replica set failover take?

It may take 10-30 seconds for the primary to be declared down by the other members and a new primary elected. During this window of time, the cluster is down for "primary" operations – that is, writes and strong consistent reads. However, you may execute eventually consistent queries to secondaries at any time (in slaveOk mode), including during this window.

 126 views

25⟩ How to do transactions/locking?

MongoDB does not use traditional locking or complex transactions with rollback, as it is designed to be lightweight and fast and predictable in its performance. It can be thought of as analogous to the MySQL MyISAM autocommit model. By keeping transaction support extremely simple, performance is enhanced, especially in a system that may run across many servers.

 126 views

27⟩ Does an update fsync to disk immediately?

No, writes to disk are lazy by default. A write may hit disk a couple of seconds later. For example, if the database receives a thousand increments to an object within one second, it will only be flushed to disk once. (Note fsync options are available though both at the command line and via getLastError_old.)

 134 views

30⟩ What is a "namespace"?

MongoDB stores BSON objects in collections. The concatenation of the database name and the collection name (with a period in between) is called a namespace.

 140 views

32⟩ What is role of Profiler in MongoDB?

MongoDB includes a database profiler which shows performance characteristics of each operation against the database. Using the profiler you can find queries (and write operations) which are slower than they should be; use this information, for example, to determine when an index is needed.

 122 views

33⟩ MongoDB interview questions for General interview

► Do you have any questions for MongoDB management?

► What type of management style do you thrive under?

► Could you describe a difficult problem and how you dealt with it?

► Give me an example of a high-pressure situation.

► Why do you believe you are qualified for this job?

► How do you think I rate as an interviewer?

► How did you assemble the information?

 132 views

35⟩ What is the role of analyzer in MongoDB?

MongoDB includes a display the operating property database each database analyzer. Through this analyzer you can find the slower than expected query (or write); using this information, for example, to determine whether there is a need to add index.

 138 views

36⟩ Explain what is the basic difference between 3 MySQL and MongoDB?

Both MySQL and MongoDB are free open source database. MySQL and MongoDB have many fundamental differences including data representation (data representation), query, relationship, business, design and definition of schema, the standard (normalization), speed and performance. Through the comparison of MySQL and MongoDB, we are in fact more relational and non relational database.

 126 views

37⟩ How do you compareMongoDB, CouchDB and CouchBase?

  MongoDB and CouchDB are document oriented database. MongoDB and CouchDB are the most typical representative of the open source NoSQL database. They have nothing in common other than are stored in the document outside. MongoDB and CouchDB, the data model interface, object storage and replication methods have many different.

 120 views

38⟩ What types of 2 NoSQL database?

For example: MongoDB, Cassandra, CouchDB, Hypertable, Redis, Riak, Neo4j, HBASE, Couchbase, MemcacheDB, RevenDB and Voldemort are the examples of NoSQL databases.

 112 views