SlideShare una empresa de Scribd logo
1 de 83
Descargar para leer sin conexión
Alessandro Ronchi
Bitbull
@aleron75
Awesome architectures
in Magento 2.3
Awesome architectures
in Magento 2.3
Alessandro Ronchi
Bitbull
@aleron75
This presentation has been realized with kind permission of Riccardo Tempesta (The
Rick); the original one was presented by him at Meet Magento Germany 2019 and the
slides you are seeing here are just a refactoring of his original work. Most of the
content is the same, especially the jokes :)
@MageTitansES @aleron75
And, in turn, most of the work presented here is built standing on the shoulders of
heroes like the Magento architect you see here.
- Igor Miniailo
- Eugene Shakhsuvarov
- Anton Kril
If you are wondering where all this hero culture comes from…
@MageTitansES @aleron75
http://bit.ly/flying-jason
...what would you expect from a community used to this? :)
- COO at Bitbull
- Mage Titans Italy organizer
- Magento Master 2017, 2019
- Top 50 Contributor 2017, 2018
- Magento Community Maintainer
Alessandro Ronchi
@MageTitansES @aleron75
Never stop exploring!
Just a couple of words about me.
Agenda
1. The Magento legacy
2. Software architectures evolution
3. Evolution of Magento 2
4. Some applied concepts
Confused about
Magento development?
We’ve heard that someone feels a bit stressed by developing on Magento 2 and this
probably comes from a bit of confusion.
Nevertheless I’ve talked with Mark, a 23yo guy, who told me that developing on
Magento 2 is not stressful at all.
“Being a Magento 2 developer
is not stressful at all”
~ Mark, 23 years old
@MageTitansES @aleron75
You can see the quote from Mark…
And yes, you spotted out the joke because, actually, Mark is only 20yo :)
CONFUSION
from Latin: “cum” + “fusus”
So where this stress come from?
To understand, let’s see where this confusion comes from.
M2 !== M1
It comes from the fact that M2 is not a revolution but an evolution of M1: M1 is our
legacy, merged into M2.
Despite this, we shouldn’t develop on M2 the same way we did on M1, here is where
the confusion likely comes from.
Software architecture
evolution: 1990’s to 2010’s
To better understand our legacy and the direction M2 is getting, let me briefly run
through the evolution of software architectures of last decades.
And indulge me to do it like any legit Italian should do it.
Software architecture: 1990s
@MageTitansES @aleron75
By making analogies with pasta :)
In the ‘90s we had spaghetti coding, also known as “copy & paste” code.
Software architecture: 1990s
@MageTitansES @aleron75
- no standards
- fast development
- no maintenance
At that time we had very few standards for web applications, the market required fast
development and the concept of software maintenance was pretty new.
As a result, code suffered from high coupling, we couldn’t change one piece of code
without affecting another and, infact, we didn’t do it.
Rather, we preferred to copy logic here and there because applying changes could
have brought undesired side effects (known as regressions).
Without tests, we couldn’t perform refactoring and w/o refactoring we couldn’t clean
the kitchen, we couldn’t increase the quality and maintainability of our code.
Software architecture: 2000s
@MageTitansES @aleron75
Then we had the lasagna coding.
Software architecture: 2000s
@MageTitansES @aleron75
- bigger complexity
- testability
- scalability (as a whole)
In the 2000s the market required more complex, testable and scalable web
applications.
We realized that we could obtain this by isolating some responsibilities into layers.
So n-layered applications came out.
Typical 3-layered: presentation, business logic, data handling.
This architecture is not bad per se, this is how, for example, M1 was built.
But there are some limitations:
- not possible to scalable separately read/write
- app deployed as a whole (monolithic application)
- layers tend to reflect the data model, UIs are typically CRUD oriented
Software architecture: 2010s
@MageTitansES @aleron75
Finally we realized that we could split a monolith into smaller pieces, each with single
specific responsibility, with something good inside exposed through public interfaces
(APIs).
It was time to serve ravioli!
Software architecture: 2010s
@MageTitansES @aleron75
- composition
- independent deployability
- independent scalability
This kind of applications allows us to compose functionality, deploy and scale them
independently.
This is what we called Service Oriented Architectures and, more trendily,
microservices.
What about
Magento 2 evolution?
But is this the change M2 is embracing?
@MageTitansES @aleron75
Yes and no.
M2 is evolving; nowadays Magento Core Engineers prefer to speak of “service
isolation”.
Service Isolation Upsides
1. SCALABILITY
2. DEPLOYABILITY
3. REPLACEABILITY
4. UPGRADABILITY
The key common adjective in this list is: independent
BUT TODAY?
Just let’s step back to current state of M2.
@MageTitansES @aleron75
We already have replaceability, through DI, right?
@MageTitansES @aleron75
...that can brings us to situations like the one illustrated.
This comes as a legacy from Magento 1 and it became evident thanks to DI.
Why having all these dependencies (which btw is not good) was not evident before?
final class Mage
Because of the infamous “God” class of M1
It allowed a class to easily depend on other classes at the cost of “hiding” this
dependency (while adding more and more responsibilities).
DI made all these dependencies evident in M2 and revealed the architectural
problems of M1: classes had too much responsibilities.
@MageTitansES @aleron75
But we can have replaceability through modularity!
MODULES !== MODULARITY
Not quite: having modules doesn’t mean having a real modular architecture.
Real modularity is the very first step towards Service Isolation.
MODULARITY
CONTEXT ISOLATION
So let’s see what are the main features of modularity, because this is driving M2
evolution at date.
@MageTitansES @aleron75
Bounded Contexts
InventoryCatalog Checkout Customer ...
Bounded Contexts is a concept that comes from Domain Driven Design; in brief:
DDD is an approach to software development that helps us taking decisions about
how to design our application speaking the ubiquitous language of the Domain
Experts (our customer) and trying to avoid ambiguity and focusing on design
simplification.
A Bounded Context is a unit in which all the elements that we design have an
ubiquitous meaning and possibly a single responsibility, allowing us to reach
design simplification.
Another Inventory
@MageTitansES @aleron75
Bounded Contexts: replaceability
Inventory
Catalog Checkout Customer ...
Isolating elements (concepts) in bounded context easily allows to obtain
replaceability, one of the key goals of Service Isolation.
@MageTitansES @aleron75
Bounded Contexts: example
Catalog
- sku
- name
- description
...
Let’s see an example: the representation of a product in different contexts.
@MageTitansES @aleron75
Bounded Contexts: example
Catalog
- sku
- name
- description
...
Inventory
- sku
- physical qty
- in stock
...
Here we see that a product in different contexts can have different attributes.
@MageTitansES @aleron75
Bounded Contexts: example
Catalog
- sku
- name
- description
...
Inventory
- sku
- physical qty
- in stock
...
Checkout
- sku
- salable qty
- unit price
...
Different responsibilities, different behaviors, no need to generalize in a unique
concept that would be:
- charged with too many responsibilities
- prone to ambiguity: what does a “qty” property represent? Physical
availability? Salable quantity?
@MageTitansES @aleron75
Bounded Contexts: example
Catalog
Product
Inventory
Source Item
Checkout
Quote Item
In different contexts, the same concept maps to different entities.
Different entities can be simpler, more specialized, less ambiguous.
@MageTitansES @aleron75
Bounded Contexts in M2
http://bit.ly/mage2si
So, for example, we can identify the Catalog Context in M2...
@MageTitansES @aleron75
Bounded Contexts in M2
http://bit.ly/mage2si
...the Customer...
@MageTitansES @aleron75
Bounded Contexts in M2
http://bit.ly/mage2si
...the Checkout...
@MageTitansES @aleron75
Bounded Contexts in M2
http://bit.ly/mage2si
...and many more.
This is the big picture of bounded contexts in M2.
MODULARITY
CONTEXT INTERACTIONS
Once we have context isolation, we need contexts to interact with each other.
@MageTitansES @aleron75
Contexts Interaction
Inventory Sales
How Inventory and Sales communicate?
@MageTitansES @aleron75
Contexts Interaction in M1: coupled
Inventory Sales
MUTUAL DEPENDENCY
This is how context interaction works in M1 (and still works in the majority of M2
codebase): we have mutual dependency between different contexts.
That’s not what we want.
@MageTitansES @aleron75
Contexts Interaction in M2: decoupled
Inventory
Sales
Inventory Sales
Uses plugins to
add/change logic
This, instead, is how ideally we can achieve decoupled context interaction in M2:
through the usage of a specific context which makes the connection b/w two isolated
contexts that don’t share anything with each other.
This third element implements specialized business logic and can use plugins to
interact with the other contexts.
WHY PLUGINS?
Let’s see why plugins are the best choice by looking at alternatives.
@MageTitansES @aleron75
Observers: why not
Extension point
Observer
Event
Event
Extension point
- soft dependencies
- rely only on existing extension points
Observers don’t allow us to define hard evident dependencies meaning that, if the
event that is observed is not dispatched, the observer is not triggered.
If something is not working we don’t have evidence of that.
Furthermore, we can only rely on extension points that have been previously defined:
no event triggered, no extension point.
@MageTitansES @aleron75
Preferences: why not always
- some classes still do too much
- can be used on single responsibility classes
- all or none
MANY RESPONSIBILITIES
TOO MANY POTENTIAL SIDE EFFECTS
SINGLE RESPONSIBILITY
(WHEN AVAILABLE)
Preferences allow us to replace a core class with our own implementation. That can
work sometimes but the truth is that a lot of classes in M2 still have a lot of
responsibilities; replacing a class means taking the ownership of all its business logic.
Maybe we need to change only a few behaviors.
Through preferences, there can be only one class replacing another at the same time,
no space for others.
@MageTitansES @aleron75
Plugins: the best option
- hard & explicit dependencies
- no extension point needed (more or less)
- work at method level
Plugins are the best option, because they don’t have the drawbacks seen:
- dependency is hard and explicit because we declare the class which we are
pluginizing by passing it as the $subject parameter
- we don’t need the core team to have foreseen the possible extension point
because we can pluginize every public method (read more here)
- they work at method level and multiple plugins can coexist on the same class
and even on the same method
MODULARITY
API FIRST
Last, but not least, real modularity can be achieved by designing a system that rely
on abstractions, that is, interfaces or, in other words, APIs.
@MageTitansES @aleron75
API first
API / Interface
API / Interface Concrete implementation
@MageTitansES @aleron75
API first
MyModuleApi MyModule
@MageTitansES @aleron75
API first
@MageTitansES @aleron75
API first: replaceability
MyModuleApi MyModule
AnotherModule
- modules only depend on abstractions
Again, depending on abstractions allows us to obtain replaceability
@MageTitansES @aleron75
API first
Here is an example of an “Interface-only” module
@MageTitansES @aleron75
API first
And here an example of the dependencies form interface modules declared in
composer.json
@MageTitansES @aleron75
API first: modules splitting
http://bit.ly/mage2si
This is a picture made among others by Anton Kril, Director of Architecture at
Magento, that summarizes the possible scenarios before and after applying this
approach.
You can find this and other diagrams in the Service Isolation repository linked before:
http://bit.ly/mage2si
@MageTitansES @aleron75
Modules splitting: so many modules!
MSI is 40+ modules, so far...
A consequence of this approach is the growing number of modules required to
implement a functionality.
@MageTitansES @aleron75
Service isolation
...first reaction...
The first reaction may be panic....
@MageTitansES @aleron75
Service isolation
...second reaction...
...or even worse: rejection...
@MageTitansES @aleron75
Service isolation
...but finally, the aha!
...but once we realize the benefits of such approach we eventually can appreciate it.
WHY IS THIS AMAZING?
We are just trading simplicity for something else...
@MageTitansES @aleron75
Service isolation
FULL MODULAR SYSTEM
This approach allows us to have:
- full modularity
FULL MODULAR SYSTEM CLEAR CONTEXT BOUNDARIES
@MageTitansES @aleron75
Service isolation
This approach allows us to have:
- full modularity
- clear context boundaries
FULL MODULAR SYSTEM CLEAR CONTEXT BOUNDARIES EASY TO FIND RESPONSIBILITIES
@MageTitansES @aleron75
Service isolation
This approach allows us to have:
- full modularity
- clear context boundaries
- classes that are easier to find because they have fewer responsibilities,
located in proper namespaces
FULL MODULAR SYSTEM CLEAR CONTEXT BOUNDARIES EASY TO FIND RESPONSIBILITIES
REPLACEABILITY
@MageTitansES @aleron75
Service isolation
This approach allows us to have:
- full modularity
- clear context boundaries
- classes that are easier to find because they have few responsibilities located
in proper namespaces
- we get replaceability, making it easier to override entire parts of core module
FULL MODULAR SYSTEM CLEAR CONTEXT BOUNDARIES EASY TO FIND RESPONSIBILITIES
REPLACEABILITY INDEPENDENT SCALABILITY
@MageTitansES @aleron75
Service isolation
This approach allows us to have:
- full modularity
- clear context boundaries
- classes that are easier to find because they have few responsibilities located
in proper namespaces
- we get replaceability, making it easier to override entire parts of core module
- and finally, we can scale pieces of application independently thanks to DB
isolation
DB ISOLATION
Let’s see how DB isolation works
@MageTitansES @aleron75
DB isolation: foreign keys?
FK
Source Item
product_id product_id
Product
In Magento 1 (and still in the majority of Magento 2 as well), we can’t split the DB not
to break referential integrity.
FK
Source Item
product_id product_id
Product
FK: THE DATABASE MUST BE THE SAME
@MageTitansES @aleron75
DB isolation: foreign keys?
Because of this “internal” link, different parts of the application must share the same
DB.
Source Item
sku sku
Product
@MageTitansES @aleron75
DB isolation: foreign keys?
use business keys: no DB dependency
So what can we do to avoid problems with foreign keys?
Get rid of them! Using business keys, instead.
Source Item
sku sku
Product
use business keys: no DB dependency
@MageTitansES @aleron75
DB isolation: foreign keys?
Pay attention, this comes at a cost: we lose something, of course, because we are
entering in the field of distributed systems where immediate data consistency is
not always guaranteed.
THE CAP THEOREM
The Cap Theorem, also known as Brewer’s Theorem.
@MageTitansES @aleron75
The CAP theorem
Reference:
https://www.dataversity.net/acid-vs-base-the-shifting-ph-of-database-transaction-proc
essing/
There are three essential system requirements necessary for the successful
design, implementation and deployment of distributed applications.
They are Consistency, Availability and Partition Tolerance – or CAP:
- Consistency: all nodes see the same data at the same time
- Availability: node failures don’t prevent the system to continue working
- Partition Tolerance: network failures don’t prevent the system to
continue working
CA: typical of ACID systems (Atomicity, Consistency, Isolation, Durability: M1) - not
good for scaling
CP: typical of BASE systems (Basically Available, Soft state, Eventual consistency:
M2)
in distributed systems
we can guarantee
only two!
@MageTitansES @aleron75
The CAP theorem
The CAP Theorem states that in distributed systems we can guarantee only two of the
three requirements.
Magento 1 is an ACID system where we have Consistency and Availability
guaranteed.
in large scalable
distributed systems
we give up on
immediate consistency
@MageTitansES @aleron75
The CAP theorem
The Service Isolated architecture towards which Magento 2 is evolving requires it to
abandon Immediate Consistency shifting from an ACID to a BASE system.
in large scalable
distributed systems
we rely on
eventual consistency
@MageTitansES @aleron75
The CAP theorem
Eventual Consistency means that the system will eventually become consistent
once it stops receiving input.
The data will propagate to everywhere it should sooner or later, but the system will
continue to receive input and is not checking the consistency of every transaction
before it moves onto the next one.
Examples of eventual consistency we experience everyday as users:
- Dropbox
- Git
- Google Docs
We read data from hereWe write data here
Separate contexts can have different representation of an information.
Data projection doesn’t happen necessarily in real-time and can take some time.
DATA PROJECTION
@MageTitansES @aleron75
Eventual consistency
A diagram illustrating how data becomes consistent b/w different systems.
@MageTitansES @aleron75
Eventual consistency
http://bit.ly/eventualc
Don’t forget to follow Greg Young and read all his articles and books if you are
interested in DDD, CQRS, Event Sourcing, etc.
Is this the real life?
Is this just fantasy?
Let me anticipate a question that can come from the audience.
All the ideas expressed here are the result of how Magento Inventory (formerly MSI)
is developed and chances are that the future architecture of Magento 2 (or should we
call it Magento 3?) is going towards this.
As an old Chinese saying tells us: "A journey of a thousand miles begins with a single
step"
@MageTitansES @aleron75
Reference: MSI Magento Inventory
http://bit.ly/mageinventory
That’s why I heavily recommend to start looking at the Magento Inventory Project.
Good reads
http://bit.ly/dsbook1 http://bit.ly/dsbook2 http://bit.ly/dsbook3
FREE!
Here are some recommended books about distributed systems:
- Designing Data-Intensive Applications http://bit.ly/dsbook1
- Building Microservices http://bit.ly/dsbook2
- Distributed Systems (introductory, easy, free, must read!) http://bit.ly/dsbook3
What I learned
1. M2: CONTINUOUS IMPROVEMENT
2. SERVICE ISOLATION
3. DISTRIBUTED SYSTEM (M3?)
4. LEARN BY CONTRIBUTING
To recap the lessons learned:
- Magento is under continuous improvement
- At date, Service Isolation is the number one goal of architectural evolution
- In the future, Magento could become a distributed platform
- All the information provided in this presentation (and many, many more) were
learned by contributing to the Magento core
“there’s no better way to learn!”
Paraphrasing a famous flying company, contributing is the better way to learn (in my
opinion).
@MageTitansES @aleron75
Get involved in the evolution!
It’s up to you: hate or help!
https://magentocommeng.slack.com/messages#appdesign
Jump in, if you want.
I thank you all!
Alessandro Ronchi
Bitbull
@aleron75
“You brought me fame and fortune and everything that goes with it.
I thank you all” ~ Freddy Mercury
Any questions?
Alessandro Ronchi
Bitbull
@aleron75

