SlideShare a Scribd company logo
"Database isolation: how we deal with hundreds of direct connections to the database", Mykhailo Kratiuk .pdf
About me
Worked with dinosaurs, but fell 

in love with Ukrainian fintech
Worked with dinosaurs, but fell 

in love with Ukrainian fintech
Worked with dinosaurs, but fell 

in love with Ukrainian fintech
4+ years of developing cloud 

and self-hosted products
4+ years of developing cloud 

and self-hosted products
4+ years of developing cloud 

and self-hosted products
Platform Engineer in past
Platform Engineer in past
Platform Engineer in past
Backend Software Engineer

at Core Team, Solidgate
Backend Software Engineer

at Core Team, Solidgate
Backend Software Engineer

at Core Team, Solidgate
About Solidgate
7+ years online
7+ years online
7+ years online
80 engineers
80 engineers
80 engineers
4.5× growth in team
size since 2020
4.5× growth in team
size since 2020
4.5× growth in team
size since 2020
Сard acquiring and local payment
methods across the globe
Сard acquiring and local payment
methods across the globe
Сard acquiring and local payment
methods across the globe
60 SW engineers, 20 Infra + 

Data engineers + AQA
60 SW engineers, 20 Infra + 

Data engineers + AQA
60 SW engineers, 20 Infra + 

Data engineers + AQA
"Database isolation: how we deal with hundreds of direct connections to the database", Mykhailo Kratiuk .pdf
Engineering as it was
3
engineering 

teams
3
engineering 

teams
3
engineering 

teams
5-12
engineers 

perteam
5-12
engineers 

perteam
5-12
engineers 

perteam
2
services each 

team owned
2
services each 

team owned
2
services each 

team owned
5+
databases
5+
databases
5+
databases
System as it was
Merchant
Back-office
Finance

System
Card

Gate
Alt

Gate Database
Database
Database
Direct 

connections– 

blessing
Simplicity and speed 

of implementation
Simplicity and speed 

of implementation
Simplicity and speed 

of implementation
Lower overhead – fewer network 

calls and intermediate layers
Lower overhead – fewer network 

calls and intermediate layers
Lower overhead – fewer network 

calls and intermediate layers
Query flexibility without 

contract limitations
Query flexibility without 

contract limitations
Query flexibility without 

contract limitations
Independence from 

other services
Independence from 

other services
Independence from 

other services
Benefits of shared databases
Say my name
E-commerce
E-commerce
My name is Command Query Responsibility Segregation Pattern
but friends call me CQRS
My name is Command Query Responsibility Segregation Pattern
Engineeringasitisnow
11
engineering 

teams
11
engineering 

teams
11
engineering 

teams
3-8
engineers 

perteam
3-8
engineers 

perteam
3-8
engineers 

perteam
7
services 

perteam
7
services 

perteam
7
services 

perteam
50+
databases
50+
databases
50+
databases
Deploying

on Friday, 

huh?
Once upon a time
read/write
Once upon a time
read/write
read
Direct 

connections– 

curse
Inconsistency of data 

structures across services
Inconsistency of data 

structures across services
Inconsistency of data 

structures across services
Changes by one service can
unexpectedly break others
Changes by one service can
unexpectedly break others
Changes by one service can
unexpectedly break others
Difficulty in coordinating and rolling
back schema modifications
Difficulty in coordinating and rolling
back schema modifications
Difficulty in coordinating and rolling
back schema modifications
Increased risk of data corruption or
loss during schema changes
Increased risk of data corruption or
loss during schema changes
Increased risk of data corruption or
loss during schema changes
Database schema changes
Custom validation and data formatting logic for each service
Custom validation and data formatting logic for each service
Custom validation and data formatting logic for each service
One service may update a field in a way 

that makes it unreadable by another service
One service may update a field in a way 

that makes it unreadable by another service
One service may update a field in a way 

that makes it unreadable by another service
Data that once passed validation in the first service can no longer 

