Created
July 14, 2020 04:57
-
-
Save Abhinay-g/8751f4878bd28b1fe2faf0e78e45d022 to your computer and use it in GitHub Desktop.
Microservices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
====================================================================== | |
source: https://dzone.com/articles/6-data-management-patterns-for-microservices-1 | |
Data Management Patterns for Microservices in Microservice Architecture | |
Database Per Service: | |
In this pattern, each microservice manages its own data. What this implies is that no other microservice | |
can access that data directly. Communication or exchange of data can only happen using a set of well-defined APIs. | |
Saga Pattern: | |
The Saga pattern is the solution to implementing business transactions spanning multiple microservices. | |
A Saga is basically a sequence of local transactions. For every transaction performed within a Saga, | |
the service performing the transaction publishes an event. The subsequent transaction is triggered based on | |
the output of the previous transaction. And if one of the transactions in this chain fails, | |
the Saga executes a series of compensating transactions to undo the impact of all the previous transactions. | |
API Composition | |
In this pattern, an API Composer invokes other microservices in the required order. | |
And after fetching the results it performs an in-memory join of the data before providing it to the consumer. | |
=============================================================================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment