SlideShare a Scribd company logo
Dealing with
Consistency in
Distributed
Systems
Amir Zuker
2 8 . 0 6 . 2 3
Fancy Books
(decades ago)
Decades Ago
RDBMS
Service
Service
Service
Use-case: Submit Order
Decades Ago
RDBMS
Service
Service
Service
Use-case: Submit Order
function submitOrder(request) {
try {
const tx = createDbTransaction();
const order = await createOrder(tx, request);
const invoice = await performPayment(tx, order);
await initiateShipment(tx, order);
await updateInventory(tx, order);
await tx.commit();
return formatResponse(request, invoice);
} catch (error) {
tx.rollback();
throw error;
}
}
Fancy Books
(today)
Today
Db
Payment
Service
Order
Service
Shipping
Service
Db
Db
Inventory
Service
Db
Use-case: Submit Order
About Me
10
Amir Zuker
 Senior software architect, developer
 Over 25 years of experience in the field
 Leads teams and R&D divisions
 Several publications and contributions
 CTO at CodeValue
@amirzuker
amirz@codevalue.net
Agenda
 Consistency in Distributed Systems
 Immediate vs. Eventual Consistency
 Distributed Sagas
 Consistency as a Feature
11
Consistency in
Distributed Systems
12
Consistency – A Broad Term
 Database systems
 Data is “correct”
 Data consistency
 Sync across replicas
 Software engineering
 Business transactions
 Overall state is sound (integrity included)
13
RDBMS
Replica Replica Replica
Service
Service
Service
Consistency + Reliability
Error
Handling
Fault
Tolerance
Durability
Testing
Race
Conditions
Business
Transactions
Redundancy
Data
Integrity
Data
Consistency
Concurrency
Distributed Business Flows
 A business transaction can span multiple services
 Distributed systems:
“components are located on different networked computers”
15
Db
Service
Service
Service
Db
Db
16
To distribute
or not?
17
Why Distribute?
 Nature of the application
 Organization
 Structure and communication flow
 Politics
 Technical needs
 Scale, Redundancy, Availability, Polyglot, etc.
 Masochism
Distribute!
19
ACID
 ACID
 Atomic, Consistent, Isolated, Durable
 Strong and immediate consistency
 All or nothing
 Correct
 No side effects
 Persisted
Db
Service
Can we do ACID in distributed flows?
ACID-like Distributed Business Transaction
22
Db
Db
Db
Service
Service
Service
Service
ACID-like Distributed Business Transaction
23
Db
Db
Db
Service
Service
Service
Service
ACID-like Distributed Business Transaction
24
Db
Db
Db
Service
Service
Service
Service
A  B
A  B
A  B
Service
A
ACID-like Distributed Business Transaction
25
Db
Db
Db
Service
Service
Service
Service
A  B
A  B
Service
A
ACID-like Distributed Business Transaction
26
Db
Db
Db
Service
Service
Service
Service
A  B
A  B
Service
A
ACID in Distributed Systems
 Difficult and complex
 No silver bullet
 Today’s expectations
 Need reliable distributed flows?
 Probably look elsewhere
27
Eventual Consistency
 Opposite of immediate consistency
 If new updates aren’t made to a data item:
Eventually, all reads will return the last updated value
 Weak consistency guarantees
 Only liveness
28
Life
is
Eventually
Consistent
How can we achieve reliable distributed flows
with Eventual Consistency?
Distributed Sagas
31
Distributed Sagas
 Aggregates smaller (atomic) operations
 Uses compensation to handle failures
 Coordinated via orchestration or choreography
 Many implementations exist in the wild Db Db
Db
Service
Service Service
1. Orchestration, Commands, Sequential
33
Order
Orchestrator
Payment
Inventory
Shipment
Message Broker
Reply Queue
1. Orchestration, Commands, Sequential
34
Order
Orchestrator
Payment
Inventory
Shipment
Message Broker
Reply Queue
2. Choreography, Events, Sequential
35
Order
Payment
Inventory
Shipment
Message Broker
Order Created
Paid
Stock Updated
Shipped
2. Choreography, Events, Sequential
36
Order
Payment
Inventory
Shipment
Message Broker
Order Created
Paid
Out Of Stock
Distributed Sagas
 Guarantees either:
 All requests were completed successfully
OR..
 A subset of requests and their compensating requests were executed
 The system is consistent, eventually
 No atomicity
 No isolation
 Asynchronous messaging
 Persisted workflows
 Scheduler, agent, supervisor
39
Asynchronous Messaging
 Persistence
 No message loss
 Retries
 …requires Idempotence!
 Concurrency / Ordered
 Relevance
 Time-to-live (TTL)
 Dead-lettering
 Need to decide what to do with it afterwards though
 Loose coupling
 In terms of connectivity especially
40
Persisted Workflows
42
Source: https://github.com/Azure-Samples/saga-orchestration-serverless
Scheduler, Agent, Supervisor
43
Source: https://learn.microsoft.com/en-us/azure/architecture/patterns/scheduler-agent-supervisor
Oh, and one more small thing..
44
Test,
test,
and test..
Consistency in not only
about engineering 45
Consistency as a Feature
46
Product and UX/UI
Consistency as a Feature
 Unmet expectations  Bugs
 Affects
 Quality
 Customer trust and satisfaction
 Involve the product
 Negotiate, both ways