be considered valid if another service modifies them directly
Data that once passed validation in the first service can no longer 

be considered valid if another service modifies them directly
Data that once passed validation in the first service can no longer 

be considered valid if another service modifies them directly
Validation and data transformation
Problems caused by the lack of database isolation
Transaction and
consistency issues;
Transaction and
consistency issues;
Transaction and
consistency issues;
Violation of
microservice
independence
Violation of
microservice
independence
Violation of
microservice
independence
Risk of implicit
“agreements” at 

the database level
Risk of implicit
“agreements” at 

the database level
Risk of implicit
“agreements” at 

the database level
Data security
concerns
Data security
concerns
Data security
concerns
Scalability
challenges
Scalability
challenges
Scalability
challenges
Howto 

make it right?
ANALYSIS
Decompose by business context
Breakdown by entities
Owner service DB Entity Client services Estimated cost Notes Jira issue
merchant
configuration
cardgate
config
shop
HUB (old)
cardgate
finance system
ETA ???
~3 weeks
~1 week
Remove old HUB will do the job
A lot of usages via ORM relations

• use event stream to get shops

• store shops in operations DB (as replicated data)
Migrate from shops to channels

Note: depends on channels isolation

Note2: PHP code can remain unchanged due to further
decommissioning.k
merchant
configuration
cardgate
config
currency
cardgate
finance system
reconciliation-
kotlin
currency-
convertor (go)
~0.5 week
~0.5 week
ETA ???
~0.5 week
Use merchant configuration API.
Use merchant configuration API.
We already have data replicated to Redshift, but its sync period
is 1 hour which doesn’t cover some merchants' requirements.

We have 2 solutions here:

Force merchants to use these reports even with 1-hour delay and
propose webhooks as a way of getting fresh updates.

Tune the data pipelines to minimize delay to minutes (NordStream).
Use merchant configuration API.
cardgate
cardgate
operations
PSP
transaction
search ~2 weeks
Estimation includes moving to event streaming and API calls
instead of direct DB queries.


It doesn’t include the replicating data in the search’s own DB.
Patterns forDB decomposition
Change Data Ownership
Change Data Ownership
Change Data Ownership
Database 

Wrapping Service
Database 

Wrapping Service
Database 

Wrapping Service
Monolith as data 

access layer
Monolith as data 

access layer
Monolith as data 

access layer
Database View
Database View
Database View
Synchronize Data 

in Application
Synchronize Data 

in Application
Synchronize Data 

in Application
DatabaseView
DatabaseWrapping Service
DatabaseWrapping Service
DatabaseWrapping Service
Impl. API
Development 

on the Service-
owner side: API /
Event-streaming
with all the
necessary data.
Impl. API
Development 

on the Service-
owner side: API /
Event-streaming
with all the
necessary data.
1
Impl. API
Development 

on the Service-
owner side: API /
Event-streaming
with all the
necessary data.
Acquire
The client service
implements 

a component that
uses the API
provided by the
service owner, while
continuing to make
direct database
queries in parallel.
Acquire
The client service
implements 

a component that
uses the API
provided by the
service owner, while
continuing to make
direct database
queries in parallel.
2
Acquire
The client service
implements 

a component that
uses the API
provided by the
service owner, while
continuing to make
direct database
queries in parallel.
Dark read
The client service
team tests
functionality,
absence of bugs,
and changes in
performance. They
simultaneously
compare results
obtained via the API
and direct database
queries.
Dark read
The client service
team tests
functionality,
absence of bugs,
and changes in
performance. They
simultaneously
compare results
obtained via the API
and direct database
queries.
3
Dark read
The client service
team tests
functionality,
absence of bugs,
and changes in
performance. They
simultaneously
compare results
obtained via the API
and direct database
queries.
Switch
Development 

of a switching
mechanism: 

all traffic at once, or
percentage-based,
or by specific
clients.
Switch
Development 

of a switching
mechanism: 

