I am planning to build a project using micro-services architecture. I was curious to know which design would be better in terms of database?
- Keep a separate database for each service like in the given image
- Multiple applications point to 1 database.
If I keep separate database for each service, how do we decide where to keep the mapping tables?
For example, we have Customers service (separate project talking to DB 1) and Products service (separate project talking to DB 2), where should I store customer and product mapping (products bought by a customer)?
How about reporting in the longer run where I would need joins over a number of tables (that are in different databases due to Architecture mentioned in point 1)?