Más contenido relacionado

La actualidad más candente

Experience in Magento Community Projects
Experience in Magento Community ProjectsExperience in Magento Community Projects
Experience in Magento Community ProjectsMagecom UK Limited
 
James Zetlen - PWA Studio Integration…With You
James Zetlen - PWA Studio Integration…With YouJames Zetlen - PWA Studio Integration…With You
James Zetlen - PWA Studio Integration…With YouMeet Magento Italy
 
Chernivtsi Magento Meetup&Contribution day. Naida V.
Chernivtsi Magento Meetup&Contribution day. Naida V.Chernivtsi Magento Meetup&Contribution day. Naida V.
Chernivtsi Magento Meetup&Contribution day. Naida V.Elogic Magento Development
 
APIdays Helsinki 2019 - Impact of Microservices Architecture on API Managemen...
APIdays Helsinki 2019 - Impact of Microservices Architecture on API Managemen...APIdays Helsinki 2019 - Impact of Microservices Architecture on API Managemen...
APIdays Helsinki 2019 - Impact of Microservices Architecture on API Managemen...apidays
 
Volodymyr Kublytskyi - Develop Product, Design Platform
Volodymyr Kublytskyi - Develop Product, Design PlatformVolodymyr Kublytskyi - Develop Product, Design Platform
Volodymyr Kublytskyi - Develop Product, Design PlatformMeet Magento Italy
 
