Why is creating a replica set with Docker Compose so complicated?
I am new to MongoDB and have come from PostgreSQL, etc. Usually, deploying an SQL database is straightforward, but with MongoDB, I have never encountered such difficulties.
I started by setting up a standard MongoDB instance, but I couldn’t execute queries because it only works with MongoDB in replSet
mode, which is the best practice for production.
So, I tried to set it up and realized how messy it is. I understand that you need to create a script that runs to set up the replica set in addition to executing a command at launch.
Moreover, there are new errors—the authentication method changes and forces me to use authentication keys, but I can’t set them up either because the file permissions are too broad.
After all my struggles, I realized just one thing: the severe lack of functional and standardized documentation on how to properly set up a replica set with Docker Compose.
Is there documentation I missed, or am I not the only one to find this so hard to set up?