We recently started splitting a big monolith into microservices. One of the challenges we come across is that how and where to resolve the foreign key.
To give you a better perspective. We are planning to build the following microservices. Each of these services has their own dedicated database in order to make services independent.
PriceQuote Service, primarily responsible for managing prices based on variant and city
PriceQuote
-----------------------
id(Pk)
veriant_id(Fk)
city_id(Fk)
price
CarData Service, There are three concerns clubbed in this microservice. Makes, Models, Variants
Variants
-----------------------
id(Pk)
model_id(fk)
name
Location Service, States, cities, and areas clubbed in single microservice
Cities
-----------------------
id(Pk)
state_id(fk)
name
Please help me with the following concerns
Is this the right way of designing microservices?
Where to resolve variant_id and city_id Fks while retrieving price
quote? inside or outside microservice?. if outside microservice? where?