-
Book Overview & Buying
-
Table Of Contents
Microservices Design Patterns in .NET - Second Edition
By :
As discussed previously, your microservices application is best implemented using the Database-Per-Service pattern. The major drawback to this pattern choice is that we cannot guarantee that our databases will always remain in sync if one of the operations fails.
We need a mechanism that spans multiple services and can implement transactions across the various data stores, such as a two-phase commit, which requires all data stores to commit or roll back transactions simultaneously. This would be perfect, except that some NoSQL databases and message brokers are incompatible with this model.
Imagine a new patient being registered with our healthcare center. This process will require the patient to provide their information and some essential documents and book an initial appointment, which requires payment. These actions require four different microservices to get involved; thus, four different data stores will be affected.
We can refer to an operation...