I am new to MongoDB - help with below questions

1)Can I dockerize Mongo DB using Docker? If yes, please provide steps of instructions
tool names within mongo -??

2)Say if the MongoDB server goes down , while user submitting the data from the website. How to achieve a way to avoid data leaks and recover the submitted data?
tool names within mongo -??

3)What are the best practices for backing up and restoring of Mongo DB?
tool names within mongo -??

Hello @Slow-Steady_English, welcome to the MongoDB Community forum!

Most of the information you are looking for is in the MongoDB Manual (a.k.a. documentation).

  1. Can I dockerize Mongo DB using Docker? If yes, please provide steps of instructions
    tool names within mongo -??

See Install with Docker


  1. Say if the MongoDB server goes down , while user submitting the data from the website. How to achieve a way to avoid data leaks and recover the submitted data?
    tool names within mongo -??

The user submits data and the data is written to the database, and if the server has crashed the data is not written to the database - in general. You may want to be clear about what is your application scenario in detail to discuss this.

To enable application access the database data all the time data can be replicated - using replica-sets. MongoDB replica-set allows data is stored on more than one server. A replica-set has a primary and secondary nodes. All the application data writes happen on the primary only. As the data is written to it, the same data is replicated to the secondary nodes. This way, if any node goes down, the application can keep running. In case a primary crashes, another node becomes a primary and accepts writes from the application.

See Replication


  1. What are the best practices for backing up and restoring of Mongo DB?
    tool names within mongo -??

See:

And it is recommended that:

Schedule periodic tests of your back up and restore process to have time estimates on hand, and to verify its functionality.

1 Like