[Microservices Architecture] What is SAGA Pattern and How important is it?

Thanh Le
The Startup
Published in
10 min readMar 30, 2020

--

Photo by Yiran Ding on Unsplash

NOTE: This article is for people that have basic understanding about Microservices Architecture (MSA) and want to deep dive into it. If you are newbie in MSA world, I would like to recommend 2 websites — where you can find everything related to MSA from beginner to advanced level:

https://martinfowler.com/microservices/

https://microservices.io

Microservices Architecture becomes very popular in recent years. Besides the benefits and advantages of using MSA, it also brings a lot of problems/troubles to our application and Data Management is one of those. Data is the heart of every application. The success or failure of any business relies on efficient data management. In other words, if we lose data — we will lose everything.

There are 6 Data Management patterns that can help you manage your data effectively. Most of them support each other, only “Database Per Service” and “Shared Database” not.

  • Database Per Service: With this pattern, each microservice should own its data. Communication and exchange data can only happen by using a set of well-defined APIs. Defining boundary context for each microservices is very important if you don’t want your application becomes spaghetti.

--

--

Thanh Le
The Startup

A Software Technical Architect — Who code for food and write for fun :)