SlideShare a Scribd company logo
1 of 23
Download to read offline
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
Data management
In Microservices
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !2
Data management
in Microservices
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !3
Monolithic
Application
DB
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !4
Microservices
Service 1 Service 2 Service 3
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !5
Microservices
Service 1 Service 2 Service 3
1. Shared database
DB
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !6
Microservices
Service 1 Service 2 Service 3
2. Database per service
DBDB DB
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !7
Database per service
High complexity
Query data across multiple databases
Challenge “How to join data ?”
Maintain database consistency
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !8
How to maintain data
consistency across services ?
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !9
We need …
Don’t need distributed transaction
Reduce complexity of code
Reliable
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !10
???
Service 1
Service 2
Service 3
Sequence of Tx and emit event or message
that trigger the next process in Tx
Event
produce
consume
Event
produce
consume
Timeline
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !11
???
Service 1
Service 2
Service 3
Sequence of Tx and emit event or message
that trigger the next process in Tx
1. command 2. response
3. command
4. response
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !12
Message vs Event
Message is addressed to someone
Event is something that happen and someone
can react to that
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !13
“Saga”
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !14
Event sourcing
Maintain source of truth of business
Immutable sequence of events
Event Event TimelineEventEvent Event
Sequence of event is keep in Event store
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !15
Event store
Keep events in order
Broadcast new event
Service 1 Service 2 Service 3
Event store
produce consume consume
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !16
With Event sourcing, we can
decouple services (query and
command)
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !17
CQRS
Command Query Responsibility Segregation
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !18
CQRS
Separate command and query services
Command Query
Event store
produce consume
DB
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !19
Event sourcing with database
Working with database
Bin log Event storeDB
bin log event
Binlog or Binary log event is information about data modification made to database
Event Event Event
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !20
Event sourcing
Duplication data (denormalize database)
Complexity (separate query and command)
Difficult to maintain
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !21
Event sourcing can’t solve all
problems
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !22
Start with understand your
purpose
Data management in Microservices
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !23
Start with understand your
problem to resolve

More Related Content

Similar to Manage data of service

vTalk#1 Microservices with Spring Boot
vTalk#1 Microservices with Spring BootvTalk#1 Microservices with Spring Boot
vTalk#1 Microservices with Spring BootSomkiat Puisungnoen
 
Digital Experience Management—The Key to Delivering Exceptional Digital Exper...
Digital Experience Management—The Key to Delivering Exceptional Digital Exper...Digital Experience Management—The Key to Delivering Exceptional Digital Exper...
Digital Experience Management—The Key to Delivering Exceptional Digital Exper...Riverbed Technology
 
In-Memory Computing Driving Edge Computing and Blockchain Technologies
In-Memory Computing Driving Edge Computing and Blockchain TechnologiesIn-Memory Computing Driving Edge Computing and Blockchain Technologies
In-Memory Computing Driving Edge Computing and Blockchain Technologiesdsapps
 
Data & Analytic Innovations: 5 lessons from our customers
Data & Analytic Innovations: 5 lessons from our customersData & Analytic Innovations: 5 lessons from our customers
Data & Analytic Innovations: 5 lessons from our customersNick Smith
 
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...MongoDB
 
Is Your ERP Ready for the Age of Personalization?
Is Your ERP Ready for the Age of Personalization?Is Your ERP Ready for the Age of Personalization?
Is Your ERP Ready for the Age of Personalization?Rootstock Software
 
VERSNEL INNOVATIE MET DATA SCIENCE - WERK SAMEN, OPERATIONALISEER EN SCHAAL M...
VERSNEL INNOVATIE MET DATA SCIENCE - WERK SAMEN, OPERATIONALISEER EN SCHAAL M...VERSNEL INNOVATIE MET DATA SCIENCE - WERK SAMEN, OPERATIONALISEER EN SCHAAL M...
VERSNEL INNOVATIE MET DATA SCIENCE - WERK SAMEN, OPERATIONALISEER EN SCHAAL M...webwinkelvakdag
 
Peter Grimmond – Harnessing the power of data
Peter Grimmond – Harnessing the power of dataPeter Grimmond – Harnessing the power of data
Peter Grimmond – Harnessing the power of dataVeritas Technologies LLC
 