Flamingo presentation at code.talks commerce by Daniel Pötzinger
Flamingo presentation at code.talks commerce by Daniel PötzingerFlamingo presentation at code.talks commerce by Daniel Pötzinger
Flamingo presentation at code.talks commerce by Daniel PötzingerAOE
 
Jacopo Nardiello - From CI to Prod: Running Magento at scale with Kubernetes
Jacopo Nardiello - From CI to Prod: Running Magento at scale with KubernetesJacopo Nardiello - From CI to Prod: Running Magento at scale with Kubernetes
Jacopo Nardiello - From CI to Prod: Running Magento at scale with KubernetesMeet Magento Italy
 
How Customers are Building and Using their Own Connectors
How Customers are Building and Using their Own ConnectorsHow Customers are Building and Using their Own Connectors
How Customers are Building and Using their Own ConnectorsMuleSoft
 
Meet Magento Belarus - Elena Leonova
Meet Magento Belarus - Elena LeonovaMeet Magento Belarus - Elena Leonova
Meet Magento Belarus - Elena LeonovaAmasty
 
Flamingo - Inspiring Commerce Frontend made in Go - Meet Magento 2019
Flamingo - Inspiring Commerce Frontend made in Go - Meet Magento 2019Flamingo - Inspiring Commerce Frontend made in Go - Meet Magento 2019
Flamingo - Inspiring Commerce Frontend made in Go - Meet Magento 2019AOE
 
