Q: What is the best architecture for life copies for testing and development?
Current setting:
We have two mazod amazon / EC2 servers, for example:
Machine A: A production database (on an amazon/EC2 server) (name it 'PROD') Other databases ('OTHER') Machine B: a pre-production database (name it 'PRE') a copy for developer 1 own tests (call it 'DEVEL-1') a copy for developer 2 (DEVEL-2) …DEVEL-n
The PRE database is intended for integration tests before deployment to production.
DEVEL-n is for every developer who destroys their own data without annoying other developers.
From time to time we want to "restore" fresh data from PROD to the PRE and DEVEL-n databases.
We are currently moving from PROD to PRE using the .copyDatabase () command. Then we issue .copyDatabase () "n" times to make copies from PRE to DEVEL-n.
Problem:
The copy takes soooo long (1 hour per copy, DBsize is more than 10 GB), and it usually also saturates mongod, so we need to restart the service.
We found about:
- Dump / recovery system (saturated as .copyDatabase ())
- Replica sets
- Master / Slave (seems outdated)
The replica kits seem to be winners, but we have serious doubts:
Suppose we want a set of replicas to synchronize live A / PROD in B / PRE (and have the possibility that A is primary and B is more likely secondary):
a) Can I select “several” databases from A for PROD replication, but leave OTHER alone?
b) Can I have “additional” databases in B (for example, DEVEL-n) that are not in the main?
c) Can I “stop replicating” so that we can deploy to PRE, test soft with fresh data, upload the data using testing, and after the tests have been completed, “relink” the replica, so the changes in the PRE are deleted and the changes in PROD are transferred to PRE adequately?
d) Is there a better way than a replica set suitable for this case?
Thanks. Marina and Xavi.