all traffic at once, or
percentage-based,
or by specific
clients.
4
Switch
Development 

of a switching
mechanism: 

all traffic at once, or
percentage-based,
or by specific
clients.
Clean-up
The client 

service completely
removes all direct
queries to the
external database.
Clean-up
The client 

service completely
removes all direct
queries to the
external database.
5
Clean-up
The client 

service completely
removes all direct
queries to the
external database.
Client service switchworkflow
Synchronize Data in Application
Copy original DB
Copy original DB
Copy original DB
Write to both, read from original
Write to both, read from original
Write to both, read from original
Write to both, read from new
Write to both, read from new
Write to both, read from new
Clean up
Clean up
Clean up
Synchronize Data in Application
Copy original DB
Copy original DB
Copy original DB
Write to both, read from original
Write to both, read from original
Write to both, read from original
Write to both, read from new
Write to both, read from new
Write to both, read from new
Clean up
Clean up
Clean up
Synchronize Data in Application
Copy original DB
Copy original DB
Copy original DB
Write to both, read from original
Write to both, read from original
Write to both, read from original
Write to both, read from new
Write to both, read from new
Write to both, read from new
Clean up
Clean up
Clean up
Synchronize Data in Application
Copy original DB
Copy original DB
Copy original DB
Write to both, read from original
Write to both, read from original
Write to both, read from original
Write to both, read from new
Write to both, read from new
Write to both, read from new
Clean up
Clean up
Clean up
Synchronize Data in Application
Use

new API
Keep

querying

DB
Client service dev team during the transition
Chargebacks Isolation
Consistency Req.: High
RPS: 0.03
Latency: 2s
Consistency Req.: High
RPS: 0.03
Latency: 2s
01
Occasional

READ
Consistency Req.: High
RPS: 0.03
Latency: 2s
Consistency Req.: Eventual
RPS: 5.6
Latency: 60ms
Consistency Req.: Eventual
RPS: 5.6
Latency: 60ms
02
Intensive

READ
Consistency Req.: Eventual
RPS: 5.6
Latency: 60ms
PACELC design principle
… in case of network partitioning (P) in
a distributed computer system, one
has to choose between availability (A)
and consistency (C) (as per the CAP
theorem), but else (E), even when the
system is running normally in the
absence of partitions, one has to
choose between latency (L) and loss
of consistency (C).
Wikipedia, 2025
Tradeoff:

Latency vs.

availabity
Tradeoff:

Latency vs. loss

of Consistency
PA EL
PC EC
Partitioned?
(E) No

(availability suffers)
(P) Yes

(latency suffers)
A L
C C
01 - Occasional Read - PC/EL
Tradeoff:

Latency vs.

availabity
Tradeoff:

Latency vs. loss

of Consistency
EL
PC
Partitioned?
(E) No

(availability suffers)
(P) Yes

(latency suffers)
We call the API each time to 

fetch the latest data, thereby

increasing Latency.
We sacrifice Availability to remain

Consistent and avoid making 

decisions based on stale data.
L
C
02-IntensiveRead-PA/EC
Tradeoff:

Latencyvs.

availabity
Tradeoff:

Latencyvs. loss

of Consistency
EC
PA
Partitioned?
(E) No

(availability suffers)
(P) Yes

(latency suffers)
We use a local snapshot of the data, 

thereby choosing loss of Consistency 

over Latency.
We continue processing requests 

as usual, remaining Available.
C
A
Consequences 

ofisolation for 

the infrastructure
Distributed load across RDS instances
Distributed load across RDS instances
Distributed load across RDS instances
Increased scalable
Event-Driven interactions
Increased scalable
Event-Driven interactions
Increased scalable
Event-Driven interactions
Improved deployment stability
Improved deployment stability
Improved deployment stability
Enhanced data security
Enhanced data security
Enhanced data security
Consequently, higher infrastructure
maintenance costs
Consequently, higher infrastructure
maintenance costs
Consequently, higher infrastructure
maintenance costs
Significant increase in the number of transport
components in the architecture
Significant increase in the number of transport
components in the architecture
Significant increase in the number of transport
components in the architecture
Increased latency across the entire system
Increased latency across the entire system
Increased latency across the entire system
Reduced DB
maintenance overhead
Reduced DB
maintenance overhead
Reduced DB
maintenance overhead
Howhas the infrastructure changed?
Lesson 