Micro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoniMicro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoniSandeep Soni
 
Decoupled Days 2019: Delivering Headless Commerce
Decoupled Days 2019: Delivering Headless CommerceDecoupled Days 2019: Delivering Headless Commerce
Decoupled Days 2019: Delivering Headless CommerceMatt Glaman
 
Moose.ai: migliorare la customer experience delle banche con un chatbot B2C &...
Moose.ai: migliorare la customer experience delle banche con un chatbot B2C &...Moose.ai: migliorare la customer experience delle banche con un chatbot B2C &...
Moose.ai: migliorare la customer experience delle banche con un chatbot B2C &...Paolo Montrasio
 
The Effect of Microservices on API Design
The Effect of Microservices on API DesignThe Effect of Microservices on API Design
The Effect of Microservices on API DesignLunchBadger
 
Serverless chatbot: from idea to production at blazing speed
Serverless chatbot: from idea to production at blazing speedServerless chatbot: from idea to production at blazing speed
Serverless chatbot: from idea to production at blazing speedPaolo Montrasio
 
API first Design and Microservices
API first Design and MicroservicesAPI first Design and Microservices
API first Design and MicroservicesSven Bernhardt
 
Software architecture in practice
Software architecture in practiceSoftware architecture in practice
Software architecture in practiceErwannWernli
 
APIdays Helsinki 2019 - The Future of the Dynamic Application Server, NGINX U...
APIdays Helsinki 2019 - The Future of the Dynamic Application Server, NGINX U...APIdays Helsinki 2019 - The Future of the Dynamic Application Server, NGINX U...
APIdays Helsinki 2019 - The Future of the Dynamic Application Server, NGINX U...apidays
 
