samedi 20 avril 2019

Is this "legal" microservices design?

Setup:

  • Within the whole system, there is a concept of a list of items for each customer and this needs to a concept understood by multiple services A, B, C.
  • Those same multiple services perform distinct type of work that operates on that list of items.
  • It's ok if B or C is operating on a version of the list of items that is not up-to-date, so long as they eventually get the latest version.

My design:

  • One service A is the source of truth for the current state of the list of items. The list is manipulated in this service.
  • When the list changes, A publishes the list and B and C, subscribers to this event, store copies of it in their own storage.
  • When B and C do their work, they use their local copy of the list.
  • B and C also have additional state specific to their domain.

My rationale:

Since B and C don't ask A for the list when they do their work, they are not dependent on A. If for some reason A goes down, the impact to the system is only that B and C don't have up-to-date information, which is acceptable, and which will be mitigated when A is fixed.

Is there anything wrong with this?

Aucun commentaire:

Enregistrer un commentaire