learned
The data returned via API/Streaming is
always limited, requiring repeated
requests for additional information
The data returned via API/Streaming is
always limited, requiring repeated
requests for additional information
The data returned via API/Streaming is
always limited, requiring repeated
requests for additional information
The database schema often prevents
isolation from being implemented
The database schema often prevents
isolation from being implemented
The database schema often prevents
isolation from being implemented
Every sprint now
includes one or more
tasks related to API
expansion
Every sprint now
includes one or more
tasks related to API
expansion
Every sprint now
includes one or more
tasks related to API
expansion
Idempotency is now
required everywhere
Idempotency is now
required everywhere
Idempotency is now
required everywhere
Lesson learned
is it really

worth it?
Hell yeah
Efficient and sophisticated
systems aren’t built
overnight — they are the
product of repeated failures,
incremental optimizations,
and relentless learning from
mistakes.
Дякую за увагу!
telegram: @Swoqe

More Related Content

PPTX
Application architecture for the rest of us - php xperts devcon 2012
PPTX
Monoliths, Migrations, and Microservices
PPTX
Scaling Your Architecture with Services and Events
PPTX
Effective Microservices In a Data-centric World
PPT
Technology Overview
PPTX
Patterns of Distributed Application Design
PDF
From no services to Microservices
PDF
Patterns of Distributed Application Design
Application architecture for the rest of us - php xperts devcon 2012
Monoliths, Migrations, and Microservices
Scaling Your Architecture with Services and Events
Effective Microservices In a Data-centric World
Technology Overview
Patterns of Distributed Application Design
From no services to Microservices
Patterns of Distributed Application Design

Similar to "Database isolation: how we deal with hundreds of direct connections to the database", Mykhailo Kratiuk .pdf (20)

PPTX
Application architecture for cloud
PPTX
Stream me to the Cloud (and back) with Confluent & MongoDB
PDF
Scalable web architecture
PDF
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
PDF
Guide to NoSQL with MySQL
PPTX
Black Friday and Cyber Monday- Best Practices for Your E-Commerce Database
PDF
From Business Idea to Successful Delivery by Serhiy Haziyev & Olha Hrytsay, S...
PDF
Kafka Summit SF 2017 - Keynote - Managing Data at Scale: The Unreasonable Eff...
PDF
MongoDB Breakfast Milan - Mainframe Offloading Strategies
PPTX
CodeFutures - Scaling Your Database in the Cloud
PDF
Data Architecture at Vente-Exclusive.com - TOTM Exellys
PDF
Refacoring vs Rewriting WixStores
PDF
Building a Microservices-based ERP System
PPTX
SQL and NoSQL in SQL Server
PPTX
Nov 2019 kafka with mongo db and confluent sydney
PDF
apidays LIVE Hong Kong 2021 - Modernizing Monolith Applications with API Arch...
PPT
Growing Data Analytics at Etsy (Cristopher Bohn)
PPTX
Couchbase - orbitz use case - nyc meetup
PPTX
Webinar: How to Drive Business Value in Financial Services with MongoDB
PPTX
RavenDB overview
Application architecture for cloud
Stream me to the Cloud (and back) with Confluent & MongoDB
Scalable web architecture
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
Guide to NoSQL with MySQL
Black Friday and Cyber Monday- Best Practices for Your E-Commerce Database
From Business Idea to Successful Delivery by Serhiy Haziyev & Olha Hrytsay, S...
Kafka Summit SF 2017 - Keynote - Managing Data at Scale: The Unreasonable Eff...
MongoDB Breakfast Milan - Mainframe Offloading Strategies
CodeFutures - Scaling Your Database in the Cloud
Data Architecture at Vente-Exclusive.com - TOTM Exellys
Refacoring vs Rewriting WixStores
Building a Microservices-based ERP System
SQL and NoSQL in SQL Server
Nov 2019 kafka with mongo db and confluent sydney
apidays LIVE Hong Kong 2021 - Modernizing Monolith Applications with API Arch...
Growing Data Analytics at Etsy (Cristopher Bohn)
Couchbase - orbitz use case - nyc meetup
Webinar: How to Drive Business Value in Financial Services with MongoDB
RavenDB overview
Ad

