Data Consistency In Microservices Architecture

Data Consistency In Microservices Architecture

Data consistency in Microservices architecture. Microservices architecture has great features such as high consistency, availability, scalability, automation, autonomous teams etc. Consistency: all data in the database is consistent at the end of transaction. Consistent to the integrity references, to business logic references.

In this article, I’d like to share my knowledge and experience in Garanti BBVA, about moving from monolithic to microservices architectures, especially regarding data consistency.

Data consistency is hardest part of the microservices architecture. Because in a traditional monolith  application, a shared relational database handles data consistency. In a microservices architecture, each microservice has its own data store if you are using database per service pattern. So databases are *distributed *among the applications. Each application may use different technologies to manage their data like non-sql databases. Although this kind of distributed architecture has many benefits such as scalability, high availability, agility etc., in terms of data management, there are some critical points regarding data such as transaction management and data consistency/integrity.

Data Consistency In Microservices Architecture Figure 1. Sample Overall Transition Diagram

In the distributed architecture, data is highly available and scalable because each microservice has its own runtime and data store.

The Problem: Data Consistency in Distributed Systems

For monolith applications, a shared relational database handles and guarantee data consistency by ACIDtransactions. The acronym ACID means:

  • Atomicity: all the steps of a transaction is succeeded or failed together, no partial state, all or nothing.
  • Consistency: all data in the database is consistent at the end of transaction.
  • Isolation: only one transaction can touch the data in the same time, other transactions wait until completion of the working transaction.
  • Durability: data is persisted in the database at the end of the transaction.

In order to maintain strong data consistency, relational database management systems support ACID properties.

data consistency distributed architecture microservices

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Your Data Architecture: Simple Best Practices for Your Data Strategy

Your Data Architecture: Simple Best Practices for Your Data Strategy. Don't miss this helpful article.

Getting Started With Data Lakes

In this post, we'll learn Getting Started With Data Lakes.<br><br> This Refcard dives into how a data lake helps tackle these challenges at both ends — from its enhanced architecture that's designed for efficient data ingestion, storage, and management to its advanced analytics functionality and performance flexibility. You'll also explore key benefits and common use cases.

Serverless Vs Microservices Architecture - A Deep Dive

Companies need to be thinking long-term before even starting a software development project. These needs are solved at the level of architecture: business owners want to assure agility, scalability, and performance.

Data Lakes Are Not Just For Big Data - DZone Big Data

A data expert discusses the three different types of data lakes and how data lakes can be used with data sets not considered 'big data.'

The Service Mesh in the Microservices World - DZone Microservices

In this article, take a look at the service mesh in the microservices world. The software industry has come a long journey and throughout this journey, Software Architecture has evolved a lot. Starting with 1-tier (Single-node), 2-tier (Client/ Server), 3-tier, and Distributed are some of the Software Architectural patterns we saw in this journey.