50
Eventual Consistency is
NOT
the new
Inconsistent
Product and UX/UI Mitigations
Design Considerations
 What must happen “immediately”
 What can take place later (eventually)
 What can be happy path only
 What can be made in parallel
 What level of control and accuracy is needed
Design Considerations
 What must happen “immediately”
 What can take place later (eventually)
 What can be best effort or happy path only
 What can be made in parallel
 What level of accuracy is needed
Key Takeaways
54
Key Takeaways
 Design
 Define business transaction boundaries
 Identify required consistency guarantees
 Not as an afterthought
 Involve product
 Realize and negotiate requirements
 Distributed or not, a choice
 Service granularity
 Consistency, an integrator force
 Test
 Address technical aspects
 Patterns
 Sagas, scheduler-agent-supervisor, etc.
 Coordination
 Orchestration or choreography
 Async messaging
 Persistence, retries, idempotence, TTL, DLQ
 Concurrency, connectivity, etc.
 Persisted workflows
 Be consistent
 ..as needed!
55
57
Slides:
https://www.slideshare.net/amirzuker/
business-transactions-in-distributed-systems
Dealing with Consistency
in Distributed Systems
Senior Software Architect
CTO at CodeValue
amirz@codevalue.net
Amir Zuker
@amirzuker

More Related Content

Similar to Business Transactions in Distributed Systems

Deploying large-scale, serverless and asynchronous systems - without integrat...
Deploying large-scale, serverless and asynchronous systems - without integrat...Deploying large-scale, serverless and asynchronous systems - without integrat...
Deploying large-scale, serverless and asynchronous systems - without integrat...
DiUS
 
Agile Software Architecture
Agile Software ArchitectureAgile Software Architecture
Agile Software Architecture
cesarioramos
 
Serverless Design Patterns (London Dev Community)
Serverless Design Patterns (London Dev Community)Serverless Design Patterns (London Dev Community)
Serverless Design Patterns (London Dev Community)
Yan Cui
 
Rapid Solutions with Salesforce Flows
Rapid Solutions with Salesforce FlowsRapid Solutions with Salesforce Flows
Rapid Solutions with Salesforce Flows
theCodery
 
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
Rick Hightower
 
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
Rick Hightower
 
Cqrs journey guide
Cqrs journey guideCqrs journey guide
Cqrs journey guide
Steve Xu
 
My Dad Won't Buy Me DevOps
My Dad Won't Buy Me DevOpsMy Dad Won't Buy Me DevOps
My Dad Won't Buy Me DevOps
XebiaLabs
 
Microdeployments for microservices dev ops nashville
Microdeployments for microservices   dev ops nashvilleMicrodeployments for microservices   dev ops nashville
Microdeployments for microservices dev ops nashville
Nathaniel (Ned) Bauerle
 
9X5u87KWa267pP7aGX3K
9X5u87KWa267pP7aGX3K9X5u87KWa267pP7aGX3K
9X5u87KWa267pP7aGX3K
CapitolPunishment
 
AZ900-AzureFundamentals-part-5.pdf
AZ900-AzureFundamentals-part-5.pdfAZ900-AzureFundamentals-part-5.pdf
AZ900-AzureFundamentals-part-5.pdf
ssuser2dbaee
 
State of DevOps - Build the Thing Right
State of DevOps - Build the Thing RightState of DevOps - Build the Thing Right
State of DevOps - Build the Thing Right
Sergiu Bodiu
 
Re-Architecting a Banking Application for Scale and Reliability (SRV220-R1) -...
Re-Architecting a Banking Application for Scale and Reliability (SRV220-R1) -...Re-Architecting a Banking Application for Scale and Reliability (SRV220-R1) -...
Re-Architecting a Banking Application for Scale and Reliability (SRV220-R1) -...
Amazon Web Services
 
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
Daniel Fisher
 
Microservices: Organizing Large Teams for Rapid Delivery
Microservices: Organizing Large Teams for Rapid DeliveryMicroservices: Organizing Large Teams for Rapid Delivery
Microservices: Organizing Large Teams for Rapid Delivery
VMware Tanzu
 
Low-Latency Data Processing in the Era of Serverless @XP Days
Low-Latency Data Processing in the Era of Serverless @XP DaysLow-Latency Data Processing in the Era of Serverless @XP Days
Low-Latency Data Processing in the Era of Serverless @XP Days
Nazarii Cherkas
 
Microservices Antipatterns
Microservices AntipatternsMicroservices Antipatterns
Microservices Antipatterns
C4Media
 
TDD for Microservices
TDD for MicroservicesTDD for Microservices
TDD for Microservices
VMware Tanzu
 
VMworld 2013: The Economics of vCloud: Which Cloud Do I Need and How Do I Get...
VMworld 2013: The Economics of vCloud: Which Cloud Do I Need and How Do I Get...VMworld 2013: The Economics of vCloud: Which Cloud Do I Need and How Do I Get...
VMworld 2013: The Economics of vCloud: Which Cloud Do I Need and How Do I Get...
VMworld
 
