InterviewSolution
| 1. |
How can we capture slow running queries in MongoDB? |
|
Answer» Starting in version 4.0, multi-document transactions are possible in MongoDB. EARLIER to this version, atomic operations were possible only on a single document. With embedded documents and arrays, data in the documents are generally denormalized and stored in a single structure. With this as the recommended data model, MongoDB's single document atomicity is sufficient for most of the applications. Multi-document transactions now enable the remaining small percentage of applications which require this (DUE to related data spread across documents) to depend on the DATABASE to handle transactions automatically rather than implement this programmatically into their application (which can cause performance overheads). NOTE: Performance cost is more for multi-document transactions (in most of the cases), hence it should be judiciously used. |
|