Reputation: 25
I’m building two applications that need to share some similar data but each will also have unique data. Should I build a separate database for each app or let each app access the same database.
I need the shared data to update automatically on one app if it is changed in another. I’m also using postgresql with react and express with the intent of having both apps be progressive web apps and eventually react native apps.
Upvotes: 0
Views: 1294
Reputation: 1269693
In general, I would think of this as:
Based on your question:
I need the shared data to update automatically on one app if it is changed in another.
It sounds like you want one database and separate schemas for each application.
Upvotes: 1
Reputation: 7387
Both has pros and cons. But i think keeping them separate will be better. Pro for one can be con for other.
Pros -
Cons -
Upvotes: 0
Reputation:
It sounds as if you will need to join the database from both applications in a single SQL query. In that case, use one database and multiple schemas to separate the data.
You could have one schema common
that contains the data which is shared between all applications and then one schema per application.
Upvotes: 1