More from Fwdays (20)

PDF
"Mastering UI Complexity: State Machines and Reactive Patterns at Grammarly",...
PDF
"Effect, Fiber & Schema: tactical and technical characteristics of Effect.ts"...
PPTX
"Computer Use Agents: From SFT to Classic RL", Maksym Shamrai
PPTX
"Як ми переписали Сільпо на Angular", Євген Русаков
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
PDF
"Validation and Observability of AI Agents", Oleksandr Denisyuk
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
PPTX
"Co-Authoring with a Machine: What I Learned from Writing a Book on Generativ...
PPTX
"Human-AI Collaboration Models for Better Decisions, Faster Workflows, and Cr...
PDF
"AI is already here. What will happen to your team (and your role) tomorrow?"...
PPTX
"Is it worth investing in AI in 2025?", Alexander Sharko
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
PDF
"Scaling in space and time with Temporal", Andriy Lupa.pdf
PDF
"Scaling in space and time with Temporal", Andriy Lupa .pdf
PPTX
"Provisioning via DOT-Chain: from catering to drone marketplaces", Volodymyr ...
PPTX
" Observability with Elasticsearch: Best Practices for High-Load Platform", A...
PPTX
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
PPTX
"Istio Ambient Mesh in production: our way from Sidecar to Sidecar-less",Hlib...
PPTX
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
"Mastering UI Complexity: State Machines and Reactive Patterns at Grammarly",...
"Effect, Fiber & Schema: tactical and technical characteristics of Effect.ts"...
"Computer Use Agents: From SFT to Classic RL", Maksym Shamrai
"Як ми переписали Сільпо на Angular", Євген Русаков
"AI Transformation: Directions and Challenges", Pavlo Shaternik
"Validation and Observability of AI Agents", Oleksandr Denisyuk
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
"Co-Authoring with a Machine: What I Learned from Writing a Book on Generativ...
"Human-AI Collaboration Models for Better Decisions, Faster Workflows, and Cr...
"AI is already here. What will happen to your team (and your role) tomorrow?"...
"Is it worth investing in AI in 2025?", Alexander Sharko
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa .pdf
"Provisioning via DOT-Chain: from catering to drone marketplaces", Volodymyr ...
" Observability with Elasticsearch: Best Practices for High-Load Platform", A...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"Istio Ambient Mesh in production: our way from Sidecar to Sidecar-less",Hlib...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Ad

Recently uploaded (20)

PDF
Modernizing your data center with Dell and AMD
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Electronic commerce courselecture one. Pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Cloud computing and distributed systems.
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Modernizing your data center with Dell and AMD
Diabetes mellitus diagnosis method based random forest with bat algorithm
20250228 LYD VKU AI Blended-Learning.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Empathic Computing: Creating Shared Understanding
Advanced methodologies resolving dimensionality complications for autism neur...
Reach Out and Touch Someone: Haptics and Empathic Computing
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Electronic commerce courselecture one. Pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
NewMind AI Weekly Chronicles - August'25 Week I
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectral efficient network and resource selection model in 5G networks
Cloud computing and distributed systems.
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...

