Dear Matt,
first of all, thank you for your reply.
Yes, I'm trying to follow the microservices pattern. At the moment, services talk to each other via HTTP APIs or messaging. As you mentioned, API gateway should be used only for external access.
I followed the principle that only one service is the owner of the entity (lets say entity Company). When company is updated (via UI), event is published to RabbitMQ. Every other service listens to changes and updates it own database (it syncs data). Entity supports multiple versions so there are no problems with upgrading services and backward comparability.
Message is in format
{
"timestamp": 1442340700000,
"entity": "company", // <- entity name is unique for all microservices
"version": 1, // <- to support backward compatibility
"action": "create", // <- create/update/delete. I should probably also support events like company_bankrupted, company_sold etc..
"fields":
{
"id": "91dd87da-bb52-496a-b371-4dda8515168a", // <- UUID for primary keys
"name": "My company"
}
}
Have you used any similar solutions? Some suggest different servicebuses to solve syncing (communication) between services. What do you think? I checked around for some opensource projects, but I wasn't able to find anything useful. So I'm not really sure if this is the right way.
Would love to hear your feedback.