MongoDB restore scenarios

Hi Everyone!

I have a couple of questions regarding the restore scenarios of MongoDB and hope that someone from the Community can share his experience.

Since I’m just starting to work with Mongo and planning my environment, I want to deploy a production site and a DR one to which I’ll be performing test restores or where I restore everything in case of a disaster with my production site. The questions are:

  1. Do I have to deploy the shared cluster/replica set on my DR site with an identical topology? (f.e. similar number of shards, replicas, etc). Or I can have a different topology (a lower number of shards)?
  2. How often do you restore individual collections, databases, or documents? Or do you restore the entire replica set/shareded cluster?

Many thanks in advance!

Best regards,
Petr

First off, good on you for thinking about this ahead of time, and also thinking about how you’d proactively test your restore plans. That is a really great practice!

There are a number of ways to handle this but one of the easier ways might be to use a member of the replica set themselves.

For example, take one of the members offline (from the set) and then test your restore plan, or do any others testing you want, etc. Then you are both testing from the exact same setup and on real data. You don’t necessarily need to have a separate environment for doing this … and you can recycle that member back into the set when you are done.

The frequency is driven more by your particular needs, and as to “what” exactly you restore, well that will have a lot to with how your data is setup.

Generally I’d say restoring by database might be the easiest, but it really depends a lot on how exactly you plan to backup. Do you know?

2 Likes

Hi Justin!

Many thanks for your reply!

  1. Interesting idea about taking a member offline. I’ll consider this scenario for sure.

Nevertheless, I’m curious to know all pitfalls with the restore of the entire deployment. Let’s say I have a shared cluster on prod, each shard has 5 nodes. I also have Test/Dev site with a reduced capacity, I simply cannot deploy so many nodes/members there. Do I understand correctly that if restore my prod cluster to Test/Dev, I need to have 5 shards on the target site, but for example, each shard can consist of 3 members, not of 5?

And the same about replica set: 5 members on prod. How many do I need to have on the target site before doing restore? I guess there is no strict requirement, 3 would be enough.

  1. I understand that the frequency is driven by my needs, just wondering what use cases exist and how other users do it. If you could share your experience, it would be awesome.

  2. Not sure about backup so far. First of all, I want to understand how will I restore. After that, I’ll decide on the best backup strategy that covers my needs.

Best regards,
Petr