OrientDB Interview Questions & Answers

  1. Question 1. What Is The Basic Difference Between Mysql And Mongodb?

    Answer :

    MySQL and MongoDB are both free and open source databases.

    MySQL and MongoDB have a lot of basic differences in terms of data representation, querying, relationships, transactions, schema design and definition, normalization, speed and performance.

    By comparing MySQL with MongoDB, we are comparing Relational and non-relational databases.

  2. Question 2. How Do You Compare Mongodb With Couchdb And Couchbase?

    Answer :

    • MongoDB and CouchDB are both document-oriented databases. MongoDB and CouchDB are the best examples of open source NoSQL database.
    • Aside from both storing documents though, it turns out that they don’t share much in common.
    • There are a lot of difference between MongoDB and CouchDB in terms of implementation of their data-model, interface, object storage, replication methods etc.
  3. RDBMS Interview Questions

  4. Question 3. What Makes Mongodb Best?

    Answer :

    Following features of MongoDB make it best NoSQL database:

    1. Document-oriented
    2. High performance
    3. High availability
    4. Eazy scalability
    5. Rich query language
  5. Question 4. What Is 32 Bit Nuances?

    Answer :

    There is extra memory mapped file activity with journaling. This will further constrain the limited db size of 32 bit builds. Thus, for now journaling by default is disabled on 32 bit systems.

  6. Core Java Tutorial

  7. Question 5. Will The Journal Replay Have Problems If Entries Are Incomplete (like The Failure Happened In The Middle Of One)?

    Answer :

    Each journal (group) write is consistent and won’t be replayed during recovery unless it is complete.

  8. Core Java Interview Questions

  9. Question 6. What Is Role Of Profiler In Mongodb?

    Answer :

    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.

  10. Question 7. If You Remove An Object Attribute Is It Deleted From The Store?

    Answer :

    Yes, you remove the attribute and then re-save() the object.

  11. SQL Database Tutorial
    SQL Database Interview Questions

  12. Question 8. Can I Use The Journaling Feature To Perform Safe Hot Backups?

    Answer :


  13. Question 9. Are Null Values Allowed?

    Answer :

    For members of an object, yes. You cannot add null to a database collection though as null is not an object. You can add {}, though.

  14. Database Interview Questions

  15. Question 10. Does An Update Fsync To Disk Immediately?

    Answer :

    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 rsync options are available though both at the command line and via getLastError old.)

  16. Hibernate Tutorial

  17. Question 11. How Do I Do Transactions/locking?

    Answer :

    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.

  18. Hibernate Interview Questions

  19. Question 12. Why Are My Data Files So Large?

    Answer :

    MongoDB does aggressive preallocation of reserved space to avoid file system fragmentation.

  20. RDBMS Interview Questions

  21. Question 13. How Long Does Replica Set Failover Take?

    Answer :

    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.

  22. Javascript Advanced Tutorial

  23. Question 14. What’s A Master Or Primary?

    Answer :

    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.

  24. Question 15. What’s A Secondary Or Slave?

    Answer :

    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).

  25. Database Design Interview Questions

  26. Question 16. Should I Start Out With Sharded Or With A Non-sharded Mongodb Environment?

    Answer :

    We suggest starting unsharded for simplicity and quick startup unless your initial data set will not fit on single servers.

    Upgrading to sharding from unsharded is easy and seamless, so there is not a lot of advantage to setting up sharding before your data set is large.

  27. Software Development Lifecycle (SDLC) Tutorial

  28. Question 17. How Does Sharding Work With Replication?

    Answer :

    Each shard is a logical collection of partitioned data. The shard could consist of a single server or a cluster of replicas. We recommend using a replica set for each shard.

  29. Database Administration Interview Questions

  30. Question 18. What Happens If I Try To Update A Document On A Chunk That Is Being Migrated?

    Answer :

    The update will go through immediately on the old shard, and then the change will be replicated to the new shard before ownership transfers.

  31. Core Java Interview Questions

  32. Question 19. What If A Shard Is Down Or Slow And I Do A Query?

    Answer :

    If a shard is down, the query will return an error unless the “Partial” query options is set. If a shard is responding slowly, mongos will wait for it.

  33. MongoDB Tutorial