I store some data in many databases/collections on a standalone MongoDB server. This server is used for production.
I need to access those data (or at least nightly build data, and not all databases/collections), for data analysis purpose : readonly, possibly high consumption queries. I don't want to operate data analysis on the production server.
For now, I use
mongoimport to export and re-import the data into another standalone server. This has many drawbacks :
- indexes are not kept,
- night export/re-import is a long-time process that may fail,
- data is not continuously synced (not absolutely necessary).
I studied the MongoDb replica set documentation, but some questions are still unanswered to me :
- Can I choose which databases/collections are replicated ?
- Is a 2-members (a primary and a secondary) replica set eligible ?
- Can I make our production application servers "always" read-write on the primary, and our data-analysis server "always" read on the secondary ?
I know I have many questions and it might break Stackoverflow Q/A principles, but I hope the question label could be useful for many others.