IBM Blockchain Platform - Architectural Good Practices v1.0
IBM Blockchain Platform - Architectural Good Practices v1.0IBM Blockchain Platform - Architectural Good Practices v1.0
IBM Blockchain Platform - Architectural Good Practices v1.0
Matt Lucas
 

Similar to Business Transactions in Distributed Systems (20)

Deploying large-scale, serverless and asynchronous systems - without integrat...
Deploying large-scale, serverless and asynchronous systems - without integrat...Deploying large-scale, serverless and asynchronous systems - without integrat...
Deploying large-scale, serverless and asynchronous systems - without integrat...
 
Agile Software Architecture
Agile Software ArchitectureAgile Software Architecture
Agile Software Architecture
 
Serverless Design Patterns (London Dev Community)
Serverless Design Patterns (London Dev Community)Serverless Design Patterns (London Dev Community)
Serverless Design Patterns (London Dev Community)
 
Rapid Solutions with Salesforce Flows
Rapid Solutions with Salesforce FlowsRapid Solutions with Salesforce Flows
Rapid Solutions with Salesforce Flows
 
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
 
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
 
Cqrs journey guide
Cqrs journey guideCqrs journey guide
Cqrs journey guide
 
My Dad Won't Buy Me DevOps
My Dad Won't Buy Me DevOpsMy Dad Won't Buy Me DevOps
My Dad Won't Buy Me DevOps
 
Microdeployments for microservices dev ops nashville
Microdeployments for microservices   dev ops nashvilleMicrodeployments for microservices   dev ops nashville
Microdeployments for microservices dev ops nashville
 
9X5u87KWa267pP7aGX3K
9X5u87KWa267pP7aGX3K9X5u87KWa267pP7aGX3K
9X5u87KWa267pP7aGX3K
 
AZ900-AzureFundamentals-part-5.pdf
AZ900-AzureFundamentals-part-5.pdfAZ900-AzureFundamentals-part-5.pdf
AZ900-AzureFundamentals-part-5.pdf
 
State of DevOps - Build the Thing Right
State of DevOps - Build the Thing RightState of DevOps - Build the Thing Right
State of DevOps - Build the Thing Right
 
Re-Architecting a Banking Application for Scale and Reliability (SRV220-R1) -...
Re-Architecting a Banking Application for Scale and Reliability (SRV220-R1) -...Re-Architecting a Banking Application for Scale and Reliability (SRV220-R1) -...
Re-Architecting a Banking Application for Scale and Reliability (SRV220-R1) -...
 
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
 
Microservices: Organizing Large Teams for Rapid Delivery
Microservices: Organizing Large Teams for Rapid DeliveryMicroservices: Organizing Large Teams for Rapid Delivery
Microservices: Organizing Large Teams for Rapid Delivery
 
Low-Latency Data Processing in the Era of Serverless @XP Days
Low-Latency Data Processing in the Era of Serverless @XP DaysLow-Latency Data Processing in the Era of Serverless @XP Days
Low-Latency Data Processing in the Era of Serverless @XP Days
 
Microservices Antipatterns
Microservices AntipatternsMicroservices Antipatterns
Microservices Antipatterns
 
TDD for Microservices
TDD for MicroservicesTDD for Microservices
TDD for Microservices
 
VMworld 2013: The Economics of vCloud: Which Cloud Do I Need and How Do I Get...
VMworld 2013: The Economics of vCloud: Which Cloud Do I Need and How Do I Get...VMworld 2013: The Economics of vCloud: Which Cloud Do I Need and How Do I Get...
VMworld 2013: The Economics of vCloud: Which Cloud Do I Need and How Do I Get...
 
IBM Blockchain Platform - Architectural Good Practices v1.0
IBM Blockchain Platform - Architectural Good Practices v1.0IBM Blockchain Platform - Architectural Good Practices v1.0
IBM Blockchain Platform - Architectural Good Practices v1.0
 

Recently uploaded

Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 

Recently uploaded (20)

Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 

Business Transactions in Distributed Systems

