node.js - Two nodejs applications, one mongodb database -


Good day! I have created an application using NodesJS + Mongos and now I want to make something like a superuser application. I need my admin panel application to connect to the same database, so, I have a question.

Should I have to store the same schema file in both the applications to have the ability to use my schema methods? In other words, what is the best way to create another API using the same DB?

If you are using the same DB from two different applications, You want to make sure that those schemas are the same between the two if someone changes their input, then another may have to change its display (or they can not expect all information). Keep this in mind during your release process.

I suggest schema to be made of both an external library, or the current app needs an admin panel. You will avoid having two sets out of sync and know to see a place for schema definitions.


Comments