Page | 1
Igor Miniailo,
Lead Architect, Magento
SOMETHING
ARCHITECTURE
Page | 2
• 2016 – Command/Query
Responsibility Segregation
(CQRS)
• 2017 – API design best practices
• 2018 – A long way from Monolith
to Service Isolated
Architecture
My previous years on MageConf
Page | 3
2019 – ???
• We are at Magento make a lot of decisions each
day / week / month / year
• Some of those decisions are wrong
• And it’s okay. No one can avoid making mistakes!
• But behind each decision, there is some motivation
• You should know it!
• I am here today to highlight our motivation for the
most ambitious project we ever started since
releasing Magento 2
Page | 4
Some of us like to gamble,
and those who like sometimes lose...
Serious topic with a silly face
Page | 5
No API deprecation today!
Spoiler (and this is serious now):
Page | 6
What are the main Magento flaws?
Page | 7
Problems:
Page | 8
Product Goals:
Page | 9
The Monolith
Page | 10
API vs SPI (Extension Points)
A PHP Interface in Magento can be used several ways by
the core product and extension developers.
• As an API. is a set of interfaces and their
implementations that a module provides to other
modules
• As a Service Provider Interface (SPI). is a set of
interfaces that a module uses internally and allows their
implementation by other modules
• As both. APIs and SPIs are not mutually exclusive
Page | 11
API Evolution
Page | 12
Evolvability of platform guaranteed by
Isolation of Services and Stable APIs
Page | 13
Storefront vs Store Management
Page | 14
Storefront and Store Management Applications:
Page | 15
Replaceability in action:
Page | 16
Storefront and Store Management Applications:
Page | 17
Desired State
Page | 18
• Evolvable API (Versionless)
• PATCH Support
Why GraphQL?
Page | 19
Multitier architecture of Storefront Application:
Page | 20
Backends For Frontends (BFF)
• Minimizes the number of requests to
the back end and reduces chatty
communication to multiple services
• Security issues. Services are not
available to the “external world”
• Handles cross-cutting concerns such
as authorization, data transformations,
service discovery
• Reduces coupling between client and
server
• Reverse proxy or gateway routing
Page | 21
Modules Decomposition
• Focus on Clean Boundaries over Perfect Models
• Subdomains for replacement rather than reuse
Page | 22
Storefront API
Page | 23
Storefront API
Page | 24
APIs must be fast
Page | 25
APIs must be fast
Page | 26
The most complex challenge in
implementation of isolated service
architecture is not building the services
themselves, but the communication
between services
Page | 27
• The network is reliable
• Latency is zero
• Bandwidth is infinite
• The network is secure
• Topology doesn't change
• There is one administrator
• Transport cost is zero
• The network is homogeneous
https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing
Network is a scary place to be
Page | 28
Service Mesh
Page | 29
BFF vs Service Mesh
Page | 30
Page | 31
MFTF coverage is not optional anymore:
Page | 32
Magento Administrative tools:
Page | 33
Independent component releases:
Page | 34
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
https://microservices.io/patterns/data/saga.
html
Page | 35
Alternative Checkout Flow
Page | 36
UUID for Entities identity
Page | 37
Community interaction
Page | 38
New Magezine issue just landed!
Page | 39
Thank You

Something Architecture

  • 1.
    Page | 1 IgorMiniailo, Lead Architect, Magento SOMETHING ARCHITECTURE
  • 2.
    Page | 2 •2016 – Command/Query Responsibility Segregation (CQRS) • 2017 – API design best practices • 2018 – A long way from Monolith to Service Isolated Architecture My previous years on MageConf
  • 3.
    Page | 3 2019– ??? • We are at Magento make a lot of decisions each day / week / month / year • Some of those decisions are wrong • And it’s okay. No one can avoid making mistakes! • But behind each decision, there is some motivation • You should know it! • I am here today to highlight our motivation for the most ambitious project we ever started since releasing Magento 2
  • 4.
    Page | 4 Someof us like to gamble, and those who like sometimes lose... Serious topic with a silly face
  • 5.
    Page | 5 NoAPI deprecation today! Spoiler (and this is serious now):
  • 6.
    Page | 6 Whatare the main Magento flaws?
  • 7.
  • 8.
  • 9.
    Page | 9 TheMonolith
  • 10.
    Page | 10 APIvs SPI (Extension Points) A PHP Interface in Magento can be used several ways by the core product and extension developers. • As an API. is a set of interfaces and their implementations that a module provides to other modules • As a Service Provider Interface (SPI). is a set of interfaces that a module uses internally and allows their implementation by other modules • As both. APIs and SPIs are not mutually exclusive
  • 11.
    Page | 11 APIEvolution
  • 12.
    Page | 12 Evolvabilityof platform guaranteed by Isolation of Services and Stable APIs
  • 13.
    Page | 13 Storefrontvs Store Management
  • 14.
    Page | 14 Storefrontand Store Management Applications:
  • 15.
  • 16.
    Page | 16 Storefrontand Store Management Applications:
  • 17.
  • 18.
    Page | 18 •Evolvable API (Versionless) • PATCH Support Why GraphQL?
  • 19.
    Page | 19 Multitierarchitecture of Storefront Application:
  • 20.
    Page | 20 BackendsFor Frontends (BFF) • Minimizes the number of requests to the back end and reduces chatty communication to multiple services • Security issues. Services are not available to the “external world” • Handles cross-cutting concerns such as authorization, data transformations, service discovery • Reduces coupling between client and server • Reverse proxy or gateway routing
  • 21.
    Page | 21 ModulesDecomposition • Focus on Clean Boundaries over Perfect Models • Subdomains for replacement rather than reuse
  • 22.
  • 23.
  • 24.
    Page | 24 APIsmust be fast
  • 25.
    Page | 25 APIsmust be fast
  • 26.
    Page | 26 Themost complex challenge in implementation of isolated service architecture is not building the services themselves, but the communication between services
  • 27.
    Page | 27 •The network is reliable • Latency is zero • Bandwidth is infinite • The network is secure • Topology doesn't change • There is one administrator • Transport cost is zero • The network is homogeneous https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing Network is a scary place to be
  • 28.
  • 29.
    Page | 29 BFFvs Service Mesh
  • 30.
  • 31.
    Page | 31 MFTFcoverage is not optional anymore:
  • 32.
    Page | 32 MagentoAdministrative tools:
  • 33.
    Page | 33 Independentcomponent releases:
  • 34.
    Page | 34 Implementbusiness 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 https://microservices.io/patterns/data/saga. html
  • 35.
    Page | 35 AlternativeCheckout Flow
  • 36.
    Page | 36 UUIDfor Entities identity
  • 37.
  • 38.
    Page | 38 NewMagezine issue just landed!
  • 39.