Editor's Notes

  1. Test length: רגע לפני שמסכמים, אין לנו הרבה זמן, אז חשוב לי רק לציין את הדברים הבאים. כפי שאמרנו תמיד סביב בניית תרבות ענן, אז בMC זה יותר (יותר vendors) וגם יותר קריטי *כל הקשור לCloudOps – DevOps, SecOps, FinOps *בנוסף, לדאוג למתודולוגיה, סטנדרטיים ארכיטקטוניים, ולהשקיע בכלים שיתמכו *אוטומציה – workflows (oam) / control plane – איך להעביר, איך לדעת מה נמצא *מוניטורינג – cost בעיקר *אם צריכים עזרה, תשיגו עזרה ...אז כן..
  2. שלום לכולם, ברוכים הבאים להרצאה שלי על Dealing with Csy in Distributed Systems אני יודע..
  3. לאחר האוכל לנמנם נושא טכני במהותו -- כולנו לאחר האוכל לנמנם תחת כיפת השמיים והנה אנחנו כאן בהרצאה סביב נושא מאוד טכני במהותו ניקח נשימה ויאללה נתחיל
  4. חנות ספרים Eg: fancy books / book store Decades ago --- Let's say we're a book store company Fancy Books!
  5. לפני הרבה שנים BE Monolith, DB, Clients SubmitOrder, Flow --- Touch the same db, and only that Db with high gtees of cy + tx Consistent – either happens or not
  6. קוד – דברים בTX מול data-store אחד Strong & immediate, ACID --- Code – order, payment, shipping, inventory IN TX SC GTEES, ACID --- Touch the same db, and only that Db with high gtees of cy + tx Consistent – either happens or not
  7. קוד – דברים בTX מול data-store אחד Strong & immediate, ACID לא צריך לדאוג לסנכרון במקרה של עותק אחד --- Code – order, payment, shipping, inventory IN TX SC GTEES, ACID --- Touch the same db, and only that Db with high gtees of cy + tx Consistent – either happens or not
  8. כמה שנים קדימה משנים לארכיטקטורה מבוזרת Eg: fancy books / book store Decades ago --- Let's say we're a book store company Fancy Books!
  9. משנים לארכיטקטורה מבוזרת כמה שירותים רגע, אבל מה עושים עכשיו מבחינת Csy? מה יהיה מצב הState במערכת במקרה של כשלון או קריאות במקביל? על זה אנחנו הולכים לדבר --- Concerns This is what we’ll talk about today Not just distributed BTW No ambient tx (layers, technical/domain) two stores/sources (e.g., sms notification) Db with weak gtees, no ACID support
  10. Senior software architect, instructor, speaker and developer Over 20 years of experience in the field Designed and developed various systems, both backend and frontend Mentored and lead large teams and R&D divisions Publications, e.g. Book: HandsOn Full-Stack Web Development with ASP.NET Core Open source: WCF Contrib WCF Microsoft Official Curriculum (MOC) Head of Web and Mobile at CodeValue
  11. נגדיר את עולם הבעיה איך ניתן לגשת לזה, נגע בImmediate וEventual נסקור patterns שמאפשרים להתמודד, נתמקד בDistributed Sagas נסיים בConsistency as a Feature אז בואו נתחיל ---
  12. בואו נסכם, key takeaways
  13. מושג נרחב בעל פרושים רבים בDb sys – נכון, תקין, מדויק – עונה על החוקים סביב Data Cons – התמודדות עם מקרים של מספר nodes וכיצד מסנכרנים SW Eng – כאן נתמקד, מדבר על כך שהState בכלל המערכת נכון ותקין Distributed or not --- Correct – FKs, constraints, etc. not violated, Applies to the rules Sound – accurate, correct, State across the system is aligned (generally ) The stronger consistency – better isolation, safety and accuracy Go to payment – here Go to order – NA Inconsistent state – not sound, LO TAKIN Lack of consistency In database systems, consistency (or correctness) refers to the requirement that any given database transaction must change affected data only in allowed ways. Any data written to the database must be valid according to all defined rules, including constraints, cascades, triggers, and any combination thereof. This does not guarantee correctness of the transaction in all ways the application programmer might have wanted (that is the responsibility of application-level code) but merely that any programming errors cannot result in the violation of any defined database constraints
  14. Csy הולך יד-ביד עם Reliability עולם נרחב יש לנו 20 דקות מתמקדים בBuiz Tx אז אנחנו מדברים על Distributed Buiz Flows... --- Many aspects Focus on buiz tx Let’s talk about data csy for a sec In the heart of our system, where we keep the state – the data stores
  15. אז אנחנו מדברים על Distributed Buiz Flows Buiz Tx יכול להתפרס על Flow בין כמה שירותים Distributed systems.. אז במקרה הזה מעורב network.. ובמובן הזה.. --- Go to payment – here Go to order – NA Inconsistent state – not sound, LO TAKIN Lack of consistency In database systems, consistency (or correctness) refers to the requirement that any given database transaction must change affected data only in allowed ways. Any data written to the database must be valid according to all defined rules, including constraints, cascades, triggers, and any combination thereof. This does not guarantee correctness of the transaction in all ways the application programmer might have wanted (that is the responsibility of application-level code) but merely that any programming errors cannot result in the violation of any defined database constraints
  16. מי שזוכר Fallacies of distributed computing לא נכנס לכל זה כרגע, אבל העיקר שרלוונטי לקונטקסט שלנו Network הוא לא reliable Latency הוא לא אפסי ובמקרים האלה, טיפול בCsy הופך להרבה יותר קשה אז עולה השאלה.. --- Fallacies of distributed computing Network is reliable Latency is zero Consistency is now much more difficult
  17. האם to distribute or not? אני מעוניין להדגיש את הנקודה הזו זו אחת התהיות שאנחנו כארכיטקטים מתלבטים רבות עליה זה נוגע בService Granularity וכיצד אנו מבצעים את הSystem decomposition Csy זה אחד הכוחות החזקים שמובילים לשילוב/לשלב קומפוננטות איפה שאנחנו צריכים Strong Csy – אולי לא נלך על Distributed אז בואו נדבר על מתי כן נחליט To distribute.. --- 2 button meme – distribute or not One of the main criticism towards micro/nano-services Can be the go-to, but it should be justified, especially where you need strong csy gtees Again, not only a trait of distribution Service granularity Even in the same process boundary, is there an ambient tx E.g., modular monolith Technical - Perhaps different stores, etc.
  18. אז בואו נדבר על מתי כן נחליט To distribute.. טבע האפליקציה היבטים ארגוניים מבנה, כיצד מתבצעת התקשורת פוליטיקות ארגוניות צרכים טכניים Scale, Redundancy, Availability, Fault tolerance, Polyglot מזוכיזם אז החלטנו to distribute.. --- Conway's law is an adage that states organizations design systems that mirror their own communication structure
  19. אז החלטנו to distribute Fancy books רוצה עדיין את אותה התנהגות מבחינת Csy Strong & immediate, ACID אז בואו נסביר רגע מה זה ACID.. --- So we want to distribute! How can we achieve strong csy like before then?
  20. Atomic, Consistent, Isolated, Durable מאפשר Strong & immediate הכל מצליח או מתבטל הData נשאר נכון אין אפקטים על טרנזקציות וclients אחרים Persisted אז עולה השאלה.. --- safe data environment, immediate consistency and data accuracy --- Atomic All or nothing Consistent Foreign keys & constraints Isolated From other transactions Durable Remains committed even in case of system failure Provide linearizability for single-machine --- Atomic – All operations in a transaction succeed or every operation is rolled back Consistent – On the completion of a transaction, the database is structurally sound Isolated – Transactions do not contend with one another. Contentious access to data is moderated by the database so that transactions appear to run sequentially Durable – The results of applying a transaction are permanent, even in the presence of failures Once a transaction is complete, its data is consistent (write consistency) and stable on disk Write consistency is great for developers, but it also requires sophisticated locking which is typically a heavyweight pattern for most use cases “Always consistent” doesn’t scale well and is less highly available as BASE
  21. אז עולה השאלה האם ניתן לעשות ACID בDistributed Flows --- Atomic All or nothing Consistent Foreign keys & constraints Isolated From other transactions Durable Remains committed even in case of system failure Provide linearizability for single-machine --- Atomic – All operations in a transaction succeed or every operation is rolled back Consistent – On the completion of a transaction, the database is structurally sound Isolated – Transactions do not contend with one another. Contentious access to data is moderated by the database so that transactions appear to run sequentially Durable – The results of applying a transaction are permanent, even in the presence of failures Once a transaction is complete, its data is consistent (write consistency) and stable on disk Write consistency is great for developers, but it also requires sophisticated locking which is typically a heavyweight pattern for most use cases “Always consistent” doesn’t scale well and is less highly available as BASE
  22. Tx boundary Compensatiing transactions don’t always work Return an error – “Inconsistent here, sorry”
  23. Tx boundary Compensatiing transactions don’t always work Return an error – “Inconsistent here, sorry”
  24. Happy flow During – isolation (in all services) Means we need to know when business tx ends It gets more complicated in case of errors
  25. Error flow זה נראה פשוט ושהשגנו את המטרה.. אבל מה קורה אם יש שגיאות רציניות יותר השירותים נופלים ולא זמינים Compensating tx נכשל השירות הראשון המרכזי – אם הוא לא זמין, מה קורה עם כל התהליך ומה עושים עם התשובה שאמורים להחזיר לקליינט? כל זה יכול להוביל אותנו למצבים שנגיד.. --- --- This actually ends in a consistent manner, but.. What happens if the compensating tx fails What happens if the orchestrator crashes That orchestrator – what is it? Robust coordinator/app service? Needs to be reliable, fault tolerant, persistent
  26. המערכת סגורה כרגע, אנחנו צריכים לטפל בבעיות, תחזרו אח"כ אז.. ---
  27. ACID in Distributed Systems – בעייתי מתחיל בכוונות טובות זה מאוד קשה ומורכב יש patterns שבאים לעזור – 2PC, 3PC, others אבל הם לא באמת משנים את טבע הבעיה אין silver bullet זה לא פוגש את הציפיות של היום יוזרים מצפים למערכות always available ומהירות latency נמוך מי שמכיר, קשור לCAP Theorem, אבל זה מחוץ לסקופ שלנו היום רוצים reliable distributed flows צריכים משהו אחר מה שמביא אותנו לEventual Csy אז מה זה.. --- Expectations – favor availability and reduced latency, high paced auto releases Covering all edge cases is REALLY complex 2PC / 3PC too for that matter Perhaps if you go with extreme locking and compromise availability (still complex) Going distributed requires a different consistency model ACID is just not natural here Eventual Consistency
  28. אז מה זה.. ההפך מImmediate עקרון פשוט, כל עוד אין עדכונים על data item, בסופו של עניין המערכת תחזיר את אותו ערך המערכת מתמזגת בסופו של עניין, eventually Gtees חלשים, רק liveness, אם רוצים לעשות reads/writes אנחנו פה בשבילכם, אבל לא מבטיחים שום דבר מעבר כדי להמחיש מה זה EC.. --- System will eventually converge Eventual consistency is sometimes criticized[8] as increasing the complexity of distributed software applications. This is partly because eventual consistency is purely a liveness guarantee (reads eventually return the same value) and does not guarantee safety: an eventually consistent system can return any value before it converges. An eventual consistency[4] is a weak consistency model in the system with the lack of simultaneous updates. It defines that if no update takes a very long time, all replicas eventually become consistent. Most shared decentralized databases have an eventual consistency model, either BASE: basically available; soft state; eventually consistent, or a combination of ACID and BASE sometimes called SALT: sequential; agreed; ledgered; tamper-resistant, and also symmetric; admin-free; ledgered; and time-consensual.[19][20][21]
  29. - החיים הם Eventually consistent Sun – 8min Talk tx אוקיי, אז אם החיים הם ככה, בואו ניקח את זה לעולם שלנו אז כיצד.. --- Look at us talking right now – a buiz tx No “commit”, you’ll compensate – raise your voice, repeat, etc. So we want to achieve reliable Schedule meeting while offline Cart – is it really available? So, it’s not only engineering It’s about the “product” too
  30. * אז כיצד אנחנו יכולים להשיג.. * אנחנו נתמקד בpatterns סביב Distributed Sagas
  31. אז מה זה Distributed Sagas? אמרנו שDistributed Flow מתפרס על כמה שירותים אז סגה היא בעצם סידרה של local tx שחל בתוך כל שירות כחלק מהתהליך של הBuiz Tx טיפול בשגיאות נעשה באמצעות Compensating tx Coordinated באמצעות Orc/Chor הרבה implementations – patterns, פלטפורמות, טכנולוגיות אנחנו נסקור כרגע שני patterns הכי פופולריים אז הראשון.. Many implementations: - Patterns and Technology – platforms and services A series of local transactions Application-level transaction pattern Let’s focus on 2 popular ones --- Orchestration Pros Improves understandability and observability Business flow is centrally managed in one service Changes and bug fixes in the existing business flow is done in one service Easier to design and implement than choreography (next slide) Cons Increases coupling with underlying services Order might need to know about payment, inventory, notification, etc. Adding new services that are part of the business flow affects the orchestrator too Choreography Pros Business flow is not tightly coupled in a single service operation Adding new services that are part of the business flow doesn’t require integration and changes to other services Cons Business flow spans multiple services which makes it harder to understand and track Changes to the existing business-flow is usually done in multiple services Harder to design and implement than Orchestration
  32. Happy Flow
  33. Error Flow
  34. Happy Flow
  35. Error Flow
  36. Break – orchestrator fails, service crashes, compensating tx fails, etc. What happens during? No gty (weak, not atomic nor isolated)
  37. Break – orchestrator fails, service crashes, compensating tx fails, etc. What happens during? No gty (weak, not atomic nor isolated)
  38. Break – orchestrator fails, service crashes, compensating tx fails, etc. אם אנחנו צריכים משהו robust יותר, נצטרך לשקול דברים נוספים. גם כאן, יש מגוון רחב, נציין כרגע 3 דברים, לא נכנס יותר מדי לפרטים בחלק הזה, חשוב לי שנגע בזה על מנת שתכירו.. ---- Break – orchestrator fails, service crashes, compensating tx fails, etc. Use relevant tech and tools to counter and improve reliability This is the part that we’re just going to highlight.. Not cover
  39. משתמשים בmessage broker מאפשר.. Persistence Retries Idempotency הרצה חוזרת של פעולה מביאה את המערכת לאותו מצבState/, כאילו הרצנו פעם אחת Concurrency/Ordered – מה שרצוי במקרה שלכם Relevance DLQ – היכולת להעביר לתור אחר אם זה לא רלוונטי או שלא ניתן לטפל בהודעה כרגע Loose – בדגש על חיבוריות וזמינות אז AM מביא איתו הרבה דברים טובים בנוסף, אפשר לשקול טכנולוגיות סביב Persisted Workflows.. --- https://en.wikipedia.org/wiki/Idempotence Concurrency – ordered, resource-level causality, consistent hashing, etc. No async msgs? Still doing such in some way. Need something to enable that and provide more control and powerful saga coordination options? (next slides) --- DLQ – How do we know something is there? What should we be able to do about it? Retrieve/View/Replay/etc. Monitoring, alerts Human in the loop, etc. --- Instead of performing synchronous calls to the PaymentService and ShippingService within the OrderService, you can use asynchronous messaging techniques such as message queues or event-driven architectures. By decoupling services through messaging, you can ensure that each service processes its part of the transaction independently and can handle failures and retries gracefully.
  40. משתמשים בmessage broker מאפשר.. Persistence Retries Idempotency הרצה חוזרת של פעולה מביאה את המערכת לאותו מצבState/, כאילו הרצנו פעם אחת Concurrency/Ordered – מה שרצוי במקרה שלכם Relevance DLQ – היכולת להעביר לתור אחר אם זה לא רלוונטי או שלא ניתן לטפל בהודעה כרגע Loose – בדגש על חיבוריות וזמינות אז AM מביא איתו הרבה דברים טובים בנוסף, אפשר לשקול טכנולוגיות סביב Persisted Workflows.. --- https://en.wikipedia.org/wiki/Idempotence Concurrency – ordered, resource-level causality, consistent hashing, etc. No async msgs? Still doing such in some way. Need something to enable that and provide more control and powerful saga coordination options? (next slides) --- DLQ – How do we know something is there? What should we be able to do about it? Retrieve/View/Replay/etc. Monitoring, alerts Human in the loop, etc. --- Instead of performing synchronous calls to the PaymentService and ShippingService within the OrderService, you can use asynchronous messaging techniques such as message queues or event-driven architectures. By decoupling services through messaging, you can ensure that each service processes its part of the transaction independently and can handle failures and retries gracefully.
  41. בנוסף, אפשר לשקול טכנולוגיות סביב Persisted Workflows.. אנחנו רואים כאן דוגמה לשימוש בסרברלס, Durable functions באזור, AWS Step Funcs מי שמכיר זה מאפשר לממש Workflows על גבי Sls, שינוי של state יכול להניע את הWF בין step לstep חשוב לי רק שתכירו, שוב, לא נכנס לזה יותר מדי נכנס request ובצעם מתחיל סגה חדשה כDurable function הDS מפעיל Activities לפי הState שהוא נמצא במקרה שלנו נניח לPayment הPayment מבצע את העבודה ומחזיר תשובה דרך Reply Q (EH) זה מגיע לפונקציה שמשנה את הState של הOrchestrator שלנו שמבצע את הפעולות הבאות הState נשמר, אפשר גם לתשאל אותו כל Activity יכול להסתיים בסטטוס של כשלון, מה שיכול לגרום להפעלה של Activity סביב Compensating tx שימו לב, זה בעצם מימוש של הפטרן הראשון שראינו – Orchestrator & Commands עוד פטרן שחשוב לי שתכירו.. --- Azure durable functions, AWS Step functions, Azure Logic Apps, etc. https://github.com/Azure-Samples/saga-orchestration-serverless
  42. פטרן מאוד רלוונטי בנושא שלנו Distributed Sagas יש לנו את הScheduler אחראי לביצוע הפעולות שמקדמות את הסגות באמצעות agents שהם בעצם מבצעים את הפעולה אל מול הtarget resources/servics יש לנו את הState store Durable וFault tolerant יש לנו את הSupervisor מנתר את התהליך, מבין את הסטטוס של הסגות ומבקש מהScheduler לבצע פעולות בהתאם יכול להיות הפעולות הרגילות או הcompensating tx --- https://learn.microsoft.com/en-us/azure/architecture/patterns/scheduler-agent-supervisor A smart engine for a saga coordinator Pushes through failures Drives sagas to completion
  43. Difficult, complex All failure cases Use tech and tools - Fault injection, in many levels, automate, consider prod too
  44. נעשה מעבר חד שכזה עד עכשיו דיברנו על Csy במונחים של engineering אבל consistency לא מתחיל ונגמר בengineering וזה מושפע מ.. ומשפיע על עולם הפרודקט אז בואו נדבר על.. --- BTW, Consistency doesn’t start and end in engineering Which brings us to the last section.. Behavior is formed from It can leak to the product as well
  45. הציפיות שלנו כיוזרים נגזרות מהפרודקט וה-UX/UI קחו לדוגמא דלת ומפתח – Low-level, strong & immediate לעומת זאת, קורא טביעות אצבע – מבינים שמדובר במערכת ופעולות אסינכרוניות עדיין, הפרודקט נותן חיווי עבור הFlow השלם, הDistributed יכול להיות שזה מעצבן, שנצטרך להניח כמה פעמים את האצבע, אבל לפחות מוצג לנו כיוזרים מה הסטטוס, ומבחינתנו זה מקובל, גם אם יש כשלון ברמת "הטרנזקציה" אז הפרודקט והUX קובע את הציפיות ומשפיע על התפיסה שלנו.. --- Take unlocking a car as an example Key – immediate consistency expectations fingers – async, eventual Expected by the customer, Satisfaction is high, trust is preserved, no bugs Additional feedback/que – sound, etc. – needed, sets expectations So.. Product and UX/UI is important --- Photo: car open with fingers vs. key Key: expect strong consistency Fingers: can fail, will reposition fingers But.. Once there’s the “sound” – I expect it to work! Otherwise – a bug
  46. Quality - Bugs and support If you went to Amazon Placed order, received SMS that payment was done You go to the orders screen – it is NOT there MS QnA – Edit question, old text is shown, editing shows the new text -> confirmation message can go a long way Confirmation – not make it a bug (in customer’s eyes --- Product expects the system to just work As they should Engineers need to follow Impossible to build bullet-proof systems Accept the imperfection What is acceptable in terms of product, determine together Analyze what must happen before ok WITH product E.g., post message Running moderation rules can take a while, let’s do it async Can affect product Can affect system behavior – reshape the business tx, simplify it
  47. אז הפרודקט והUX קובע את הציפיות ומשפיע על התפיסה שלנו מה ייתפס כבאג או כהתנהגות מקובלת של המוצר חשוב.. מקרין על הQuality, ומשפיע על הCustomer trust and satisfaction לשתף את הפרודקט Negotiation – תהליך איטרטיבי, אחד משפיע על השני ו-vice versa הרבה פעמים קורה שמפתחים את הFunctional Requirements בhappy flow ואומרים שזה EC.. תחת הרעיון שEC.. CLICK --- דוגמא של אמזון.. הרבה פעמים קורה שמפתחים את הFunctional Requirements בhappy flow ואומרים שזה EC.. CLICK תחת הרעיון שEC --- Quality - Bugs and support If you went to Amazon Placed order, received SMS that payment was done You go to the orders screen – it is NOT there MS QnA – Edit question, old text is shown, editing shows the new text -> confirmation message can go a long way Confirmation – not make it a bug (in customer’s eyes --- Product expects the system to just work As they should Engineers need to follow Impossible to build bullet-proof systems Accept the imperfection What is acceptable in terms of product, determine together Analyze what must happen before ok WITH product E.g., post message Running moderation rules can take a while, let’s do it async Can affect product Can affect system behavior – reshape the business tx, simplify it
  48. תחת הרעיון שEC זה הInconsistent החדש.. CLICK אז זה לא בדיוק כך דוגמה של אמזון (BAD) – יש תשלום אבל לא רואים הזמנה ללא שום פידבק אז חשוב לערב את הפרודקט כי ניתן לבצע mitigations ברמת המוצר.. CLICK
  49. כי ניתן לבצע mitigations ברמת המוצר.. לכתוב הודעת confirmation שקרה/יקרה משהו ללכת רחוק יותר ולתת pane של tasks עם סטטוס, progress וכדומה וכמובן לזהות כשיש בעיה ולתת פידבק מתאים זו הודעה של אמזון שמתחברת לדוגמה שאמרנו מקודם.. אז, חשוב, ביססנו את זה.. יחד עם הפרודקט תוכלו להגדיר אילו consistency gtees אתה צריכים תקחו בחשבון את הדברים הבאים CLICK --- Generally, User expects strong consistency in “immediate” actions User accepts weak consistency when async process is apparent E.g., Amazon – Order lifecyle Azure Portal provisioning status, etc. User expectations is driven by UX/UI Get product on board, explain, negotiate Compromise where is appropriate to your product Product expects the system to just work As they should --- Can show lifecycle of order as originally suggested by product Starts with “Order Placed and Paid For” Negotiate with product Payment is an external system, can’t sync, takes time Product changes Order Placed  Order Paid Show diagrams, how now it payment is posted to a queue, more reliable Allows extracting things to a separate business transaction Ease on the entire complexity Might still need some type of coordination – can lead to the fairy tale saga Can still reduce coupling and complexity
  50. תקחו בחשבון את הדברים הבאים Immediate אח"כ (eventual) Happy path מקביל איזו רמה של דיוק ושליטה אתם צריכים גבולות גזרה.. --- This will help you determine boundaries (גבולות גזרה), both in terms of Service granularity and how you decompose the system Buiz tx boundaries ---- Where you need fine control or more flexible one Will help you determine what solution to build Then define: Order and dependencies Business transaction boundaries Required consistency guarantees Accurate control vs. Flexible (orchestration vs. choreography) Then, can approach to implementing the (reliable) distributed business tx --- Can show lifecycle of order as originally suggested by product Starts with “Order Placed and Paid For” Negotiate with product Payment is an external system, can’t sync, takes time Product changes Order Placed  Order Paid Show diagrams, how now it payment is posted to a queue, more reliable Allows extracting things to a separate business transaction Ease on the entire complexity Might still need some type of coordination – can lead to the fairy tale saga Can still reduce coupling and complexity
  51. גבולות גזרה.. Service Granularity ואיך לשבור את המערכת כפי שדיברנו וגם לקבוע את גבולות הBuiz Tx אוקיי.. אז בואו נסכם --- This will help you determine boundaries (גבולות גזרה), both in terms of Service granularity and how you decompose the system Buiz tx boundaries ---- Where you need fine control or more flexible one Will help you determine what solution to build Then define: Order and dependencies Business transaction boundaries Required consistency guarantees Accurate control vs. Flexible (orchestration vs. choreography) Then, can approach to implementing the (reliable) distributed business tx --- Can show lifecycle of order as originally suggested by product Starts with “Order Placed and Paid For” Negotiate with product Payment is an external system, can’t sync, takes time Product changes Order Placed  Order Paid Show diagrams, how now it payment is posted to a queue, more reliable Allows extracting things to a separate business transaction Ease on the entire complexity Might still need some type of coordination – can lead to the fairy tale saga Can still reduce coupling and complexity
  52. בואו נסכם, key takeaways
  53. Design Csy gtees Tx boundaries Product Realization & negotiation Distribute or not, choice Granularity, csy force Test Technical Consistent as needed
  54. Alright, that's a wrap! Next, resources!
  55. לינקים זמן לשאלות?