Beyond Microservices
Eberhard Wolff
@ewolff
http://ewolff.com
Fellow
http://continuous-delivery-buch.de/ http://continuous-delivery-book.com/
http://microservices-buch.de/ http://microservices-book.com/
http://microservices-book.com/
primer.html
http://microservices-buch.de/
ueberblick.html
FREE!!!!
What are
Microservices?
Modules Processes
Independent
Continuous
Delivery Pipeline
Standardized
Operations
Resilience
Microservices
Why Microservices?
!
Technological
Benefits
"
Decoupling
> Originally: Changing
a module does not
influence other
modules.
> i.e. independent
development
Microservice Decoupling
> Independent scaling
> Independent
technical decisions
> Decoupled crashes
> Security: firewalls etc
Clean Architecture
Developer
Developer
REST REST
ECommerce
System
Order
Catalog
Billing
Search
ECommerce
System
Order
Catalog
Billing
Search
ECommerce
System
Catalog
Billing
Search
ECommerce
System
Order
Catalog
Billing
Search
Replace if messed up.
Replaceability
> Small components hard to mess up
> Each module can be replaced
> …small green field project
> ...different technology stack possible
Continuous Delivery
Microservices
ECommerce
System
3rd party
systems
Database
Microservices
3rd party
systems
Database
Order
Catalog
Billing
Search
Order
Billing
Customer
Commit
Stage
Automated
Acceptance
Testing
Automated
Capacity
Testing
Manual
Explorative
Testing
Release
Commit
Stage
Automated
Acceptance
Testing
Automated
Capacity
Testing
Manual
Explorative
Testing
Release
Commit
Stage
Automated
Acceptance
Testing
Automated
Capacity
Testing
Manual
Explorative
Testing
Release
Build Pipeline for
Microservices
> Build pipeline per Microservice
> Smaller
> Easier to set up
> Less features (3rd party systems)
> Faster Feedback: Less tests
Decoupled
Development
Decoupled
Scalability
Decoupled
Technical
decisions
Decoupled
Crashes
Security
Architecture
Firewalls
Replaceability
Continuous
Delivery
Technological Benefits
Organizational
Benefits
"
Deployment Monolith
Stories
Technical Coordination
Coordinating Releases
Microservice
Stories
Technical
Coordination
Stories
Technical
Coordination
Stories
Technical
Coordination
Order Billing Search
Release Release Release
Inverse Conway Maneuver
> Architecture drives organization
> Cross-functional team (database, logic, UI)
> Team responsible for Bounded Context(s)
Take one huge project
and make it several
small projects…
Self-organization
> With so much independence…
> ...teams can decide for themselves.
> Self-organization
Inverse Conway
Maneuver
Independent
Technologies
Independent
Bounded
Contexts
Self-
organization
Organizational Benefits
Microservices:
Challenges
#
Consistency
Order
Invoice
Delivery
What about
order #42?
✅
✅
❌
Consistency
Order
Invoice
Delivery
Order #42
is cancelled!
✅
✅
⁉
Goods might be delivered
if order arrives
after cancellation.
This is quite common
without
microservices.
Customer Order Catalog
Domino Effect
Customer Order Catalog
Domino Effect
Customer Order Catalog
Domino Effect
Customer Order Catalog
Domino Effect
Build resilient
microservices!
Refactorings
> Move code to a new service: Easy
> Move code from service to service
> Might be a port to a different language
> Hard
Global Refactorings
> Really hard: Global restructuring
> i.e. moving everything to a different place.
> …but that is always hard…
> ...and the result of a major screwup.
> Do you want to optimize for this?
Many New Technologies
> Microservices framework
> Service discovery
> Routing / API Gateway
> Continuous Delivery pipeline
> Docker
> Docker scheduler (Kubernetes)
> ....
Challenges
Consistency Fail safeness
Large scale
refactoring
New
Technologies
Microservices are an
all or nothing
approach.
Microservices are an
all or nothing
approach.
Which benefits are
important?
Which challenges
acceptable?
Moving beyond
Microservices:
Rightsize the
achitecture!
Alternative
Approaches
Centralized DB
Billing
Order
Process
CRM
OrderOrder Order
True Microservices
Shared Database
Order Schema
Billing
Order
Process
CRM
Modules
--
Processes
++
Independent
Continuous
Delivery Pipeline
+
Standardized
Operations
-
Resilience
-
Shared Database:
Microservices
Decoupled
Development
--
Decoupled
Scalability
+
Decoupled
Technical
decisions
+
Decoupled
Crashes
+
Security
-
Architecture
Firewalls
-
Replaceability
--
Continuous
Delivery
-
Technological Benefits
Inverse Conway
Maneuver
-
Independent
Technologies
+
Independent
Bounded Contexts
--
Self-organization
-
Organizational Benefits
Challenges
Consistency
++
Fail safeness
-
Large scale
refactoring
-
New
Technologies
-
-
Centralized Database
is a bad idea.
Layered
Layered
iOS Android Web
Order Product Delivery
InvoiceCustomer
Layered: Issues
> Changing a business process cause many
changes
> …in Frontend and many backend
> Lots of communication between teams and
components
Modules
++
Processes
++
Independent
Continuous
Delivery Pipeline
++
Standardized
Operations
++
Resilience
+
Microservices
Decoupled
Development
-
Decoupled
Scalability
-
Decoupled
Technical decisions
++
Decoupled Crashes
+
Security
+
Architecture
Firewalls
+
Replaceability
+
Continuous Delivery
-
Technological Benefits
Inverse Conway
Maneuver
--
Independent
Technologies
++
Independent
Bounded Contexts
--
Self-organization
--
Organizational Benefits
Challenges
Consistency
+
Performance
--
Fail safeness
--
Large scale
refactoring
--
New Technologies
--
Layered:
More challenges,
less benefits,
same effort
Bounded Context
Microlith
SCS
Order
Shipping address
Tracking #
Items
Item Categories
Priority shipping
Customs #
Account #
...
Credit card #
Order #
My Domain Model is a
mess!
Bounded Context
> Domain model is only valid for one context
> There is no universal data model!
> See all failed SOA attempts
Order
Shipping address
Tracking #
Items
Item Categories
Priority shipping
Customs #
Account #
...
Credit card #
Order #
Customs
Order
Recommen-
dations
Order
Tracking
Order
Shipping
address
Tracking #
Item
Categories
Priority
shipping
Customs #
Payment
Order
Account #
Credit card #
Self-contained Systems
Search Invoice LogisticsCheckout
Web Web Web Web
See http://scs-architecture.org
Modules
++
Processes
++
Independent
Continuous
Delivery Pipeline
++
Standardized
Operations
++
Resilience
+
Microservices
Decoupled
Development
++
Decoupled
Scalability
++
Decoupled
Technical decisions
++
Decoupled Crashes
++
Security
++
Architecture
Firewalls
+
Replaceability
+
Continuous Delivery
++
Technological Benefits
Inverse Conway
Maneuver
++
Independent
Technologies
++
Independent
Bounded Contexts
++
Self-organization
++
Organizational Benefits
Challenges
Consistency
+
Performance
++
Fail safeness
++
Large scale
refactoring
+
New
Technologies
+
Microservices as they
should be.
Modules with
Maven
Architecture Management
OSGi
WAR
Build order /
Architecture
management
Build order /
Architecture
management
Modules
+
Processes
--
Independent
Continuous
Delivery Pipeline
-
Standardized
Operations
++
Resilience
-
Microservices
Decoupled
Development
+
Decoupled
Scalability
--
Decoupled
Technical decisions
--
Decoupled Crashes
--
Security
--
Architecture
Firewalls
++
Replaceability
+
Continuous Delivery
+
Technological Benefits
Inverse Conway
Maneuver
+
Independent
Technologies
--
Independent
Bounded Contexts
++
Self-organization
-
Organizational Benefits
Challenges
Consistency
-
Performance
++
Fail safeness
-
Large scale
refactoring
++
New
Technologies
++
Clean architecture
with a lot less
technical challenges!
Conclusion
Conclusion
> Microservices are a set of architecture
decision
> Architecture is about trade-offs
> Architecture is different for each project
> Go beyond microservices by picking the
best decisions!
> …and gain most benefits
Usually bad tradeoffs
> Centralized database
> Layered model
Usually good tradeoffs
> SCS, Bounded Context, Microlith
> Strongly separated modules

Beyond Microservices