SlideShare a Scribd company logo
© 2018 Magento, An Adobe Company Page | 1
A long way from
Monolith to Micro-
Service Architecture
Yesterday, Today and Tomorrow
© 2018 Magento, An Adobe Company Page | 2
Igor Miniailo
Magento Architect,
Community Engineering Team
© 2018 Magento, An Adobe Company Page | 3
Agenda
© 2018 Magento, An Adobe Company Page | 3
• Magento 1. Big ball of Mud
• SOLID and Single Responsibility
• Performance vs Scalability
• Coupling vs Cohesion
• Bounded contexts and their Boundaries
• CAP Theorem
• ACID vs BASE
• Modularity as a first step towards micro-services
• Headless Magento
• Service Isolation (Code and DB split)
• Conway's law
• Microservice architecture
© 2018 Magento, An Adobe Company Page | 4© 2018 Magento, An Adobe Company Page | 4
Magento 1
And all the legacy we got starting Magento 2 development
© 2018 Magento, An Adobe Company Page | 5
Classical N-layered architecture
• Compromise in the design of Data Model
• Not possible to scale separately Read out of
Write operations
• Tend to Anemic Data Model
• Tend to Monolithic Architecture
• An application has to be deployed as a
whole
• An application has to be scaled as a
whole
© 2018 Magento, An Adobe Company Page | 6
Big Ball of Mud
Even though a modular code
structure groups related behavior, it
is easy to introduce an undesired
dependency between application
services, because services are not
deployed and tested independently.
© 2018 Magento, An Adobe Company Page | 7
SOLID comes to rescue
© 2018 Magento, An Adobe Company Page | 8© 2018 Magento, An Adobe Company Page | 8
Modularity as a first step towards
micro-services
© 2018 Magento, An Adobe Company Page | 9
• Every sophisticated business
domain consists of a bunch of
Bounded Contexts
• Each Bounded Context
contains models and maybe
other contexts
• The Bounded Context is also a
boundary for the meaning of a
given model
Bounded Context
© 2018 Magento, An Adobe Company Page | 10
Bounded Context
© 2018 Magento, An Adobe Company Page | 11
© 2018 Magento, An Adobe Company Page | 12
CAP Theorem
States that it is impossible for a distributed
data store to simultaneously provide more
than two out of the following three
guarantees:
• Consistency: Every read receives the
most recent write or an error
• Availability: Every request receives a
(non-error) response – without the
guarantee that it contains the most
recent write
• Partition tolerance: The system
continues to operate despite an arbitrary
number of messages being dropped (or
delayed) by the network between nodes
© 2018 Magento, An Adobe Company Page | 13
Asynchronous processing
http://www.enterpriseintegrationpatterns.com/docs/IEEE_Software_Design_2PC.pdf
© 2018 Magento, An Adobe Company Page | 14
Conversation pattern
The interaction between two parties
(customer and coffee shop)
consists of:
• a short synchronous interaction (ordering
and paying)
• and a longer, asynchronous interaction
(making and receiving the drink)
This type of conversation pattern is quite
common in purchasing scenarios.
© 2018 Magento, An Adobe Company Page | 15
Error-handling strategies for loosely coupled systems
(a) Write-off
(b) Retry
(c) Compensating action
(d) Transaction coordinator (two phase commit)
© 2018 Magento, An Adobe Company Page | 16
Implement business transaction that spans multiple
services as a saga
A saga is a sequence of local
transactions
Each local transaction updates
the database and publishes a
message or event to trigger the
next local transaction in the
saga
© 2018 Magento, An Adobe Company Page | 17
Event Sourcing
© 2018 Magento, An Adobe Company Page | 18
*The property of certain operations whereby they can be
applied multiple times without changing the result beyond
the initial application.
Idempotence of operation and at-least-once delivery
Network communication is unreliable.
Retries will be required, and some
messages will be delivered more than
once
© 2018 Magento, An Adobe Company Page | 19
• All operations MUST BE idempotent.
• Sagas SHOULD BE used for consistency of
distributed operations
• All new service contracts SHOULD expose
asynchronous APIs
• All new state modifying operations SHOULD expose
bulk APIs
• All service operations MUST BE stateless
• There MUST BE NO data dependencies between
services
Design Principles to follow
© 2018 Magento, An Adobe Company Page | 20
• Every module defines its APIs (service contracts),
which are PHP interfaces that can be called either
from within a PHP process or remotely through
REST, SOAP or AMQP APIs.
• Every module can call other modules only through
their service contracts.
Service Layer
© 2018 Magento, An Adobe Company Page | 21
Service Layer. Current State
Legacy undesired
dependencies direct
inter-module
- model-to-model
- presentation-to-model
still exist.
© 2018 Magento, An Adobe Company Page | 22
Modules split
© 2018 Magento, An Adobe Company Page | 23
Modules Split. Inventory
• API – service contracts and
extension points
• Implementation (private) -
should not be called directly
from other modules
• Admin UI
• Frontend UI
© 2018 Magento, An Adobe Company Page | 24
Headless Multi-Source Inventory
UI modules are removable if merchant
wants to use external ERP system as a
source of truth where he will manage
inventory
© 2018 Magento, An Adobe Company Page | 25
Desirable State
© 2018 Magento, An Adobe Company Page | 26
Database Split
A service must not talk to other service
database directly, only through service
contracts
TODO:
- Minimize data relations
- Replace the required inter-service db-
level data relations, joins, and transactions
with application-level relations, joins, and
transactions
© 2018 Magento, An Adobe Company Page | 27
Desirable state
Isolated ServicesMonolith
© 2018 Magento, An Adobe Company Page | 28
Monoliths vs Microservices. Scalability
© 2018 Magento, An Adobe Company Page | 29
© 2018 Magento, An Adobe Company Page | 30
Conway’s Law
Any organization that designs a system
(defined broadly) will produce a design
whose structure is a copy of the
organization's communication structure.
-- Melvyn Conway, 1967
© 2018 Magento, An Adobe Company Page | 31
2.3 Stage #1 Stage #2 Stage #3 Stage #4 Stage #5
Inventory (MSI) App Framework Order Management CMS Shipping Marketing
Pricing Tax Reports Promotions Risk
Checkout Customer Payments Wishlist
Rewards
Company
Service decomposition
© 2018 Magento, An Adobe Company Page | 32
• Magento Service Isolation Design Document by
Anton Kril
• Magento administrative tool
• Magento MSI
Useful Links
© 2018 Magento, An Adobe Company Page | 33
Q&AFollow me in Twitter
@iminyaylo
© 2018 Magento, An Adobe Company Page | 34
Thank You
© 2018 Magento, An Adobe Company Page | 34

