We are trying to develop a microservices based application. The idea is to come up with a good pattern and would ideally like to develop it so that each service is loosely coupled with its own database. But how would we handle data that is common across multiple services.
Let's consider an example of country and state information required across multiple services.
We came up with a few options here:
- Replicate the tables in each service, with a country management service separately for managing country data, and each other service subscribing for any updates (but here the data is replicated across multiple services)
- A Common database for country data (but that could potentially become a single point of failure)
- Single country management service and other services accessing the country data through this
Which one would be the ideal choice to implement this? Or is there a better way of handling this scenario.