I'm preparing a git repository for me and my friend's fun project learning to make an images/videos sharing website. We're learning the MEAN stack along the way. Now only I have set up MongoDB /data/db and have been playing around with it.
The question is that, should I/can I make a data/db folder in the git repo so my friend can pull everything and see the images displaying on his browser? Or should I be the only one working on the database?
Also, any tips or advice on deploying are welcome. Thank you.
Theoretically, it could work. You can put your MongoDB database files under version control. When you commit the database files while MongoDB isn't running and your colleague pulls them while his MongoDB instance isn't running either, it should be possible to exchange the database content this way. At least as long as you are both using the same version of MongoDB.
However, it might not be a good idea to do this, because Git isn't built for large binary files which change often. Your repository might not perform as well as you would expect it from Git.
As an alternative solution, you could set up one MongoDB instance which you both access in parallel via network.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With