More Related Content

What's hot

Magento Storefront architecture
Magento Storefront architectureMagento Storefront architecture
Magento Storefront architecture
Igor Miniailo
 
Magento Multi-Source Inventory (MSI)
Magento Multi-Source Inventory (MSI)Magento Multi-Source Inventory (MSI)
Magento Multi-Source Inventory (MSI)
Igor Miniailo
 
Awesome architectures in Magento 2.3
Awesome architectures in Magento 2.3Awesome architectures in Magento 2.3
Awesome architectures in Magento 2.3
Alessandro Ronchi
 
Architecture and workflow of Multi-Source Inventory
Architecture and workflow of Multi-Source InventoryArchitecture and workflow of Multi-Source Inventory
Architecture and workflow of Multi-Source Inventory
Igor Miniailo
 
Backwards Compatibility Developers Guide. #MM17NL
Backwards Compatibility Developers Guide. #MM17NLBackwards Compatibility Developers Guide. #MM17NL
Backwards Compatibility Developers Guide. #MM17NL
Igor Miniailo
 
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Igor Miniailo
 
Dare to Share Magento Community Engineering
Dare to Share Magento Community Engineering Dare to Share Magento Community Engineering
Dare to Share Magento Community Engineering
Igor Miniailo
 
Testing in Magento 2
Testing in Magento 2 Testing in Magento 2
Testing in Magento 2
Igor Miniailo
 
Mli 2017 technical m2 developer experience
Mli 2017 technical m2 developer experienceMli 2017 technical m2 developer experience
Mli 2017 technical m2 developer experience
Hanoi MagentoMeetup
 