"Database isolation: how we deal with hundreds of direct connections to the database", Mykhailo Kratiuk .pdf

  • 2. About me Worked with dinosaurs, but fell 
 in love with Ukrainian fintech Worked with dinosaurs, but fell 
 in love with Ukrainian fintech Worked with dinosaurs, but fell 
 in love with Ukrainian fintech 4+ years of developing cloud 
 and self-hosted products 4+ years of developing cloud 
 and self-hosted products 4+ years of developing cloud 
 and self-hosted products Platform Engineer in past Platform Engineer in past Platform Engineer in past Backend Software Engineer
 at Core Team, Solidgate Backend Software Engineer
 at Core Team, Solidgate Backend Software Engineer
 at Core Team, Solidgate
  • 3. About Solidgate 7+ years online 7+ years online 7+ years online 80 engineers 80 engineers 80 engineers 4.5× growth in team size since 2020 4.5× growth in team size since 2020 4.5× growth in team size since 2020 Сard acquiring and local payment methods across the globe Сard acquiring and local payment methods across the globe Сard acquiring and local payment methods across the globe 60 SW engineers, 20 Infra + 
 Data engineers + AQA 60 SW engineers, 20 Infra + 
 Data engineers + AQA 60 SW engineers, 20 Infra + 
 Data engineers + AQA
  • 5. Engineering as it was 3 engineering 
 teams 3 engineering 
 teams 3 engineering 
 teams 5-12 engineers perteam 5-12 engineers perteam 5-12 engineers perteam 2 services each team owned 2 services each team owned 2 services each team owned 5+ databases 5+ databases 5+ databases
  • 6. System as it was Merchant Back-office Finance System Card
 Gate Alt
 Gate Database Database Database
  • 8. Simplicity and speed 
 of implementation Simplicity and speed 
 of implementation Simplicity and speed 
 of implementation Lower overhead – fewer network 
 calls and intermediate layers Lower overhead – fewer network 
 calls and intermediate layers Lower overhead – fewer network 
 calls and intermediate layers Query flexibility without 
 contract limitations Query flexibility without 
 contract limitations Query flexibility without 
 contract limitations Independence from 
 other services Independence from 
 other services Independence from 
 other services Benefits of shared databases
  • 10. E-commerce My name is Command Query Responsibility Segregation Pattern but friends call me CQRS
  • 11. My name is Command Query Responsibility Segregation Pattern
  • 12. Engineeringasitisnow 11 engineering 
 teams 11 engineering 
 teams 11 engineering 
 teams 3-8 engineers perteam 3-8 engineers perteam 3-8 engineers perteam 7 services 
 perteam 7 services 
 perteam 7 services 
 perteam 50+ databases 50+ databases 50+ databases
  • 14. Once upon a time read/write
  • 15. Once upon a time read/write read
  • 17. Inconsistency of data 
 structures across services Inconsistency of data 
 structures across services Inconsistency of data 
 structures across services Changes by one service can unexpectedly break others Changes by one service can unexpectedly break others Changes by one service can unexpectedly break others Difficulty in coordinating and rolling back schema modifications Difficulty in coordinating and rolling back schema modifications Difficulty in coordinating and rolling back schema modifications Increased risk of data corruption or loss during schema changes Increased risk of data corruption or loss during schema changes Increased risk of data corruption or loss during schema changes Database schema changes
  • 18. Custom validation and data formatting logic for each service Custom validation and data formatting logic for each service Custom validation and data formatting logic for each service One service may update a field in a way 
 that makes it unreadable by another service One service may update a field in a way 
 that makes it unreadable by another service One service may update a field in a way 
 that makes it unreadable by another service Data that once passed validation in the first service can no longer 
 be considered valid if another service modifies them directly Data that once passed validation in the first service can no longer 
 be considered valid if another service modifies them directly Data that once passed validation in the first service can no longer 
 be considered valid if another service modifies them directly Validation and data transformation
  • 19. Problems caused by the lack of database isolation Transaction and consistency issues; Transaction and consistency issues; Transaction and consistency issues; Violation of microservice independence Violation of microservice independence Violation of microservice independence Risk of implicit “agreements” at 
 the database level Risk of implicit “agreements” at 
 the database level Risk of implicit “agreements” at 
 the database level Data security concerns Data security concerns Data security concerns Scalability challenges Scalability challenges Scalability challenges
  • 23. Breakdown by entities Owner service DB Entity Client services Estimated cost Notes Jira issue merchant configuration cardgate config shop HUB (old) cardgate finance system ETA ??? ~3 weeks ~1 week Remove old HUB will do the job A lot of usages via ORM relations
 • use event stream to get shops
 • store shops in operations DB (as replicated data) Migrate from shops to channels
 Note: depends on channels isolation
 Note2: PHP code can remain unchanged due to further decommissioning.k merchant configuration cardgate config currency cardgate finance system reconciliation- kotlin currency- convertor (go) ~0.5 week ~0.5 week ETA ??? ~0.5 week Use merchant configuration API. Use merchant configuration API. We already have data replicated to Redshift, but its sync period is 1 hour which doesn’t cover some merchants' requirements.
 We have 2 solutions here:
 Force merchants to use these reports even with 1-hour delay and propose webhooks as a way of getting fresh updates.
 Tune the data pipelines to minimize delay to minutes (NordStream). Use merchant configuration API. cardgate cardgate operations PSP transaction search ~2 weeks Estimation includes moving to event streaming and API calls instead of direct DB queries.

 It doesn’t include the replicating data in the search’s own DB.
  • 24. Patterns forDB decomposition Change Data Ownership Change Data Ownership Change Data Ownership Database 
 Wrapping Service Database 
 Wrapping Service Database 
 Wrapping Service Monolith as data 
 access layer Monolith as data 
 access layer Monolith as data 
 access layer Database View Database View Database View Synchronize Data 
 in Application Synchronize Data 
 in Application Synchronize Data 
 in Application
  • 29. Impl. API Development 
 on the Service- owner side: API / Event-streaming with all the necessary data. Impl. API Development 
 on the Service- owner side: API / Event-streaming with all the necessary data. 1 Impl. API Development 
 on the Service- owner side: API / Event-streaming with all the necessary data. Acquire The client service implements 
 a component that uses the API provided by the service owner, while continuing to make direct database queries in parallel. Acquire The client service implements 
 a component that uses the API provided by the service owner, while continuing to make direct database queries in parallel. 2 Acquire The client service implements 
 a component that uses the API provided by the service owner, while continuing to make direct database queries in parallel. Dark read The client service team tests functionality, absence of bugs, and changes in performance. They simultaneously compare results obtained via the API and direct database queries. Dark read The client service team tests functionality, absence of bugs, and changes in performance. They simultaneously compare results obtained via the API and direct database queries. 3 Dark read The client service team tests functionality, absence of bugs, and changes in performance. They simultaneously compare results obtained via the API and direct database queries. Switch Development 
 of a switching mechanism: 
 all traffic at once, or percentage-based, or by specific clients. Switch Development 
 of a switching mechanism: 
 all traffic at once, or percentage-based, or by specific clients. 4 Switch Development 
 of a switching mechanism: 
 all traffic at once, or percentage-based, or by specific clients. Clean-up The client 
 service completely removes all direct queries to the external database. Clean-up The client 
 service completely removes all direct queries to the external database. 5 Clean-up The client 
 service completely removes all direct queries to the external database. Client service switchworkflow
  • 30. Synchronize Data in Application
  • 31. Copy original DB Copy original DB Copy original DB Write to both, read from original Write to both, read from original Write to both, read from original Write to both, read from new Write to both, read from new Write to both, read from new Clean up Clean up Clean up Synchronize Data in Application
  • 32. Copy original DB Copy original DB Copy original DB Write to both, read from original Write to both, read from original Write to both, read from original Write to both, read from new Write to both, read from new Write to both, read from new Clean up Clean up Clean up Synchronize Data in Application
  • 33. Copy original DB Copy original DB Copy original DB Write to both, read from original Write to both, read from original Write to both, read from original Write to both, read from new Write to both, read from new Write to both, read from new Clean up Clean up Clean up Synchronize Data in Application
  • 34. Copy original DB Copy original DB Copy original DB Write to both, read from original Write to both, read from original Write to both, read from original Write to both, read from new Write to both, read from new Write to both, read from new Clean up Clean up Clean up Synchronize Data in Application
  • 36. Chargebacks Isolation Consistency Req.: High RPS: 0.03 Latency: 2s Consistency Req.: High RPS: 0.03 Latency: 2s 01 Occasional
 READ Consistency Req.: High RPS: 0.03 Latency: 2s Consistency Req.: Eventual RPS: 5.6 Latency: 60ms Consistency Req.: Eventual RPS: 5.6 Latency: 60ms 02 Intensive
 READ Consistency Req.: Eventual RPS: 5.6 Latency: 60ms
  • 37. PACELC design principle … in case of network partitioning (P) in a distributed computer system, one has to choose between availability (A) and consistency (C) (as per the CAP theorem), but else (E), even when the system is running normally in the absence of partitions, one has to choose between latency (L) and loss of consistency (C). Wikipedia, 2025 Tradeoff: Latency vs. availabity Tradeoff: Latency vs. loss
 of Consistency PA EL PC EC Partitioned? (E) No
 (availability suffers) (P) Yes
 (latency suffers) A L C C
  • 38. 01 - Occasional Read - PC/EL Tradeoff: Latency vs. availabity Tradeoff: Latency vs. loss
 of Consistency EL PC Partitioned? (E) No
 (availability suffers) (P) Yes
 (latency suffers) We call the API each time to 
 fetch the latest data, thereby
 increasing Latency. We sacrifice Availability to remain
 Consistent and avoid making 
 decisions based on stale data. L C
  • 39. 02-IntensiveRead-PA/EC Tradeoff: Latencyvs. availabity Tradeoff: Latencyvs. loss
 of Consistency EC PA Partitioned? (E) No
 (availability suffers) (P) Yes
 (latency suffers) We use a local snapshot of the data, 
 thereby choosing loss of Consistency 
 over Latency. We continue processing requests 
 as usual, remaining Available. C A
  • 40. Consequences 
 ofisolation for 
 the infrastructure
  • 41. Distributed load across RDS instances Distributed load across RDS instances Distributed load across RDS instances Increased scalable Event-Driven interactions Increased scalable Event-Driven interactions Increased scalable Event-Driven interactions Improved deployment stability Improved deployment stability Improved deployment stability Enhanced data security Enhanced data security Enhanced data security Consequently, higher infrastructure maintenance costs Consequently, higher infrastructure maintenance costs Consequently, higher infrastructure maintenance costs Significant increase in the number of transport components in the architecture Significant increase in the number of transport components in the architecture Significant increase in the number of transport components in the architecture Increased latency across the entire system Increased latency across the entire system Increased latency across the entire system Reduced DB maintenance overhead Reduced DB maintenance overhead Reduced DB maintenance overhead Howhas the infrastructure changed?
  • 43. The data returned via API/Streaming is always limited, requiring repeated requests for additional information The data returned via API/Streaming is always limited, requiring repeated requests for additional information The data returned via API/Streaming is always limited, requiring repeated requests for additional information The database schema often prevents isolation from being implemented The database schema often prevents isolation from being implemented The database schema often prevents isolation from being implemented Every sprint now includes one or more tasks related to API expansion Every sprint now includes one or more tasks related to API expansion Every sprint now includes one or more tasks related to API expansion Idempotency is now required everywhere Idempotency is now required everywhere Idempotency is now required everywhere Lesson learned
  • 46. Efficient and sophisticated systems aren’t built overnight — they are the product of repeated failures, incremental optimizations, and relentless learning from mistakes.