a scaling & supple architecture
for your growing and complex domains
@tpierrain
@Julientopcu
BACK«
TO
THE
BBOM
Hexagonal Architecture!
Domain
Adapter
Adapter
Docker
ISTIO
KUBERNETES
Booking
ACL
CF
CF
U
D
Money
Search
Booking
ACL
CF
CF
U
D
Money
Search
WE LIED TO OURSELVES
thinking we could rewrite it in a few days
Money
Search
Booking
Money
Search
Booking
Money
Search
Booking
ACL
CF
CF
U
D
Money
Search
Booking
Money
Search
Booking
Search
Money
Booking
BACK«
DISTRIBUTED EDITION
TO
THE
BBOM
Going in circle!
Everyone wants to modularize nowadays
Bounded-contexts
can still be incorrect
Money
Search
CF
Booking
ACL
CF
µ
Booking
µ
Search
Bounded-contexts
can still be incorrect
All models are wrong...
Money
Booking
Search
Shopping?
µ
Search
µ
Booking
Accept that boundaries can be blurry
Money
Search
Booking
Bounded-Contexts
won’t save...
badly designed
are not a design strategy...
but rather a deployment one
Flexible architecture
enabling iterative redesign
Agnostic of deployment strategies
Julien Topçu
Thomas Pierrain
@tpierrain
@Julientopcu
an implementation pattern
for your modular systems
1module
=
=
1 Bounded
Context
1
1deployment unit
=
a fractal pattern
experimentation Space
with low-cost mistakes
Distributed systems are
(too) expensive to modify
allows room for reversible mistakes
the uncertainty of our design
helps us better manage
Classical modules
are not isolated enough!
designed to be easily extracted!
Highly Bounded modules
loosely coupled to each other
Encapsulation is gold...
for enabling change
Ports & Adapters
Search
Booking
API
API
to the rescue!
INPROC
SPI
Inspired by Alistair Cockburn's pattern
Port
Adapter
REST
REST
API
API
DB
SPI
DB
SPI
Booking
Search
DB
SPI
Search
REST
API
DB
SPI
Booking
REST
API
DB
SPI
Search
REST
API
DB
SPI
Booking
REST
API
DB
SPI
Search
REST
API
DB
SPI
Booking
REST
ACL
SPI
INPROC
API
REST
API
DB
SPI
Search
REST
ACL
API
SPI
DB
SPI
Booking
INPROC
Booking
DB
Search
DB
Search
Booking
=
1exclusive
1
composable architecture
aligned with our context map
ACL
CF
CF
Money
Search
Booking
ACL
Money
(lib)
Search
Booking
CF
CF
Anticorruption layer
INPROC (infrastructure)
Booking Module
SPI
Search Module
API
Domain
Domain
Anticorruption layer
INPROC (infrastructure)
SPI
API
Selection
Train
Train
Selection
getTrainsToBook()
getTrainsToBook()
(impl)
getSelection()
ACL
Domain
Domain
Booking Module
Search Module
INPROC (infrastructure)
Booking Module
SPI
Search Module
API
Domain
Domain
CONFORMIST
Selection
getSelection()
CONFORMIST
Booking
Search
API
Selection
getSelection()
Selection
Selection
getSelection()
getSelection()
Selection
PASSTHROUGH
Selection
INPROC
Booking
SPI
Search
API
Selection
getSelection()
REST
REST
CF
API
API
DB
SPI
DB
SPI
Search
Booking
CONFORMIST (lib)
Money
(lib)
CF
CONFORMIST (lib)
Money
(Lib)
Booking
Price
Discount
Amount
Currency
Amount
Currency
Amount
Currency
CONFORMIST (lib)
Money
(Lib)
Booking
Price
Discount
Amount
Currency
SHARED-KERNEL (lib)
Shared-Kernel
(lib)
Booking
Search
Search
Booking
Comfort
Class
Schedule
Comfort
Class
Schedule
Comfort
Class
Schedule
SHARED-KERNEL (lib)
Shared-Kernel
(lib)
Search
Booking
Comfort
Class
Schedule
Comfort
Class
Schedule
Comfort
Class
Schedule
Booking
Search
Bounded-contexts with domain Services
must be implemented using hexagons
SHARED-KERNEL (DB)
DISCOURAGED!
Booking
SPI
DB
Search
Travelers
(SK)
DB
SPI
REPOSITORY (adapter)
Booking
SPI
Traveler
getTraveler()
Traveler
Travelers (SK)
SPI
Search
getTraveler()
(impl)
Select * from Travelers
getTraveler()
Traveler
REPOSITORY (Adapter)
getTraveler()
(impl)
Select * from Travelers
SHARED-KERNEL (DB)
DISCOURAGED!
Embracing Changes
& Design breakthroughs
Wrong bounded-contexts split
Traditional (not HIVED)
Wrong bounded-contexts DESIGN
Traditional (not HIVED)
Harder, Riskier, "Expensiver"
Traditional (not HIVED)
Incorrect Interfaces
API
SPI
Refactoring
SPI
API
Network breaking changes
distributed release
Traditional (not HIVED)
EXPLICIT
MAke the Implicit
...
Money
Booking
Search
Shopping?
Ready to
Scale
Ready to
Scale
Out
Ready to
Scale
Out
REST
CF
API
DB
SPI
Search
REST
ACL
API
SPI
DB
SPI
Booking
INPROC
CF
Money
REST
CF
API
DB
SPI
Search
ACL
SPI
DB
SPI
Booking
CLIENT
REST
API
µ
Search
µ
Booking
Money
(lib)
CF
Ready to
Scale
IN
ACL
CF
CF
Money
Search
Booking
ACL
CF
Search
Booking
Location
ACL
Money
CF
REST
ACL
API
SPI
DB
SPI
INPROC
REST
CF
API
DB
SPI
Search
Booking
CF
Money
(lib)
REST
API
DB
SPI
REST
CF
API
DB
SPI
Search
Booking
DB
SPI
API
ACL
SPI
INPROC
ACL
SPI
INPROC
Location
CF
Money
(lib)
a fractal pattern
a fractal pattern
a fractal pattern
When the pattern applies
Illustrations & Usecases
Taking control back
of legacy monolith by tidying code
classical Legacy
Bbom monolith
ongoing modularization
First empty Hexagon
ongoing modularization
First Hexagon
ongoing modularization
Modular monolith with “hexagons” inside
split in various services
Green Field
start with a modular monolith
Growing complexity
Green Field
Multiple services
Green Field
Multiple services
Green Field
Blurred boundaries
Green Field
Model Mitosis
Shared Kernel
For blurred boundaries
SK
Model Mitosis
For blurred boundaries
Model Mitosis
For blurred boundaries
Brown Field
Modularize your monolith
Green Field
Start with a modular monolith
Challenges
Avoid multi Teams
modular monoliths
at all cost
Beware of
monolith inertia
Avoid multi Teams
modular monoliths
Split
your Hive
Avoid multi Teams
modular monoliths
Beware of
monolith inertia
Avoid Chattiness
between modules
(RPC trap)
YOUR Test Suite may be
a hidden monolith...
Production code
TESTS
The hidden Monolith
Production code
TESTS
Tests must be modularized
Production code
TESTS
with the same level of quality as the production code
Infrastructure deserves
the same level of attention as the domain
LAck of
datastore isolation
Experimentation Sandbox
Flexible & Composable
cohesive & Loosely coupled modules
Scaling ready
deployment agnostic
fractal
Testable designs
& tidy tests
Embracing change
& design break throughs
ACL
CF
CF
U
D
Money
Search
Booking
the MISSING LINK between
strategic design and deployment strategies
ACL
CF
CF
Money
Search
Booking
Model first
Deploy as you wish!
Booking
ACL
CF
CF
Money
Search
Julien Topçu
Thomas Pierrain
@tpierrain
@Julientopcu
Annexe:
Le couplage liés aux aggrégats qui traversent les frontières des modules. Viol d'encapsulation, on permet à un module externe de modifier l'aggrégat. Il faut retourner des read model de nos aggrégats
modules configuration isolation
db pooling & Settings
Cross-domain integration tests
(Workflow testing)
Model Mitosis
Handling the uncertainty of your boundaries
Model Mitosis
Handling the uncertainty of your boundaries
Model Mitosis
Shared Kernel
Model Mitosis
Shared Kernel
Model Mitosis
Shared Kernel
Model Mitosis
Shared Kernel
Model Mitosis
Anticorruption layer
INPROC
Booking
SPI
Search
API
Selection
Draft
Booking
Draft
Booking
Selection
DraftABooking()
DraftABooking()
(impl)
getSelection()
ACL
We forgot to do software design!
The Hive: a scaling and supple architecture style for your growing and complex domain
By Julien Topçu
The Hive: a scaling and supple architecture style for your growing and complex domain
In a landscape of scaling domain complexity and evolving responsibilities, organizations often grapple with the question of whether to adopt microservices. The ubiquity of Big Ball of Mud (BBOM) monoliths has reshaped the conversation, challenging conventional notions of system design. However, the deployment strategy for bounded contexts remains elusive. How to split it right by avoiding the pitfalls of a distributed big ball of mud ? How to ensure the cohesion and consistency of our bounded-contexts ? How to reduce coupling between them ? How to deal with the growing complexity of your system ? How to survive beyond our modeling debt and take control back ? Discover the Hive architecture style, a tactical approach that enables you to cope your strategic challenges and align your software business core with your context map. This pattern decouples your deployment strategy from your strategic design, adhering to the principle of “Model once, Deploy as you wish”. By rationalizing the relationship between bounded-contexts and services, the Hive pattern will bring you a supple and scalable design that stands resilient in the face of evolving challenges for brown or greenfield products.
- 362