[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native DeploymentWSO2
 

La actualidad más candente (20)

Experience in Magento Community Projects
Experience in Magento Community ProjectsExperience in Magento Community Projects
Experience in Magento Community Projects
 
James Zetlen - PWA Studio Integration…With You
James Zetlen - PWA Studio Integration…With YouJames Zetlen - PWA Studio Integration…With You
James Zetlen - PWA Studio Integration…With You
 
Chernivtsi Magento Meetup&Contribution day. Naida V.
Chernivtsi Magento Meetup&Contribution day. Naida V.Chernivtsi Magento Meetup&Contribution day. Naida V.
Chernivtsi Magento Meetup&Contribution day. Naida V.
 
APIdays Helsinki 2019 - Impact of Microservices Architecture on API Managemen...
APIdays Helsinki 2019 - Impact of Microservices Architecture on API Managemen...APIdays Helsinki 2019 - Impact of Microservices Architecture on API Managemen...
APIdays Helsinki 2019 - Impact of Microservices Architecture on API Managemen...
 
Volodymyr Kublytskyi - Develop Product, Design Platform
Volodymyr Kublytskyi - Develop Product, Design PlatformVolodymyr Kublytskyi - Develop Product, Design Platform
Volodymyr Kublytskyi - Develop Product, Design Platform
 
Flamingo presentation at code.talks commerce by Daniel Pötzinger
Flamingo presentation at code.talks commerce by Daniel PötzingerFlamingo presentation at code.talks commerce by Daniel Pötzinger
Flamingo presentation at code.talks commerce by Daniel Pötzinger
 
Jacopo Nardiello - From CI to Prod: Running Magento at scale with Kubernetes
Jacopo Nardiello - From CI to Prod: Running Magento at scale with KubernetesJacopo Nardiello - From CI to Prod: Running Magento at scale with Kubernetes
Jacopo Nardiello - From CI to Prod: Running Magento at scale with Kubernetes
 
How Customers are Building and Using their Own Connectors
How Customers are Building and Using their Own ConnectorsHow Customers are Building and Using their Own Connectors
How Customers are Building and Using their Own Connectors
 
Meet Magento Belarus - Elena Leonova
Meet Magento Belarus - Elena LeonovaMeet Magento Belarus - Elena Leonova
Meet Magento Belarus - Elena Leonova
 
Flamingo - Inspiring Commerce Frontend made in Go - Meet Magento 2019
Flamingo - Inspiring Commerce Frontend made in Go - Meet Magento 2019Flamingo - Inspiring Commerce Frontend made in Go - Meet Magento 2019
Flamingo - Inspiring Commerce Frontend made in Go - Meet Magento 2019
 
Micro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoniMicro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoni
 
Outlook on Magento 2
Outlook on Magento 2Outlook on Magento 2
Outlook on Magento 2
 
Decoupled Days 2019: Delivering Headless Commerce
Decoupled Days 2019: Delivering Headless CommerceDecoupled Days 2019: Delivering Headless Commerce
Decoupled Days 2019: Delivering Headless Commerce
 
Moose.ai: migliorare la customer experience delle banche con un chatbot B2C &...
Moose.ai: migliorare la customer experience delle banche con un chatbot B2C &...Moose.ai: migliorare la customer experience delle banche con un chatbot B2C &...
Moose.ai: migliorare la customer experience delle banche con un chatbot B2C &...
 
The Effect of Microservices on API Design
The Effect of Microservices on API DesignThe Effect of Microservices on API Design
The Effect of Microservices on API Design
 
Serverless chatbot: from idea to production at blazing speed
Serverless chatbot: from idea to production at blazing speedServerless chatbot: from idea to production at blazing speed
Serverless chatbot: from idea to production at blazing speed
 
API first Design and Microservices
API first Design and MicroservicesAPI first Design and Microservices
API first Design and Microservices
 
Software architecture in practice
Software architecture in practiceSoftware architecture in practice
Software architecture in practice
 
APIdays Helsinki 2019 - The Future of the Dynamic Application Server, NGINX U...
APIdays Helsinki 2019 - The Future of the Dynamic Application Server, NGINX U...APIdays Helsinki 2019 - The Future of the Dynamic Application Server, NGINX U...
APIdays Helsinki 2019 - The Future of the Dynamic Application Server, NGINX U...
 
[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment
 

Similar a Awesome architectures in Magento 2.3

How I ended up contributing to Magento core
How I ended up contributing to Magento coreHow I ended up contributing to Magento core
How I ended up contributing to Magento coreAlessandro Ronchi
 
Awesome Architectures in Magento 2.3
Awesome Architectures in Magento 2.3Awesome Architectures in Magento 2.3
Awesome Architectures in Magento 2.3Riccardo Tempesta
 
The lessons I learned contributing to #MagentoMSI
The lessons I learned contributing to #MagentoMSIThe lessons I learned contributing to #MagentoMSI
The lessons I learned contributing to #MagentoMSIAlessandro Ronchi
 
Architecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachArchitecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachBen Stopford
 
Microservice architecture : Part 1
Microservice architecture : Part 1Microservice architecture : Part 1
Microservice architecture : Part 1NodeXperts
 
CWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der walCWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der walCapgemini
 
Introduction to Serverless. Oracle Fn Project.
Introduction to Serverless. Oracle Fn Project.Introduction to Serverless. Oracle Fn Project.
Introduction to Serverless. Oracle Fn Project.Rolando Carrasco
 
MuleSoft London Community March 2018 - The power of the Crowd
MuleSoft London Community March 2018 - The power of the CrowdMuleSoft London Community March 2018 - The power of the Crowd
MuleSoft London Community March 2018 - The power of the CrowdPace Integration
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in GolangMo'ath Qasim
 
Software application architecture
Software application architectureSoftware application architecture
Software application architectureanwitat
 
Can low-code overturn this wisdom?
Can low-code overturn this wisdom?Can low-code overturn this wisdom?
Can low-code overturn this wisdom?LCDF
 
Technical-design-for-Angular-apps.pdf
Technical-design-for-Angular-apps.pdfTechnical-design-for-Angular-apps.pdf
Technical-design-for-Angular-apps.pdfSakthivelPeriyasamy6
 
Approaching risk management with your head in the cloud
Approaching risk management with your head in the cloudApproaching risk management with your head in the cloud
Approaching risk management with your head in the cloudCompatibL Technologies ltd
 
Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and S...
Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and S...Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and S...
Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and S...Alberto Salazar
 
locotalk-whitepaper-2016
locotalk-whitepaper-2016locotalk-whitepaper-2016
locotalk-whitepaper-2016Anthony Wijnen
 
Monoliths, Myths, and Microservices
Monoliths, Myths, and MicroservicesMonoliths, Myths, and Microservices
Monoliths, Myths, and MicroservicesMichael Ducy
 
Microservices with mule
Microservices with muleMicroservices with mule
Microservices with mulealfa
 
The Agile Roots of Microservices
The Agile Roots of MicroservicesThe Agile Roots of Microservices
The Agile Roots of MicroservicesMatt McLarty
 

Similar a Awesome architectures in Magento 2.3 (20)

How I ended up contributing to Magento core
How I ended up contributing to Magento coreHow I ended up contributing to Magento core
How I ended up contributing to Magento core
 
Awesome Architectures in Magento 2.3
Awesome Architectures in Magento 2.3Awesome Architectures in Magento 2.3
Awesome Architectures in Magento 2.3
 
The lessons I learned contributing to #MagentoMSI
The lessons I learned contributing to #MagentoMSIThe lessons I learned contributing to #MagentoMSI
The lessons I learned contributing to #MagentoMSI
 
Architecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachArchitecting for Change: An Agile Approach
Architecting for Change: An Agile Approach
 
Microservice architecture : Part 1
Microservice architecture : Part 1Microservice architecture : Part 1
Microservice architecture : Part 1
 
CWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der walCWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der wal
 
Introduction to Serverless. Oracle Fn Project.
Introduction to Serverless. Oracle Fn Project.Introduction to Serverless. Oracle Fn Project.
Introduction to Serverless. Oracle Fn Project.
 
MuleSoft London Community March 2018 - The power of the Crowd
MuleSoft London Community March 2018 - The power of the CrowdMuleSoft London Community March 2018 - The power of the Crowd
MuleSoft London Community March 2018 - The power of the Crowd
 
Let's talk about... Microservices
Let's talk about... MicroservicesLet's talk about... Microservices
Let's talk about... Microservices
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in Golang
 
Software application architecture
Software application architectureSoftware application architecture
Software application architecture
 
Can low-code overturn this wisdom?
Can low-code overturn this wisdom?Can low-code overturn this wisdom?
Can low-code overturn this wisdom?
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Technical-design-for-Angular-apps.pdf
Technical-design-for-Angular-apps.pdfTechnical-design-for-Angular-apps.pdf
Technical-design-for-Angular-apps.pdf
 
Approaching risk management with your head in the cloud
Approaching risk management with your head in the cloudApproaching risk management with your head in the cloud
Approaching risk management with your head in the cloud
 
Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and S...
Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and S...Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and S...
Devnexus - Nowadays Architecture Trends, from Monolith to Microservices and S...
 
locotalk-whitepaper-2016
locotalk-whitepaper-2016locotalk-whitepaper-2016
locotalk-whitepaper-2016
 
Monoliths, Myths, and Microservices
Monoliths, Myths, and MicroservicesMonoliths, Myths, and Microservices
Monoliths, Myths, and Microservices
 
Microservices with mule
Microservices with muleMicroservices with mule
Microservices with mule
 
The Agile Roots of Microservices
The Agile Roots of MicroservicesThe Agile Roots of Microservices
The Agile Roots of Microservices
 

Más de Alessandro Ronchi

Meet Magento IT 2021 - Principles & Advantages of Hexagonal Architecture on M...
Meet Magento IT 2021 - Principles & Advantages of Hexagonal Architecture on M...Meet Magento IT 2021 - Principles & Advantages of Hexagonal Architecture on M...
Meet Magento IT 2021 - Principles & Advantages of Hexagonal Architecture on M...Alessandro Ronchi
 
Some lessons learned contributing to #MagentoMSI
Some lessons learned contributing to #MagentoMSISome lessons learned contributing to #MagentoMSI
Some lessons learned contributing to #MagentoMSIAlessandro Ronchi
 
How I ended up touching Magento core
How I ended up touching Magento coreHow I ended up touching Magento core
How I ended up touching Magento coreAlessandro Ronchi
 
B2B & Magento: a long journey tale
B2B & Magento: a long journey taleB2B & Magento: a long journey tale
B2B & Magento: a long journey taleAlessandro Ronchi
 
Need to estimate? Let's play poker!
Need to estimate? Let's play poker!Need to estimate? Let's play poker!
Need to estimate? Let's play poker!Alessandro Ronchi
 
Why I did one step backward to go forward
Why I did one step backward to go forwardWhy I did one step backward to go forward
Why I did one step backward to go forwardAlessandro Ronchi
 
A true story about Magento best practices
A true story about Magento best practicesA true story about Magento best practices
A true story about Magento best practicesAlessandro Ronchi
 
Mageploy presentato al Mage::day() 2013
Mageploy presentato al Mage::day() 2013Mageploy presentato al Mage::day() 2013
Mageploy presentato al Mage::day() 2013Alessandro Ronchi
 

Más de Alessandro Ronchi (11)

Meet Magento IT 2021 - Principles & Advantages of Hexagonal Architecture on M...
Meet Magento IT 2021 - Principles & Advantages of Hexagonal Architecture on M...Meet Magento IT 2021 - Principles & Advantages of Hexagonal Architecture on M...
Meet Magento IT 2021 - Principles & Advantages of Hexagonal Architecture on M...
 
Some lessons learned contributing to #MagentoMSI
Some lessons learned contributing to #MagentoMSISome lessons learned contributing to #MagentoMSI
Some lessons learned contributing to #MagentoMSI
 
How I ended up touching Magento core
How I ended up touching Magento coreHow I ended up touching Magento core
How I ended up touching Magento core
 
B2B & Magento: a long journey tale
B2B & Magento: a long journey taleB2B & Magento: a long journey tale
B2B & Magento: a long journey tale
 
Need to estimate? Let's play poker!
Need to estimate? Let's play poker!Need to estimate? Let's play poker!
Need to estimate? Let's play poker!
 
Why I did one step backward to go forward
Why I did one step backward to go forwardWhy I did one step backward to go forward
Why I did one step backward to go forward
 
A true story about Magento best practices
A true story about Magento best practicesA true story about Magento best practices
A true story about Magento best practices
 
Magento best practices
Magento best practicesMagento best practices
Magento best practices
 
Mageday::2014 - Workshop
Mageday::2014 - WorkshopMageday::2014 - Workshop
Mageday::2014 - Workshop
 
Mageday::2014
Mageday::2014Mageday::2014
Mageday::2014
 
Mageploy presentato al Mage::day() 2013
Mageploy presentato al Mage::day() 2013Mageploy presentato al Mage::day() 2013
Mageploy presentato al Mage::day() 2013
 

Último

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Awesome architectures in Magento 2.3

  • 2. Awesome architectures in Magento 2.3 Alessandro Ronchi Bitbull @aleron75 This presentation has been realized with kind permission of Riccardo Tempesta (The Rick); the original one was presented by him at Meet Magento Germany 2019 and the slides you are seeing here are just a refactoring of his original work. Most of the content is the same, especially the jokes :)
  • 3. @MageTitansES @aleron75 And, in turn, most of the work presented here is built standing on the shoulders of heroes like the Magento architect you see here. - Igor Miniailo - Eugene Shakhsuvarov - Anton Kril If you are wondering where all this hero culture comes from…
  • 4. @MageTitansES @aleron75 http://bit.ly/flying-jason ...what would you expect from a community used to this? :)
  • 5. - COO at Bitbull - Mage Titans Italy organizer - Magento Master 2017, 2019 - Top 50 Contributor 2017, 2018 - Magento Community Maintainer Alessandro Ronchi @MageTitansES @aleron75 Never stop exploring! Just a couple of words about me.
  • 6. Agenda 1. The Magento legacy 2. Software architectures evolution 3. Evolution of Magento 2 4. Some applied concepts
  • 7. Confused about Magento development? We’ve heard that someone feels a bit stressed by developing on Magento 2 and this probably comes from a bit of confusion. Nevertheless I’ve talked with Mark, a 23yo guy, who told me that developing on Magento 2 is not stressful at all.
  • 8. “Being a Magento 2 developer is not stressful at all” ~ Mark, 23 years old @MageTitansES @aleron75 You can see the quote from Mark… And yes, you spotted out the joke because, actually, Mark is only 20yo :)
  • 9. CONFUSION from Latin: “cum” + “fusus” So where this stress come from? To understand, let’s see where this confusion comes from.
  • 10. M2 !== M1 It comes from the fact that M2 is not a revolution but an evolution of M1: M1 is our legacy, merged into M2. Despite this, we shouldn’t develop on M2 the same way we did on M1, here is where the confusion likely comes from.
  • 11. Software architecture evolution: 1990’s to 2010’s To better understand our legacy and the direction M2 is getting, let me briefly run through the evolution of software architectures of last decades. And indulge me to do it like any legit Italian should do it.
  • 12. Software architecture: 1990s @MageTitansES @aleron75 By making analogies with pasta :) In the ‘90s we had spaghetti coding, also known as “copy & paste” code.
  • 13. Software architecture: 1990s @MageTitansES @aleron75 - no standards - fast development - no maintenance At that time we had very few standards for web applications, the market required fast development and the concept of software maintenance was pretty new. As a result, code suffered from high coupling, we couldn’t change one piece of code without affecting another and, infact, we didn’t do it. Rather, we preferred to copy logic here and there because applying changes could have brought undesired side effects (known as regressions). Without tests, we couldn’t perform refactoring and w/o refactoring we couldn’t clean the kitchen, we couldn’t increase the quality and maintainability of our code.
  • 14. Software architecture: 2000s @MageTitansES @aleron75 Then we had the lasagna coding.
  • 15. Software architecture: 2000s @MageTitansES @aleron75 - bigger complexity - testability - scalability (as a whole) In the 2000s the market required more complex, testable and scalable web applications. We realized that we could obtain this by isolating some responsibilities into layers. So n-layered applications came out. Typical 3-layered: presentation, business logic, data handling. This architecture is not bad per se, this is how, for example, M1 was built. But there are some limitations: - not possible to scalable separately read/write - app deployed as a whole (monolithic application) - layers tend to reflect the data model, UIs are typically CRUD oriented
  • 16. Software architecture: 2010s @MageTitansES @aleron75 Finally we realized that we could split a monolith into smaller pieces, each with single specific responsibility, with something good inside exposed through public interfaces (APIs). It was time to serve ravioli!
  • 17. Software architecture: 2010s @MageTitansES @aleron75 - composition - independent deployability - independent scalability This kind of applications allows us to compose functionality, deploy and scale them independently. This is what we called Service Oriented Architectures and, more trendily, microservices.
  • 18. What about Magento 2 evolution? But is this the change M2 is embracing?
  • 19. @MageTitansES @aleron75 Yes and no. M2 is evolving; nowadays Magento Core Engineers prefer to speak of “service isolation”.
  • 20. Service Isolation Upsides 1. SCALABILITY 2. DEPLOYABILITY 3. REPLACEABILITY 4. UPGRADABILITY The key common adjective in this list is: independent
  • 21. BUT TODAY? Just let’s step back to current state of M2.
  • 22. @MageTitansES @aleron75 We already have replaceability, through DI, right?
  • 23. @MageTitansES @aleron75 ...that can brings us to situations like the one illustrated. This comes as a legacy from Magento 1 and it became evident thanks to DI. Why having all these dependencies (which btw is not good) was not evident before?
  • 24. final class Mage Because of the infamous “God” class of M1 It allowed a class to easily depend on other classes at the cost of “hiding” this dependency (while adding more and more responsibilities). DI made all these dependencies evident in M2 and revealed the architectural problems of M1: classes had too much responsibilities.
  • 25. @MageTitansES @aleron75 But we can have replaceability through modularity!
  • 26. MODULES !== MODULARITY Not quite: having modules doesn’t mean having a real modular architecture. Real modularity is the very first step towards Service Isolation.
  • 27. MODULARITY CONTEXT ISOLATION So let’s see what are the main features of modularity, because this is driving M2 evolution at date.
  • 28. @MageTitansES @aleron75 Bounded Contexts InventoryCatalog Checkout Customer ... Bounded Contexts is a concept that comes from Domain Driven Design; in brief: DDD is an approach to software development that helps us taking decisions about how to design our application speaking the ubiquitous language of the Domain Experts (our customer) and trying to avoid ambiguity and focusing on design simplification. A Bounded Context is a unit in which all the elements that we design have an ubiquitous meaning and possibly a single responsibility, allowing us to reach design simplification.
  • 29. Another Inventory @MageTitansES @aleron75 Bounded Contexts: replaceability Inventory Catalog Checkout Customer ... Isolating elements (concepts) in bounded context easily allows to obtain replaceability, one of the key goals of Service Isolation.
  • 30. @MageTitansES @aleron75 Bounded Contexts: example Catalog - sku - name - description ... Let’s see an example: the representation of a product in different contexts.
  • 31. @MageTitansES @aleron75 Bounded Contexts: example Catalog - sku - name - description ... Inventory - sku - physical qty - in stock ... Here we see that a product in different contexts can have different attributes.
  • 32. @MageTitansES @aleron75 Bounded Contexts: example Catalog - sku - name - description ... Inventory - sku - physical qty - in stock ... Checkout - sku - salable qty - unit price ... Different responsibilities, different behaviors, no need to generalize in a unique concept that would be: - charged with too many responsibilities - prone to ambiguity: what does a “qty” property represent? Physical availability? Salable quantity?
  • 33. @MageTitansES @aleron75 Bounded Contexts: example Catalog Product Inventory Source Item Checkout Quote Item In different contexts, the same concept maps to different entities. Different entities can be simpler, more specialized, less ambiguous.
  • 34. @MageTitansES @aleron75 Bounded Contexts in M2 http://bit.ly/mage2si So, for example, we can identify the Catalog Context in M2...
  • 35. @MageTitansES @aleron75 Bounded Contexts in M2 http://bit.ly/mage2si ...the Customer...
  • 36. @MageTitansES @aleron75 Bounded Contexts in M2 http://bit.ly/mage2si ...the Checkout...
  • 37. @MageTitansES @aleron75 Bounded Contexts in M2 http://bit.ly/mage2si ...and many more. This is the big picture of bounded contexts in M2.
  • 38. MODULARITY CONTEXT INTERACTIONS Once we have context isolation, we need contexts to interact with each other.
  • 39. @MageTitansES @aleron75 Contexts Interaction Inventory Sales How Inventory and Sales communicate?
  • 40. @MageTitansES @aleron75 Contexts Interaction in M1: coupled Inventory Sales MUTUAL DEPENDENCY This is how context interaction works in M1 (and still works in the majority of M2 codebase): we have mutual dependency between different contexts. That’s not what we want.
  • 41. @MageTitansES @aleron75 Contexts Interaction in M2: decoupled Inventory Sales Inventory Sales Uses plugins to add/change logic This, instead, is how ideally we can achieve decoupled context interaction in M2: through the usage of a specific context which makes the connection b/w two isolated contexts that don’t share anything with each other. This third element implements specialized business logic and can use plugins to interact with the other contexts.
  • 42. WHY PLUGINS? Let’s see why plugins are the best choice by looking at alternatives.
  • 43. @MageTitansES @aleron75 Observers: why not Extension point Observer Event Event Extension point - soft dependencies - rely only on existing extension points Observers don’t allow us to define hard evident dependencies meaning that, if the event that is observed is not dispatched, the observer is not triggered. If something is not working we don’t have evidence of that. Furthermore, we can only rely on extension points that have been previously defined: no event triggered, no extension point.
  • 44. @MageTitansES @aleron75 Preferences: why not always - some classes still do too much - can be used on single responsibility classes - all or none MANY RESPONSIBILITIES TOO MANY POTENTIAL SIDE EFFECTS SINGLE RESPONSIBILITY (WHEN AVAILABLE) Preferences allow us to replace a core class with our own implementation. That can work sometimes but the truth is that a lot of classes in M2 still have a lot of responsibilities; replacing a class means taking the ownership of all its business logic. Maybe we need to change only a few behaviors. Through preferences, there can be only one class replacing another at the same time, no space for others.
  • 45. @MageTitansES @aleron75 Plugins: the best option - hard & explicit dependencies - no extension point needed (more or less) - work at method level Plugins are the best option, because they don’t have the drawbacks seen: - dependency is hard and explicit because we declare the class which we are pluginizing by passing it as the $subject parameter - we don’t need the core team to have foreseen the possible extension point because we can pluginize every public method (read more here) - they work at method level and multiple plugins can coexist on the same class and even on the same method
  • 46. MODULARITY API FIRST Last, but not least, real modularity can be achieved by designing a system that rely on abstractions, that is, interfaces or, in other words, APIs.
  • 48. API / Interface Concrete implementation @MageTitansES @aleron75 API first
  • 50. @MageTitansES @aleron75 API first: replaceability MyModuleApi MyModule AnotherModule - modules only depend on abstractions Again, depending on abstractions allows us to obtain replaceability
  • 51. @MageTitansES @aleron75 API first Here is an example of an “Interface-only” module
  • 52. @MageTitansES @aleron75 API first And here an example of the dependencies form interface modules declared in composer.json
  • 53. @MageTitansES @aleron75 API first: modules splitting http://bit.ly/mage2si This is a picture made among others by Anton Kril, Director of Architecture at Magento, that summarizes the possible scenarios before and after applying this approach. You can find this and other diagrams in the Service Isolation repository linked before: http://bit.ly/mage2si
  • 54. @MageTitansES @aleron75 Modules splitting: so many modules! MSI is 40+ modules, so far... A consequence of this approach is the growing number of modules required to implement a functionality.
  • 55. @MageTitansES @aleron75 Service isolation ...first reaction... The first reaction may be panic....
  • 56. @MageTitansES @aleron75 Service isolation ...second reaction... ...or even worse: rejection...
  • 57. @MageTitansES @aleron75 Service isolation ...but finally, the aha! ...but once we realize the benefits of such approach we eventually can appreciate it.
  • 58. WHY IS THIS AMAZING? We are just trading simplicity for something else...
  • 59. @MageTitansES @aleron75 Service isolation FULL MODULAR SYSTEM This approach allows us to have: - full modularity
  • 60. FULL MODULAR SYSTEM CLEAR CONTEXT BOUNDARIES @MageTitansES @aleron75 Service isolation This approach allows us to have: - full modularity - clear context boundaries
  • 61. FULL MODULAR SYSTEM CLEAR CONTEXT BOUNDARIES EASY TO FIND RESPONSIBILITIES @MageTitansES @aleron75 Service isolation This approach allows us to have: - full modularity - clear context boundaries - classes that are easier to find because they have fewer responsibilities, located in proper namespaces
  • 62. FULL MODULAR SYSTEM CLEAR CONTEXT BOUNDARIES EASY TO FIND RESPONSIBILITIES REPLACEABILITY @MageTitansES @aleron75 Service isolation This approach allows us to have: - full modularity - clear context boundaries - classes that are easier to find because they have few responsibilities located in proper namespaces - we get replaceability, making it easier to override entire parts of core module
  • 63. FULL MODULAR SYSTEM CLEAR CONTEXT BOUNDARIES EASY TO FIND RESPONSIBILITIES REPLACEABILITY INDEPENDENT SCALABILITY @MageTitansES @aleron75 Service isolation This approach allows us to have: - full modularity - clear context boundaries - classes that are easier to find because they have few responsibilities located in proper namespaces - we get replaceability, making it easier to override entire parts of core module - and finally, we can scale pieces of application independently thanks to DB isolation
  • 64. DB ISOLATION Let’s see how DB isolation works
  • 65. @MageTitansES @aleron75 DB isolation: foreign keys? FK Source Item product_id product_id Product In Magento 1 (and still in the majority of Magento 2 as well), we can’t split the DB not to break referential integrity.
  • 66. FK Source Item product_id product_id Product FK: THE DATABASE MUST BE THE SAME @MageTitansES @aleron75 DB isolation: foreign keys? Because of this “internal” link, different parts of the application must share the same DB.
  • 67. Source Item sku sku Product @MageTitansES @aleron75 DB isolation: foreign keys? use business keys: no DB dependency So what can we do to avoid problems with foreign keys? Get rid of them! Using business keys, instead.
  • 68. Source Item sku sku Product use business keys: no DB dependency @MageTitansES @aleron75 DB isolation: foreign keys? Pay attention, this comes at a cost: we lose something, of course, because we are entering in the field of distributed systems where immediate data consistency is not always guaranteed.
  • 69. THE CAP THEOREM The Cap Theorem, also known as Brewer’s Theorem.
  • 70. @MageTitansES @aleron75 The CAP theorem Reference: https://www.dataversity.net/acid-vs-base-the-shifting-ph-of-database-transaction-proc essing/ There are three essential system requirements necessary for the successful design, implementation and deployment of distributed applications. They are Consistency, Availability and Partition Tolerance – or CAP: - Consistency: all nodes see the same data at the same time - Availability: node failures don’t prevent the system to continue working - Partition Tolerance: network failures don’t prevent the system to continue working CA: typical of ACID systems (Atomicity, Consistency, Isolation, Durability: M1) - not good for scaling CP: typical of BASE systems (Basically Available, Soft state, Eventual consistency: M2)
  • 71. in distributed systems we can guarantee only two! @MageTitansES @aleron75 The CAP theorem The CAP Theorem states that in distributed systems we can guarantee only two of the three requirements. Magento 1 is an ACID system where we have Consistency and Availability guaranteed.
  • 72. in large scalable distributed systems we give up on immediate consistency @MageTitansES @aleron75 The CAP theorem The Service Isolated architecture towards which Magento 2 is evolving requires it to abandon Immediate Consistency shifting from an ACID to a BASE system.
  • 73. in large scalable distributed systems we rely on eventual consistency @MageTitansES @aleron75 The CAP theorem Eventual Consistency means that the system will eventually become consistent once it stops receiving input. The data will propagate to everywhere it should sooner or later, but the system will continue to receive input and is not checking the consistency of every transaction before it moves onto the next one. Examples of eventual consistency we experience everyday as users: - Dropbox - Git - Google Docs
  • 74. We read data from hereWe write data here Separate contexts can have different representation of an information. Data projection doesn’t happen necessarily in real-time and can take some time. DATA PROJECTION @MageTitansES @aleron75 Eventual consistency A diagram illustrating how data becomes consistent b/w different systems.
  • 75. @MageTitansES @aleron75 Eventual consistency http://bit.ly/eventualc Don’t forget to follow Greg Young and read all his articles and books if you are interested in DDD, CQRS, Event Sourcing, etc.
  • 76. Is this the real life? Is this just fantasy? Let me anticipate a question that can come from the audience. All the ideas expressed here are the result of how Magento Inventory (formerly MSI) is developed and chances are that the future architecture of Magento 2 (or should we call it Magento 3?) is going towards this. As an old Chinese saying tells us: "A journey of a thousand miles begins with a single step"
  • 77. @MageTitansES @aleron75 Reference: MSI Magento Inventory http://bit.ly/mageinventory That’s why I heavily recommend to start looking at the Magento Inventory Project.
  • 78. Good reads http://bit.ly/dsbook1 http://bit.ly/dsbook2 http://bit.ly/dsbook3 FREE! Here are some recommended books about distributed systems: - Designing Data-Intensive Applications http://bit.ly/dsbook1 - Building Microservices http://bit.ly/dsbook2 - Distributed Systems (introductory, easy, free, must read!) http://bit.ly/dsbook3
  • 79. What I learned 1. M2: CONTINUOUS IMPROVEMENT 2. SERVICE ISOLATION 3. DISTRIBUTED SYSTEM (M3?) 4. LEARN BY CONTRIBUTING To recap the lessons learned: - Magento is under continuous improvement - At date, Service Isolation is the number one goal of architectural evolution - In the future, Magento could become a distributed platform - All the information provided in this presentation (and many, many more) were learned by contributing to the Magento core
  • 80. “there’s no better way to learn!” Paraphrasing a famous flying company, contributing is the better way to learn (in my opinion).
  • 81. @MageTitansES @aleron75 Get involved in the evolution! It’s up to you: hate or help! https://magentocommeng.slack.com/messages#appdesign Jump in, if you want.
  • 82. I thank you all! Alessandro Ronchi Bitbull @aleron75 “You brought me fame and fortune and everything that goes with it. I thank you all” ~ Freddy Mercury