Denodo DataFest 2017: Company Leadership from Data Leadership
Denodo DataFest 2017: Company Leadership from Data LeadershipDenodo DataFest 2017: Company Leadership from Data Leadership
Denodo DataFest 2017: Company Leadership from Data LeadershipDenodo
 
7 ways to drive Digital Transformation
7 ways to drive Digital Transformation7 ways to drive Digital Transformation
7 ways to drive Digital TransformationJonathan Beardsley
 
Better Business from Exploring Ideas - Modern Data Architectures on AWS
Better Business from Exploring Ideas - Modern Data Architectures on AWSBetter Business from Exploring Ideas - Modern Data Architectures on AWS
Better Business from Exploring Ideas - Modern Data Architectures on AWSAmazon Web Services
 
Cisco Connect 2018 Singapore - delivering intent for data center networking
Cisco Connect 2018 Singapore -   delivering intent for data center networkingCisco Connect 2018 Singapore -   delivering intent for data center networking
Cisco Connect 2018 Singapore - delivering intent for data center networkingNetworkCollaborators
 
Xanadu for Big Data + IoT + Deep Learning + Cloud Integration Strategy
Xanadu for Big Data + IoT + Deep Learning + Cloud Integration StrategyXanadu for Big Data + IoT + Deep Learning + Cloud Integration Strategy
Xanadu for Big Data + IoT + Deep Learning + Cloud Integration StrategyAlex G. Lee, Ph.D. Esq. CLP
 
Cisco Connect 2018 Malaysia - Programmability and telemetry for future networks
Cisco Connect 2018 Malaysia - Programmability and telemetry for future networksCisco Connect 2018 Malaysia - Programmability and telemetry for future networks
Cisco Connect 2018 Malaysia - Programmability and telemetry for future networksNetworkCollaborators
 
Leap to Next Generation Data Management with Denodo 7.0
Leap to Next Generation Data Management with Denodo 7.0Leap to Next Generation Data Management with Denodo 7.0
Leap to Next Generation Data Management with Denodo 7.0Denodo
 
Machine Learning for z/OS
Machine Learning for z/OSMachine Learning for z/OS
Machine Learning for z/OSCuneyt Goksu
 
#Blockchain - ISG Digital Business Summit 2017 - AP Manders
#Blockchain - ISG Digital Business Summit 2017 - AP Manders#Blockchain - ISG Digital Business Summit 2017 - AP Manders
#Blockchain - ISG Digital Business Summit 2017 - AP MandersAlex Manders
 
IBM Storage at the Incisive Media, IT Leaders Forum with Computing.co.uk
IBM Storage at the Incisive Media, IT Leaders Forum with Computing.co.ukIBM Storage at the Incisive Media, IT Leaders Forum with Computing.co.uk
IBM Storage at the Incisive Media, IT Leaders Forum with Computing.co.ukMatt Fordham
 
Blockchain - "Hype, Reality and Promise" - ISG Digital Business Summit, 2018
Blockchain - "Hype, Reality and Promise" - ISG Digital Business Summit, 2018 Blockchain - "Hype, Reality and Promise" - ISG Digital Business Summit, 2018
Blockchain - "Hype, Reality and Promise" - ISG Digital Business Summit, 2018 Alex Manders
 

Similar to Manage data of service (20)

vTalk#1 Microservices with Spring Boot
vTalk#1 Microservices with Spring BootvTalk#1 Microservices with Spring Boot
vTalk#1 Microservices with Spring Boot
 
Digital Experience Management—The Key to Delivering Exceptional Digital Exper...
Digital Experience Management—The Key to Delivering Exceptional Digital Exper...Digital Experience Management—The Key to Delivering Exceptional Digital Exper...
Digital Experience Management—The Key to Delivering Exceptional Digital Exper...
 
In-Memory Computing Driving Edge Computing and Blockchain Technologies
In-Memory Computing Driving Edge Computing and Blockchain TechnologiesIn-Memory Computing Driving Edge Computing and Blockchain Technologies
In-Memory Computing Driving Edge Computing and Blockchain Technologies
 
Data & Analytic Innovations: 5 lessons from our customers
Data & Analytic Innovations: 5 lessons from our customersData & Analytic Innovations: 5 lessons from our customers
Data & Analytic Innovations: 5 lessons from our customers
 
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
 