Extending Magento's Capabilities to Increase Efficiency and Accelerate Growth
Extending Magento's Capabilities to Increase Efficiency and Accelerate GrowthExtending Magento's Capabilities to Increase Efficiency and Accelerate Growth
Extending Magento's Capabilities to Increase Efficiency and Accelerate Growth
APPSeCONNECT
 
Medior Software Engineer (C #,. Net) Bizz Talk 2006 Groningen
Medior Software Engineer (C #,. Net)   Bizz Talk 2006    GroningenMedior Software Engineer (C #,. Net)   Bizz Talk 2006    Groningen
Medior Software Engineer (C #,. Net) Bizz Talk 2006 Groningenchalikars
 
xbim Flex: taking the xbim toolkit into the cloud
xbim Flex: taking the xbim toolkit into the cloudxbim Flex: taking the xbim toolkit into the cloud
xbim Flex: taking the xbim toolkit into the cloud
Andy Ward
 
Magento Technical guidelines
Magento Technical guidelinesMagento Technical guidelines
Magento Technical guidelines
Elogic Magento Development
 
Platform introduction
Platform introductionPlatform introduction
Platform introduction
salpal
 
The LeanIX Microservices Integration
The LeanIX Microservices IntegrationThe LeanIX Microservices Integration
The LeanIX Microservices Integration
LeanIX GmbH
 
Innovative API-Based LeanIX Enhancements
Innovative API-Based LeanIX EnhancementsInnovative API-Based LeanIX Enhancements
Innovative API-Based LeanIX Enhancements
LeanIX GmbH
 
Practical thoughts for cloud transformation
Practical thoughts for cloud transformationPractical thoughts for cloud transformation
Practical thoughts for cloud transformation
Mark Osborn
 
Automate and simplify multi cloud complexity with f5 and hashi corp
Automate and simplify multi cloud complexity with f5 and hashi corpAutomate and simplify multi cloud complexity with f5 and hashi corp
Automate and simplify multi cloud complexity with f5 and hashi corp
Mitchell Pronschinske
 
OpenText Extended ECM for Microsoft Dynamics Customer Engagement
OpenText Extended ECM for Microsoft Dynamics Customer EngagementOpenText Extended ECM for Microsoft Dynamics Customer Engagement
OpenText Extended ECM for Microsoft Dynamics Customer Engagement
OpenText
 
Dématérialisation du traitement des factures
Dématérialisation du traitement des facturesDématérialisation du traitement des factures
Dématérialisation du traitement des factures
SmartWave
 

What's hot (20)

Magento Storefront architecture
Magento Storefront architectureMagento Storefront architecture
Magento Storefront architecture
 
Magento Multi-Source Inventory (MSI)
Magento Multi-Source Inventory (MSI)Magento Multi-Source Inventory (MSI)
Magento Multi-Source Inventory (MSI)
 
Awesome architectures in Magento 2.3
Awesome architectures in Magento 2.3Awesome architectures in Magento 2.3
Awesome architectures in Magento 2.3
 
Architecture and workflow of Multi-Source Inventory
Architecture and workflow of Multi-Source InventoryArchitecture and workflow of Multi-Source Inventory
Architecture and workflow of Multi-Source Inventory
 
Backwards Compatibility Developers Guide. #MM17NL
Backwards Compatibility Developers Guide. #MM17NLBackwards Compatibility Developers Guide. #MM17NL
Backwards Compatibility Developers Guide. #MM17NL
 
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
 
Dare to Share Magento Community Engineering
Dare to Share Magento Community Engineering Dare to Share Magento Community Engineering
Dare to Share Magento Community Engineering
 
Testing in Magento 2
Testing in Magento 2 Testing in Magento 2
Testing in Magento 2
 
Mli 2017 technical m2 developer experience
Mli 2017 technical m2 developer experienceMli 2017 technical m2 developer experience
Mli 2017 technical m2 developer experience
 
Extending Magento's Capabilities to Increase Efficiency and Accelerate Growth
Extending Magento's Capabilities to Increase Efficiency and Accelerate GrowthExtending Magento's Capabilities to Increase Efficiency and Accelerate Growth
Extending Magento's Capabilities to Increase Efficiency and Accelerate Growth
 
Medior Software Engineer (C #,. Net) Bizz Talk 2006 Groningen
Medior Software Engineer (C #,. Net)   Bizz Talk 2006    GroningenMedior Software Engineer (C #,. Net)   Bizz Talk 2006    Groningen
Medior Software Engineer (C #,. Net) Bizz Talk 2006 Groningen
 
xbim Flex: taking the xbim toolkit into the cloud
xbim Flex: taking the xbim toolkit into the cloudxbim Flex: taking the xbim toolkit into the cloud
xbim Flex: taking the xbim toolkit into the cloud
 
Magento Technical guidelines
Magento Technical guidelinesMagento Technical guidelines
Magento Technical guidelines
 
Platform introduction
Platform introductionPlatform introduction
Platform introduction
 
The LeanIX Microservices Integration
The LeanIX Microservices IntegrationThe LeanIX Microservices Integration
The LeanIX Microservices Integration
 
Innovative API-Based LeanIX Enhancements
Innovative API-Based LeanIX EnhancementsInnovative API-Based LeanIX Enhancements
Innovative API-Based LeanIX Enhancements
 
Practical thoughts for cloud transformation
Practical thoughts for cloud transformationPractical thoughts for cloud transformation
Practical thoughts for cloud transformation
 
Automate and simplify multi cloud complexity with f5 and hashi corp
Automate and simplify multi cloud complexity with f5 and hashi corpAutomate and simplify multi cloud complexity with f5 and hashi corp
Automate and simplify multi cloud complexity with f5 and hashi corp
 
OpenText Extended ECM for Microsoft Dynamics Customer Engagement
OpenText Extended ECM for Microsoft Dynamics Customer EngagementOpenText Extended ECM for Microsoft Dynamics Customer Engagement
OpenText Extended ECM for Microsoft Dynamics Customer Engagement
 
Dématérialisation du traitement des factures
Dématérialisation du traitement des facturesDématérialisation du traitement des factures
Dématérialisation du traitement des factures
 

Similar to The long way from Monolith to Microservices

Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum PerformanceEugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Meet Magento Italy
 
2019 03-13-implementing microservices by ddd
2019 03-13-implementing microservices by ddd2019 03-13-implementing microservices by ddd
2019 03-13-implementing microservices by ddd
Kim Kao
 
Implementing Microservices by DDD
Implementing Microservices by DDDImplementing Microservices by DDD
Implementing Microservices by DDD
Amazon Web Services
 
API First or Events First: Is it a Binary Choice?
API First or Events First: Is it a Binary Choice?  API First or Events First: Is it a Binary Choice?
API First or Events First: Is it a Binary Choice?
Rohit Kelapure
 
API First or Events First: Is it a Binary Choice?
API First or Events First: Is it a Binary Choice?API First or Events First: Is it a Binary Choice?
API First or Events First: Is it a Binary Choice?
VMware Tanzu
 
IBM APM for Hybrid Applications
IBM APM for Hybrid ApplicationsIBM APM for Hybrid Applications
IBM APM for Hybrid Applications
Matthew Cheah
 
Cloud Customer Architecture for Hybrid Integration
Cloud Customer Architecture for Hybrid IntegrationCloud Customer Architecture for Hybrid Integration
Cloud Customer Architecture for Hybrid Integration
Cloud Standards Customer Council
 
Open MIc - Best Practices SCN Migration
Open MIc - Best Practices SCN MigrationOpen MIc - Best Practices SCN Migration
Open MIc - Best Practices SCN Migration
Ranjit Rai
 
External should that be a microservice
External should that be a microserviceExternal should that be a microservice
External should that be a microservice
Rohit Kelapure
 
What is NetOps? | NetOps Transformation
What is NetOps? | NetOps TransformationWhat is NetOps? | NetOps Transformation
What is NetOps? | NetOps Transformation
AppViewX
 
Z api overview
Z api overviewZ api overview
Z api overview
bamadhu
 
apidays LIVE LONDON - Old meets New - Managing transactions on the edge of th...
apidays LIVE LONDON - Old meets New - Managing transactions on the edge of th...apidays LIVE LONDON - Old meets New - Managing transactions on the edge of th...
apidays LIVE LONDON - Old meets New - Managing transactions on the edge of th...
apidays
 
OpsRamp Platform Winter 2020 Release
OpsRamp Platform Winter 2020 ReleaseOpsRamp Platform Winter 2020 Release
OpsRamp Platform Winter 2020 Release
OpsRamp
 
Integration (Application?) Modernization with IBM Garage
Integration (Application?) Modernization with IBM GarageIntegration (Application?) Modernization with IBM Garage
Integration (Application?) Modernization with IBM Garage
Andrew Ferrier
 
Mini-course at VFU - Architecting modern digital systems - 4
Mini-course at VFU - Architecting modern digital systems - 4Mini-course at VFU - Architecting modern digital systems - 4
Mini-course at VFU - Architecting modern digital systems - 4
Alexander SAMARIN
 
App Modernization
App ModernizationApp Modernization
App Modernization
PT Datacomm Diangraha
 
Digital reference architecture in hybrid cloud
Digital reference architecture in hybrid cloudDigital reference architecture in hybrid cloud
Digital reference architecture in hybrid cloud
Davide Veronese
 
Ibm edge computing meetup
Ibm edge computing meetupIbm edge computing meetup
Ibm edge computing meetup
Eric Cattoir
 
Igor Miniailo - Magento 2 API Design Best Practices
Igor Miniailo - Magento 2 API Design Best PracticesIgor Miniailo - Magento 2 API Design Best Practices
Igor Miniailo - Magento 2 API Design Best Practices
Atwix
 

Similar to The long way from Monolith to Microservices (20)

Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum PerformanceEugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
 
Ibm
IbmIbm
Ibm
 
2019 03-13-implementing microservices by ddd
2019 03-13-implementing microservices by ddd2019 03-13-implementing microservices by ddd
2019 03-13-implementing microservices by ddd
 
Implementing Microservices by DDD
Implementing Microservices by DDDImplementing Microservices by DDD
Implementing Microservices by DDD
 
API First or Events First: Is it a Binary Choice?
API First or Events First: Is it a Binary Choice?  API First or Events First: Is it a Binary Choice?
API First or Events First: Is it a Binary Choice?
 
API First or Events First: Is it a Binary Choice?
API First or Events First: Is it a Binary Choice?API First or Events First: Is it a Binary Choice?
API First or Events First: Is it a Binary Choice?
 
IBM APM for Hybrid Applications
IBM APM for Hybrid ApplicationsIBM APM for Hybrid Applications
IBM APM for Hybrid Applications
 
Cloud Customer Architecture for Hybrid Integration
Cloud Customer Architecture for Hybrid IntegrationCloud Customer Architecture for Hybrid Integration
Cloud Customer Architecture for Hybrid Integration
 
Open MIc - Best Practices SCN Migration
Open MIc - Best Practices SCN MigrationOpen MIc - Best Practices SCN Migration
Open MIc - Best Practices SCN Migration
 
External should that be a microservice
External should that be a microserviceExternal should that be a microservice
External should that be a microservice
 
What is NetOps? | NetOps Transformation
What is NetOps? | NetOps TransformationWhat is NetOps? | NetOps Transformation
What is NetOps? | NetOps Transformation
 
Z api overview
Z api overviewZ api overview
Z api overview
 
apidays LIVE LONDON - Old meets New - Managing transactions on the edge of th...
apidays LIVE LONDON - Old meets New - Managing transactions on the edge of th...apidays LIVE LONDON - Old meets New - Managing transactions on the edge of th...
apidays LIVE LONDON - Old meets New - Managing transactions on the edge of th...
 
OpsRamp Platform Winter 2020 Release
OpsRamp Platform Winter 2020 ReleaseOpsRamp Platform Winter 2020 Release
OpsRamp Platform Winter 2020 Release
 
Integration (Application?) Modernization with IBM Garage
Integration (Application?) Modernization with IBM GarageIntegration (Application?) Modernization with IBM Garage
Integration (Application?) Modernization with IBM Garage
 
Mini-course at VFU - Architecting modern digital systems - 4
Mini-course at VFU - Architecting modern digital systems - 4Mini-course at VFU - Architecting modern digital systems - 4
Mini-course at VFU - Architecting modern digital systems - 4
 
App Modernization
App ModernizationApp Modernization
App Modernization
 
Digital reference architecture in hybrid cloud
Digital reference architecture in hybrid cloudDigital reference architecture in hybrid cloud
Digital reference architecture in hybrid cloud
 
Ibm edge computing meetup
Ibm edge computing meetupIbm edge computing meetup
Ibm edge computing meetup
 
Igor Miniailo - Magento 2 API Design Best Practices
Igor Miniailo - Magento 2 API Design Best PracticesIgor Miniailo - Magento 2 API Design Best Practices
Igor Miniailo - Magento 2 API Design Best Practices
 

More from Igor Miniailo

MageConf 2017, Design API Best Practices
MageConf 2017, Design API Best PracticesMageConf 2017, Design API Best Practices
MageConf 2017, Design API Best Practices
Igor Miniailo
 
API design best practices
API design best practicesAPI design best practices
API design best practices
Igor Miniailo
 
Backward Compatibility Developer's Guide in Magento 2. #MM17CZ
Backward Compatibility Developer's Guide in Magento 2. #MM17CZBackward Compatibility Developer's Guide in Magento 2. #MM17CZ
Backward Compatibility Developer's Guide in Magento 2. #MM17CZ
Igor Miniailo
 
Backward Compatibility Developer's Guide in Magento 2
Backward Compatibility Developer's Guide in Magento 2Backward Compatibility Developer's Guide in Magento 2
Backward Compatibility Developer's Guide in Magento 2
Igor Miniailo
 
Magento Developer Talk. Microservice Architecture and Actor Model
Magento Developer Talk. Microservice Architecture and Actor ModelMagento Developer Talk. Microservice Architecture and Actor Model
Magento Developer Talk. Microservice Architecture and Actor Model
Igor Miniailo
 
Applying Code Customizations to Magento 2
Applying Code Customizations to Magento 2 Applying Code Customizations to Magento 2
Applying Code Customizations to Magento 2
Igor Miniailo
 
Modular development in Magento 2
Modular development in Magento 2Modular development in Magento 2
Modular development in Magento 2
Igor Miniailo
 
Мониторинг веб приложений на PHP в режиме реального времени с помощью Pinba. ...
Мониторинг веб приложений на PHP в режиме реального времени с помощью Pinba. ...Мониторинг веб приложений на PHP в режиме реального времени с помощью Pinba. ...
Мониторинг веб приложений на PHP в режиме реального времени с помощью Pinba. ...
Igor Miniailo
 
Сommand Query Responsibility Segregation (CQRS) - Отделяем Мух от Котлет
Сommand Query Responsibility Segregation (CQRS) - Отделяем Мух от КотлетСommand Query Responsibility Segregation (CQRS) - Отделяем Мух от Котлет
Сommand Query Responsibility Segregation (CQRS) - Отделяем Мух от Котлет
Igor Miniailo
 

More from Igor Miniailo (9)

MageConf 2017, Design API Best Practices
MageConf 2017, Design API Best PracticesMageConf 2017, Design API Best Practices
MageConf 2017, Design API Best Practices
 
API design best practices
API design best practicesAPI design best practices
API design best practices
 
Backward Compatibility Developer's Guide in Magento 2. #MM17CZ
Backward Compatibility Developer's Guide in Magento 2. #MM17CZBackward Compatibility Developer's Guide in Magento 2. #MM17CZ
Backward Compatibility Developer's Guide in Magento 2. #MM17CZ
 
Backward Compatibility Developer's Guide in Magento 2
Backward Compatibility Developer's Guide in Magento 2Backward Compatibility Developer's Guide in Magento 2
Backward Compatibility Developer's Guide in Magento 2
 
Magento Developer Talk. Microservice Architecture and Actor Model
Magento Developer Talk. Microservice Architecture and Actor ModelMagento Developer Talk. Microservice Architecture and Actor Model
Magento Developer Talk. Microservice Architecture and Actor Model
 
Applying Code Customizations to Magento 2
Applying Code Customizations to Magento 2 Applying Code Customizations to Magento 2
Applying Code Customizations to Magento 2
 
Modular development in Magento 2
Modular development in Magento 2Modular development in Magento 2
Modular development in Magento 2
 
Мониторинг веб приложений на PHP в режиме реального времени с помощью Pinba. ...
Мониторинг веб приложений на PHP в режиме реального времени с помощью Pinba. ...Мониторинг веб приложений на PHP в режиме реального времени с помощью Pinba. ...
Мониторинг веб приложений на PHP в режиме реального времени с помощью Pinba. ...
 
Сommand Query Responsibility Segregation (CQRS) - Отделяем Мух от Котлет
Сommand Query Responsibility Segregation (CQRS) - Отделяем Мух от КотлетСommand Query Responsibility Segregation (CQRS) - Отделяем Мух от Котлет
Сommand Query Responsibility Segregation (CQRS) - Отделяем Мух от Котлет
 

Recently uploaded

Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 

Recently uploaded (20)

Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 

The long way from Monolith to Microservices

  • 1. © 2018 Magento, An Adobe Company Page | 1 A long way from Monolith to Micro- Service Architecture Yesterday, Today and Tomorrow
  • 2. © 2018 Magento, An Adobe Company Page | 2 Igor Miniailo Magento Architect, Community Engineering Team
  • 3. © 2018 Magento, An Adobe Company Page | 3 Agenda © 2018 Magento, An Adobe Company Page | 3 • Magento 1. Big ball of Mud • SOLID and Single Responsibility • Performance vs Scalability • Coupling vs Cohesion • Bounded contexts and their Boundaries • CAP Theorem • ACID vs BASE • Modularity as a first step towards micro-services • Headless Magento • Service Isolation (Code and DB split) • Conway's law • Microservice architecture
  • 4. © 2018 Magento, An Adobe Company Page | 4© 2018 Magento, An Adobe Company Page | 4 Magento 1 And all the legacy we got starting Magento 2 development
  • 5. © 2018 Magento, An Adobe Company Page | 5 Classical N-layered architecture • Compromise in the design of Data Model • Not possible to scale separately Read out of Write operations • Tend to Anemic Data Model • Tend to Monolithic Architecture • An application has to be deployed as a whole • An application has to be scaled as a whole
  • 6. © 2018 Magento, An Adobe Company Page | 6 Big Ball of Mud Even though a modular code structure groups related behavior, it is easy to introduce an undesired dependency between application services, because services are not deployed and tested independently.
  • 7. © 2018 Magento, An Adobe Company Page | 7 SOLID comes to rescue
  • 8. © 2018 Magento, An Adobe Company Page | 8© 2018 Magento, An Adobe Company Page | 8 Modularity as a first step towards micro-services
  • 9. © 2018 Magento, An Adobe Company Page | 9 • Every sophisticated business domain consists of a bunch of Bounded Contexts • Each Bounded Context contains models and maybe other contexts • The Bounded Context is also a boundary for the meaning of a given model Bounded Context
  • 10. © 2018 Magento, An Adobe Company Page | 10 Bounded Context
  • 11. © 2018 Magento, An Adobe Company Page | 11
  • 12. © 2018 Magento, An Adobe Company Page | 12 CAP Theorem States that it is impossible for a distributed data store to simultaneously provide more than two out of the following three guarantees: • Consistency: Every read receives the most recent write or an error • Availability: Every request receives a (non-error) response – without the guarantee that it contains the most recent write • Partition tolerance: The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes
  • 13. © 2018 Magento, An Adobe Company Page | 13 Asynchronous processing http://www.enterpriseintegrationpatterns.com/docs/IEEE_Software_Design_2PC.pdf
  • 14. © 2018 Magento, An Adobe Company Page | 14 Conversation pattern The interaction between two parties (customer and coffee shop) consists of: • a short synchronous interaction (ordering and paying) • and a longer, asynchronous interaction (making and receiving the drink) This type of conversation pattern is quite common in purchasing scenarios.
  • 15. © 2018 Magento, An Adobe Company Page | 15 Error-handling strategies for loosely coupled systems (a) Write-off (b) Retry (c) Compensating action (d) Transaction coordinator (two phase commit)
  • 16. © 2018 Magento, An Adobe Company Page | 16 Implement business transaction that spans multiple services as a saga A saga is a sequence of local transactions Each local transaction updates the database and publishes a message or event to trigger the next local transaction in the saga
  • 17. © 2018 Magento, An Adobe Company Page | 17 Event Sourcing
  • 18. © 2018 Magento, An Adobe Company Page | 18 *The property of certain operations whereby they can be applied multiple times without changing the result beyond the initial application. Idempotence of operation and at-least-once delivery Network communication is unreliable. Retries will be required, and some messages will be delivered more than once
  • 19. © 2018 Magento, An Adobe Company Page | 19 • All operations MUST BE idempotent. • Sagas SHOULD BE used for consistency of distributed operations • All new service contracts SHOULD expose asynchronous APIs • All new state modifying operations SHOULD expose bulk APIs • All service operations MUST BE stateless • There MUST BE NO data dependencies between services Design Principles to follow
  • 20. © 2018 Magento, An Adobe Company Page | 20 • Every module defines its APIs (service contracts), which are PHP interfaces that can be called either from within a PHP process or remotely through REST, SOAP or AMQP APIs. • Every module can call other modules only through their service contracts. Service Layer
  • 21. © 2018 Magento, An Adobe Company Page | 21 Service Layer. Current State Legacy undesired dependencies direct inter-module - model-to-model - presentation-to-model still exist.
  • 22. © 2018 Magento, An Adobe Company Page | 22 Modules split
  • 23. © 2018 Magento, An Adobe Company Page | 23 Modules Split. Inventory • API – service contracts and extension points • Implementation (private) - should not be called directly from other modules • Admin UI • Frontend UI
  • 24. © 2018 Magento, An Adobe Company Page | 24 Headless Multi-Source Inventory UI modules are removable if merchant wants to use external ERP system as a source of truth where he will manage inventory
  • 25. © 2018 Magento, An Adobe Company Page | 25 Desirable State
  • 26. © 2018 Magento, An Adobe Company Page | 26 Database Split A service must not talk to other service database directly, only through service contracts TODO: - Minimize data relations - Replace the required inter-service db- level data relations, joins, and transactions with application-level relations, joins, and transactions
  • 27. © 2018 Magento, An Adobe Company Page | 27 Desirable state Isolated ServicesMonolith
  • 28. © 2018 Magento, An Adobe Company Page | 28 Monoliths vs Microservices. Scalability
  • 29. © 2018 Magento, An Adobe Company Page | 29
  • 30. © 2018 Magento, An Adobe Company Page | 30 Conway’s Law Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure. -- Melvyn Conway, 1967
  • 31. © 2018 Magento, An Adobe Company Page | 31 2.3 Stage #1 Stage #2 Stage #3 Stage #4 Stage #5 Inventory (MSI) App Framework Order Management CMS Shipping Marketing Pricing Tax Reports Promotions Risk Checkout Customer Payments Wishlist Rewards Company Service decomposition
  • 32. © 2018 Magento, An Adobe Company Page | 32 • Magento Service Isolation Design Document by Anton Kril • Magento administrative tool • Magento MSI Useful Links
  • 33. © 2018 Magento, An Adobe Company Page | 33 Q&AFollow me in Twitter @iminyaylo
  • 34. © 2018 Magento, An Adobe Company Page | 34 Thank You © 2018 Magento, An Adobe Company Page | 34

Editor's Notes

  1. For example, when you place an order on Amazon.com, a short synchronous interaction assigns a unique order number first. All subsequent steps (charging your credit card and packaging and shipping the product) are performed asynchronously: you’re notified via (asynchronous) email as additional processing steps complete. If anything goes wrong, Amazon usually uses similar compensation strategies—refunding your credit card or retrying the action by resending the goods.
  2. Unlike current implementation (OS & Commerce split), the data relation decoupling should be performed in Open Source edition of Magento to simplify extension development.