InterviewSolution
| 1. |
How does MongoDB text search work on all string fields of a document? Should Compound Text Index be created on all the string fields to achieve this? |
|
Answer» When deploying MongoDB in production, we should have a strategy for capturing and restoring backups in the case of data loss events. Below are the different backup options:
MongoDB Atlas, the official MongoDB cloud service, provides 2 fully-managed methods for backups:
MongoDB Cloud Manager and Ops Manager provide back up, monitoring, and AUTOMATION service for MongoDB. They support backing up and restoring MongoDB replica sets and sharded clusters from a graphical user interface. Back Up by Copying Underlying Data Files
MongoDB can also be backed up with OPERATING system features which are not specific to MongoDB. Point-in-time filesystem snapshots can be used for backup If the volume where MongoDB stores its data files supports snapshots.
MongoDB deployments can also be backed up using system commands cp or rsync in case storage system does not support snapshots. It is recommended to stop all WRITES to mongo before copying database files as copying multiple is not an atomic operation.
mongodump is the utility using which we can take a backup of the MongoDB database in BSON files format. The backup files can then be used by a mongorestore utility for restoring to another database. Mongodump reads data page by page hence taking a lot of time and so is not recommended for large sized deployments. |
|