Is Your ERP Ready for the Age of Personalization?
Is Your ERP Ready for the Age of Personalization?Is Your ERP Ready for the Age of Personalization?
Is Your ERP Ready for the Age of Personalization?
 
VERSNEL INNOVATIE MET DATA SCIENCE - WERK SAMEN, OPERATIONALISEER EN SCHAAL M...
VERSNEL INNOVATIE MET DATA SCIENCE - WERK SAMEN, OPERATIONALISEER EN SCHAAL M...VERSNEL INNOVATIE MET DATA SCIENCE - WERK SAMEN, OPERATIONALISEER EN SCHAAL M...
VERSNEL INNOVATIE MET DATA SCIENCE - WERK SAMEN, OPERATIONALISEER EN SCHAAL M...
 
Peter Grimmond – Harnessing the power of data
Peter Grimmond – Harnessing the power of dataPeter Grimmond – Harnessing the power of data
Peter Grimmond – Harnessing the power of data
 
Denodo DataFest 2017: Company Leadership from Data Leadership
Denodo DataFest 2017: Company Leadership from Data LeadershipDenodo DataFest 2017: Company Leadership from Data Leadership
Denodo DataFest 2017: Company Leadership from Data Leadership
 
7 ways to drive Digital Transformation
7 ways to drive Digital Transformation7 ways to drive Digital Transformation
7 ways to drive Digital Transformation
 
Better Business from Exploring Ideas - Modern Data Architectures on AWS
Better Business from Exploring Ideas - Modern Data Architectures on AWSBetter Business from Exploring Ideas - Modern Data Architectures on AWS
Better Business from Exploring Ideas - Modern Data Architectures on AWS
 
Cisco Connect 2018 Singapore - delivering intent for data center networking
Cisco Connect 2018 Singapore -   delivering intent for data center networkingCisco Connect 2018 Singapore -   delivering intent for data center networking
Cisco Connect 2018 Singapore - delivering intent for data center networking
 
Xanadu for Big Data + IoT + Deep Learning + Cloud Integration Strategy
Xanadu for Big Data + IoT + Deep Learning + Cloud Integration StrategyXanadu for Big Data + IoT + Deep Learning + Cloud Integration Strategy
Xanadu for Big Data + IoT + Deep Learning + Cloud Integration Strategy
 
Cisco Connect 2018 Malaysia - Programmability and telemetry for future networks
Cisco Connect 2018 Malaysia - Programmability and telemetry for future networksCisco Connect 2018 Malaysia - Programmability and telemetry for future networks
Cisco Connect 2018 Malaysia - Programmability and telemetry for future networks
 
graymatter-pentaho-consulting-services-.pdf
graymatter-pentaho-consulting-services-.pdfgraymatter-pentaho-consulting-services-.pdf
graymatter-pentaho-consulting-services-.pdf
 
Leap to Next Generation Data Management with Denodo 7.0
Leap to Next Generation Data Management with Denodo 7.0Leap to Next Generation Data Management with Denodo 7.0
Leap to Next Generation Data Management with Denodo 7.0
 
Machine Learning for z/OS
Machine Learning for z/OSMachine Learning for z/OS
Machine Learning for z/OS
 
#Blockchain - ISG Digital Business Summit 2017 - AP Manders
#Blockchain - ISG Digital Business Summit 2017 - AP Manders#Blockchain - ISG Digital Business Summit 2017 - AP Manders
#Blockchain - ISG Digital Business Summit 2017 - AP Manders
 
IBM Storage at the Incisive Media, IT Leaders Forum with Computing.co.uk
IBM Storage at the Incisive Media, IT Leaders Forum with Computing.co.ukIBM Storage at the Incisive Media, IT Leaders Forum with Computing.co.uk
IBM Storage at the Incisive Media, IT Leaders Forum with Computing.co.uk
 
Blockchain - "Hype, Reality and Promise" - ISG Digital Business Summit, 2018
Blockchain - "Hype, Reality and Promise" - ISG Digital Business Summit, 2018 Blockchain - "Hype, Reality and Promise" - ISG Digital Business Summit, 2018
Blockchain - "Hype, Reality and Promise" - ISG Digital Business Summit, 2018
 

More from Somkiat Puisungnoen (20)

Next of Java 2022
Next of Java 2022Next of Java 2022
Next of Java 2022
 
Lesson learned from React native and Flutter
Lesson learned from React native and FlutterLesson learned from React native and Flutter
Lesson learned from React native and Flutter
 
devops
devops devops
devops
 
Angular :: basic tuning performance
Angular :: basic tuning performanceAngular :: basic tuning performance
Angular :: basic tuning performance
 
Shared code between projects
Shared code between projectsShared code between projects
Shared code between projects
 
RobotFramework Meetup at Thailand #2
RobotFramework Meetup at Thailand #2RobotFramework Meetup at Thailand #2
RobotFramework Meetup at Thailand #2
 
Visual testing
Visual testingVisual testing
Visual testing
 
Cloud Native App
Cloud Native AppCloud Native App
Cloud Native App
 
Sck Agile in Real World
Sck Agile in Real WorldSck Agile in Real World
Sck Agile in Real World
 
Clean you code
Clean you codeClean you code
Clean you code
 
SCK Firestore at CNX
SCK Firestore at CNXSCK Firestore at CNX
SCK Firestore at CNX
 
Unhappiness Developer
Unhappiness DeveloperUnhappiness Developer
Unhappiness Developer
 
The Beauty of BAD code
The Beauty of  BAD codeThe Beauty of  BAD code
The Beauty of BAD code
 
React in the right way
React in the right wayReact in the right way
React in the right way
 
Rise of Container (RoC)
Rise of Container (RoC)Rise of Container (RoC)
Rise of Container (RoC)
 
SCK :: Scrum is NOT Enough
SCK :: Scrum is NOT EnoughSCK :: Scrum is NOT Enough
SCK :: Scrum is NOT Enough
 
Software Development Trends 2017 at IMC
Software Development Trends 2017 at IMCSoftware Development Trends 2017 at IMC
Software Development Trends 2017 at IMC
 
Design pattern with Java 8
Design pattern with Java 8Design pattern with Java 8
Design pattern with Java 8
 
Meetup :: Update Elastic Stack 5.0
Meetup :: Update Elastic Stack 5.0Meetup :: Update Elastic Stack 5.0
Meetup :: Update Elastic Stack 5.0
 
Git as NoSQL
Git as NoSQLGit as NoSQL
Git as NoSQL
 

Recently uploaded

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Manage data of service

  • 1. © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. Data management In Microservices
  • 2. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !2 Data management in Microservices
  • 3. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !3 Monolithic Application DB
  • 4. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !4 Microservices Service 1 Service 2 Service 3
  • 5. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !5 Microservices Service 1 Service 2 Service 3 1. Shared database DB
  • 6. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !6 Microservices Service 1 Service 2 Service 3 2. Database per service DBDB DB
  • 7. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !7 Database per service High complexity Query data across multiple databases Challenge “How to join data ?” Maintain database consistency
  • 8. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !8 How to maintain data consistency across services ?
  • 9. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !9 We need … Don’t need distributed transaction Reduce complexity of code Reliable
  • 10. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !10 ??? Service 1 Service 2 Service 3 Sequence of Tx and emit event or message that trigger the next process in Tx Event produce consume Event produce consume Timeline
  • 11. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !11 ??? Service 1 Service 2 Service 3 Sequence of Tx and emit event or message that trigger the next process in Tx 1. command 2. response 3. command 4. response
  • 12. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !12 Message vs Event Message is addressed to someone Event is something that happen and someone can react to that
  • 13. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !13 “Saga”
  • 14. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !14 Event sourcing Maintain source of truth of business Immutable sequence of events Event Event TimelineEventEvent Event Sequence of event is keep in Event store
  • 15. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !15 Event store Keep events in order Broadcast new event Service 1 Service 2 Service 3 Event store produce consume consume
  • 16. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !16 With Event sourcing, we can decouple services (query and command)
  • 17. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !17 CQRS Command Query Responsibility Segregation
  • 18. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !18 CQRS Separate command and query services Command Query Event store produce consume DB
  • 19. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !19 Event sourcing with database Working with database Bin log Event storeDB bin log event Binlog or Binary log event is information about data modification made to database Event Event Event
  • 20. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !20 Event sourcing Duplication data (denormalize database) Complexity (separate query and command) Difficult to maintain
  • 21. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !21 Event sourcing can’t solve all problems
  • 22. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !22 Start with understand your purpose
  • 23. Data management in Microservices © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. !23 Start with understand your problem to resolve