SlideShare a Scribd company logo
1 of 45
Download to read offline
Microservices
stress-free and without increased heart-attack risk

Uwe Friedrichsen, codecentric AG, 2015
@ufried
Uwe Friedrichsen | uwe.friedrichsen@codecentric.de | http://slideshare.net/ufried | http://ufried.tumblr.com
I must do µservices!
No, you don’t!
µServices are an architectural choice
When do I need µservices?
The need for speed
The need for speed
Autonomous teams
µServices
DevOps
Continuous Delivery
Cloud
Craftsmanship
…
The need for speed
Autonomous teams
µServices
DevOps
Continuous Delivery
Cloud
Craftsmanship
…
Can’t I just go for µservices
without all that other stuff?
Of course you can, but you shouldn’t …

… because you would pay the full price for µservices and hardly gain anything
What is the price for µservices?
Well, ever heard about µservice hell?
A single µservice is easy …
… but the complexity of the business functionality remains the same
☛ Complexity is shifted from single µservices to µservice collaboration
µServices are usually self-contained …
… i.e., µservices are independent runtime processes
☛ This results in a highly interconnected, distributed system landscape
Consequences


•  Design is more challenging
•  Implementation is more challenging
•  Distributed systems are challenging
•  Lookup
•  Liveness
•  Partitioning
•  Latency
•  Consistency
•  …
•  New challenges for “monolith developers”

à µServices are not easy at all
How can we avoid µservice hell?
No silver bullet
Topic areas




Design
Interfaces
User Interface
Frameworks
Datastores
Developer Runtime Environment
Deployment
Production
Resilience
"It seems as if teams are jumping on µservices because they're sexy, but the
design thinking and decomposition strategy required to create a good
µservices architecture are the same as those needed to create a well
structured monolith.

If teams find it hard to create a well structured monolith, I don't rate their
chances of creating a well structured µservices architecture.”

- Simon Brown



http://www.codingthearchitecture.com/2014/07/06/distributed_big_balls_of_mud.html
"In theory, programming languages give us all we need to encapsulate state
and environment - we just need to use them well.

Maybe we just don’t have the discipline? Maybe we had to explicitly advocate
the practice of writing services running in completely different environments
using different languages to trigger the sort of encapsulation that we want? If
that’s the case, we can either see it as a clever self-hack or something we were
forced into by the fact that we programmers are adept at overcoming any
sort of self-discipline we try to impose on ourselves.

Perhaps both are true.”

- Michael Feathers

https://michaelfeathers.silvrback.com/microservices-and-the-failure-of-encapsulaton
Design






•  Master modularization first
•  Use bounded contexts as a modularization starting point
•  Forget about layered architecture
•  Rethink DRY – avoid deployment dependencies
”If every service needs to be updated at the same
time it’s not loosely coupled”

- Adrian Cockcroft



http://de.slideshare.net/adriancockcroft/dockercon-state-of-the-art-in-microservices
Interfaces






•  Plan for interface evolution
•  Remember Postel’s law
•  Consider API gateways
•  Synchronous vs. asynchronous
µS
Request/Response : Horizontal slicing
Flow / Process
µS
 µS
µS
 µS
 µS
µS
Event-driven : Vertical slicing
µS
 µS
µS
µS
 µS
Flow / Process
User Interface






•  The single UI application is history
•  Separate UI and services by default
•  Decouple via client centric API gateway
•  Including UI in service can make sense in special cases
Bounded
Context
Bounded
Context
Bounded
Context
µS
µS
µS
µS
µS
µS
µS
µS
µS
µS
µS
µS
µS
µS
µS
UI

e.g., B2C-Portal
UI

e.g., embedded in
Partner-Portal
UI

e.g., Mobile App
UI

e.g., Clerk Desktop
API Gateway
 API Gateway
 API Gateway
Frameworks






•  Not the most important issue of µservices
•  Should support at least uniform interfaces, observability, resilience
•  Nice if also support for uniform configuration and discoverability
•  Spring Boot/Cloud, Dropwizard, Netflix Karyon, …
Datastores






•  Avoid the “single, big database”
•  Avoid distributed transactions
•  Try to relax temporal constraints (and make actions idempotent)
•  Treat your storage as being “ephemeral”
Development Runtime Environment






•  Developers should be able to run the application locally
•  Provide automatically deployable “development runtime environment”
•  Containers are your friend
•  Make sure things build and deploy fast locally
Deployment






•  Continuous deployment pipeline is a must
•  Unify deployment artifact format
•  Use either IaC tool deployment …
•  … or distributed infrastructure & scheduler
Production readiness







•  You need to solve at least the following issues
•  Configuration, Orchestration, Discovery, Routing, Observability, Resilience
•  No standard solution (yet) in sight
•  Container management infrastructures evolve quickly
Configuration
•  Netflix Archaius

Orchestration
•  Apache Aurora on Apache Mesos
•  Marathon
•  Kubernetes
•  Fleet

Discovery
•  Netflix Eureka
•  Apache ZooKeeper
•  Kubernetes
•  Etcd
•  Consul
Routing
•  Netflix Zuul & Ribbon
•  Twitter Finagle

Monitoring
•  Hystrix
•  Twitter Zipkin (Distributed Tracing)

Measuring
•  Dropwizard Metrics

Logging
•  ELK
•  Graylog2
•  Splunk
A distributed system is one in which the failure
of a computer you didn't even know existed
can render your own computer unusable.

Leslie Lamport
Failures in complex, distributed, interconnected
systems are not an exceptional case

•  They are the normal case

•  They are not predictable

•  They are not avoidable
µService systems are
complex, distributed, interconnected systems
Failures in µservice systems

are not an exceptional case

•  They are the normal case

•  They are not predictable

•  They are not avoidable
Do not try to avoid failures. Embrace them.
resilience (IT)

the ability of a system to handle unexpected situations
-  without the user noticing it (best case)
-  with a graceful degradation of service (worst case)
Resilience






•  Resilient software design is mandatory
•  Start with isolation and latency control
•  Add automated error recovery and mitigation
•  Separate control and data flow
Event/data flow
 Event/data flow
Resource access
Error flow
 Control flow
µS
Isolation
Separation of control/error
and data/event flow
W
Flow / Process
W
 W
W
 W
 W
 W
W
S
 S
 S
S
S
Escalation
Isolation
Latency Control
Fail Fast
Circuit Breaker
Timeouts
Fan out &
quickest reply
Bounded Queues
Shed Load
Bulkheads
Loose Coupling
Asynchronous
Communication
Event-Driven
Idempotency
Self-Containment
Relaxed
Temporal
Constraints
Location
Transparency
Stateless
Supervision
Monitor
Complete
Parameter
Checking
Error Handler
Escalation
Wrap-up



•  µServices are no free lunch
•  Use if responsiveness is crucial
•  Reduce stress by especially taking care of
•  Good functional design
•  Production readiness (incl. resilience)
•  New challenges for developers (& ops)
So, hope your hell will be more like this …
@ufried
Uwe Friedrichsen | uwe.friedrichsen@codecentric.de | http://slideshare.net/ufried | http://ufried.tumblr.com
Microservices - stress-free and without increased heart attack risk

More Related Content

What's hot

Timeless design in a cloud-native world
Timeless design in a cloud-native worldTimeless design in a cloud-native world
Timeless design in a cloud-native worldUwe Friedrichsen
 
Resilience reloaded - more resilience patterns
Resilience reloaded - more resilience patternsResilience reloaded - more resilience patterns
Resilience reloaded - more resilience patternsUwe Friedrichsen
 
MicroServices architecture @ Ctrip v1.1
MicroServices architecture @ Ctrip v1.1MicroServices architecture @ Ctrip v1.1
MicroServices architecture @ Ctrip v1.1William Yang
 
Platform as reflection of values: Joyent, node.js, and beyond
Platform as reflection of values: Joyent, node.js, and beyondPlatform as reflection of values: Joyent, node.js, and beyond
Platform as reflection of values: Joyent, node.js, and beyondbcantrill
 
Dr. Hectic and Mr. Hype - surviving the economic darwinism
Dr. Hectic and Mr. Hype - surviving the economic darwinismDr. Hectic and Mr. Hype - surviving the economic darwinism
Dr. Hectic and Mr. Hype - surviving the economic darwinismUwe Friedrichsen
 
Modern times - architectures for a Next Generation of IT
Modern times - architectures for a Next Generation of ITModern times - architectures for a Next Generation of IT
Modern times - architectures for a Next Generation of ITUwe Friedrichsen
 
Microservices for Mortals by Bert Ertman at Codemotion Dubai
 Microservices for Mortals by Bert Ertman at Codemotion Dubai Microservices for Mortals by Bert Ertman at Codemotion Dubai
Microservices for Mortals by Bert Ertman at Codemotion DubaiCodemotion Dubai
 
The truth about "You build it, you run it!"
The truth about "You build it, you run it!"The truth about "You build it, you run it!"
The truth about "You build it, you run it!"Uwe Friedrichsen
 
Zebras all the way down: The engineering challenges of the data path
Zebras all the way down: The engineering challenges of the data pathZebras all the way down: The engineering challenges of the data path
Zebras all the way down: The engineering challenges of the data pathbcantrill
 
Platform values, Rust, and the implications for system software
Platform values, Rust, and the implications for system softwarePlatform values, Rust, and the implications for system software
Platform values, Rust, and the implications for system softwarebcantrill
 
How SMB's benefit from cloud
How SMB's benefit from cloudHow SMB's benefit from cloud
How SMB's benefit from cloudAlessandro Guli
 
The promises and perils of microservices
The promises and perils of microservicesThe promises and perils of microservices
The promises and perils of microservicesUwe Friedrichsen
 
It's Not All About the Cloud
It's Not All About the CloudIt's Not All About the Cloud
It's Not All About the CloudHostway|HOSTING
 
Hybrid Hosting; The Third Generation Cloud
Hybrid Hosting; The Third Generation Cloud Hybrid Hosting; The Third Generation Cloud
Hybrid Hosting; The Third Generation Cloud Hostway|HOSTING
 
Citrix XenDesktop: Dealing with Failure - SYN408
Citrix XenDesktop: Dealing with Failure - SYN408Citrix XenDesktop: Dealing with Failure - SYN408
Citrix XenDesktop: Dealing with Failure - SYN408Tom Gamull
 
VMworld 2013: Low-Cost, High-Performance Storage for VMware Horizon Desktops
VMworld 2013: Low-Cost, High-Performance Storage for VMware Horizon Desktops VMworld 2013: Low-Cost, High-Performance Storage for VMware Horizon Desktops
VMworld 2013: Low-Cost, High-Performance Storage for VMware Horizon Desktops VMworld
 
IBM consolidation and relocation webinar
IBM consolidation and relocation webinarIBM consolidation and relocation webinar
IBM consolidation and relocation webinarHerb Hernandez
 

What's hot (20)

Timeless design in a cloud-native world
Timeless design in a cloud-native worldTimeless design in a cloud-native world
Timeless design in a cloud-native world
 
Resilience reloaded - more resilience patterns
Resilience reloaded - more resilience patternsResilience reloaded - more resilience patterns
Resilience reloaded - more resilience patterns
 
Deep learning - a primer
Deep learning - a primerDeep learning - a primer
Deep learning - a primer
 
No stress with state
No stress with stateNo stress with state
No stress with state
 
MicroServices architecture @ Ctrip v1.1
MicroServices architecture @ Ctrip v1.1MicroServices architecture @ Ctrip v1.1
MicroServices architecture @ Ctrip v1.1
 
Fantastic Elastic
Fantastic ElasticFantastic Elastic
Fantastic Elastic
 
Platform as reflection of values: Joyent, node.js, and beyond
Platform as reflection of values: Joyent, node.js, and beyondPlatform as reflection of values: Joyent, node.js, and beyond
Platform as reflection of values: Joyent, node.js, and beyond
 
Dr. Hectic and Mr. Hype - surviving the economic darwinism
Dr. Hectic and Mr. Hype - surviving the economic darwinismDr. Hectic and Mr. Hype - surviving the economic darwinism
Dr. Hectic and Mr. Hype - surviving the economic darwinism
 
Modern times - architectures for a Next Generation of IT
Modern times - architectures for a Next Generation of ITModern times - architectures for a Next Generation of IT
Modern times - architectures for a Next Generation of IT
 
Microservices for Mortals by Bert Ertman at Codemotion Dubai
 Microservices for Mortals by Bert Ertman at Codemotion Dubai Microservices for Mortals by Bert Ertman at Codemotion Dubai
Microservices for Mortals by Bert Ertman at Codemotion Dubai
 
The truth about "You build it, you run it!"
The truth about "You build it, you run it!"The truth about "You build it, you run it!"
The truth about "You build it, you run it!"
 
Zebras all the way down: The engineering challenges of the data path
Zebras all the way down: The engineering challenges of the data pathZebras all the way down: The engineering challenges of the data path
Zebras all the way down: The engineering challenges of the data path
 
Platform values, Rust, and the implications for system software
Platform values, Rust, and the implications for system softwarePlatform values, Rust, and the implications for system software
Platform values, Rust, and the implications for system software
 
How SMB's benefit from cloud
How SMB's benefit from cloudHow SMB's benefit from cloud
How SMB's benefit from cloud
 
The promises and perils of microservices
The promises and perils of microservicesThe promises and perils of microservices
The promises and perils of microservices
 
It's Not All About the Cloud
It's Not All About the CloudIt's Not All About the Cloud
It's Not All About the Cloud
 
Hybrid Hosting; The Third Generation Cloud
Hybrid Hosting; The Third Generation Cloud Hybrid Hosting; The Third Generation Cloud
Hybrid Hosting; The Third Generation Cloud
 
Citrix XenDesktop: Dealing with Failure - SYN408
Citrix XenDesktop: Dealing with Failure - SYN408Citrix XenDesktop: Dealing with Failure - SYN408
Citrix XenDesktop: Dealing with Failure - SYN408
 
VMworld 2013: Low-Cost, High-Performance Storage for VMware Horizon Desktops
VMworld 2013: Low-Cost, High-Performance Storage for VMware Horizon Desktops VMworld 2013: Low-Cost, High-Performance Storage for VMware Horizon Desktops
VMworld 2013: Low-Cost, High-Performance Storage for VMware Horizon Desktops
 
IBM consolidation and relocation webinar
IBM consolidation and relocation webinarIBM consolidation and relocation webinar
IBM consolidation and relocation webinar
 

Viewers also liked

Conway's law revisited - Architectures for an effective IT
Conway's law revisited - Architectures for an effective ITConway's law revisited - Architectures for an effective IT
Conway's law revisited - Architectures for an effective ITUwe Friedrichsen
 
Towards complex adaptive architectures
Towards complex adaptive architecturesTowards complex adaptive architectures
Towards complex adaptive architecturesUwe Friedrichsen
 
DevOps is not enough - Embedding DevOps in a broader context
DevOps is not enough - Embedding DevOps in a broader contextDevOps is not enough - Embedding DevOps in a broader context
DevOps is not enough - Embedding DevOps in a broader contextUwe Friedrichsen
 
The Next Generation (of) IT
The Next Generation (of) ITThe Next Generation (of) IT
The Next Generation (of) ITUwe Friedrichsen
 
Size does matter - Patterns for high scalability: Uwe Friedrichsen
Size does matter - Patterns for high scalability: Uwe FriedrichsenSize does matter - Patterns for high scalability: Uwe Friedrichsen
Size does matter - Patterns for high scalability: Uwe FriedrichsenJAX London
 
How to survive in a BASE world
How to survive in a BASE worldHow to survive in a BASE world
How to survive in a BASE worldUwe Friedrichsen
 
To Microservices and Beyond
To Microservices and BeyondTo Microservices and Beyond
To Microservices and BeyondMatt Stine
 
Prof. Dr. phil. Stefan Strauß: Leadership 2.0 - Die digitale Generation in Fü...
Prof. Dr. phil. Stefan Strauß: Leadership 2.0 - Die digitale Generation in Fü...Prof. Dr. phil. Stefan Strauß: Leadership 2.0 - Die digitale Generation in Fü...
Prof. Dr. phil. Stefan Strauß: Leadership 2.0 - Die digitale Generation in Fü...Prof. Dr. Stefan Strauss
 

Viewers also liked (15)

Conway's law revisited - Architectures for an effective IT
Conway's law revisited - Architectures for an effective ITConway's law revisited - Architectures for an effective IT
Conway's law revisited - Architectures for an effective IT
 
Towards complex adaptive architectures
Towards complex adaptive architecturesTowards complex adaptive architectures
Towards complex adaptive architectures
 
Patterns of resilience
Patterns of resiliencePatterns of resilience
Patterns of resilience
 
Self healing data
Self healing dataSelf healing data
Self healing data
 
Resilience with Hystrix
Resilience with HystrixResilience with Hystrix
Resilience with Hystrix
 
Life, IT and everything
Life, IT and everythingLife, IT and everything
Life, IT and everything
 
DevOps is not enough - Embedding DevOps in a broader context
DevOps is not enough - Embedding DevOps in a broader contextDevOps is not enough - Embedding DevOps in a broader context
DevOps is not enough - Embedding DevOps in a broader context
 
The Next Generation (of) IT
The Next Generation (of) ITThe Next Generation (of) IT
The Next Generation (of) IT
 
Devops for Developers
Devops for DevelopersDevops for Developers
Devops for Developers
 
Size does matter - Patterns for high scalability: Uwe Friedrichsen
Size does matter - Patterns for high scalability: Uwe FriedrichsenSize does matter - Patterns for high scalability: Uwe Friedrichsen
Size does matter - Patterns for high scalability: Uwe Friedrichsen
 
Domain Event - The Hidden Gem of DDD
Domain Event - The Hidden Gem of DDDDomain Event - The Hidden Gem of DDD
Domain Event - The Hidden Gem of DDD
 
How to survive in a BASE world
How to survive in a BASE worldHow to survive in a BASE world
How to survive in a BASE world
 
To Microservices and Beyond
To Microservices and BeyondTo Microservices and Beyond
To Microservices and Beyond
 
Fault tolerance made easy
Fault tolerance made easyFault tolerance made easy
Fault tolerance made easy
 
Prof. Dr. phil. Stefan Strauß: Leadership 2.0 - Die digitale Generation in Fü...
Prof. Dr. phil. Stefan Strauß: Leadership 2.0 - Die digitale Generation in Fü...Prof. Dr. phil. Stefan Strauß: Leadership 2.0 - Die digitale Generation in Fü...
Prof. Dr. phil. Stefan Strauß: Leadership 2.0 - Die digitale Generation in Fü...
 

Similar to Microservices - stress-free and without increased heart attack risk

Microservices - stress-free and without increased heart-attack risk - Uwe Fri...
Microservices - stress-free and without increased heart-attack risk - Uwe Fri...Microservices - stress-free and without increased heart-attack risk - Uwe Fri...
Microservices - stress-free and without increased heart-attack risk - Uwe Fri...distributed matters
 
Cloud Native Future
Cloud Native FutureCloud Native Future
Cloud Native FutureJulie Coonce
 
Microservices - when, why and how incontrodevops.it
Microservices  - when, why and how incontrodevops.itMicroservices  - when, why and how incontrodevops.it
Microservices - when, why and how incontrodevops.itGiuseppe Lavagetto
 
Microservices Gone Wrong!
Microservices Gone Wrong!Microservices Gone Wrong!
Microservices Gone Wrong!Bert Ertman
 
Smaller is Better - Exploiting Microservice Architectures on AWS - Technical 201
Smaller is Better - Exploiting Microservice Architectures on AWS - Technical 201Smaller is Better - Exploiting Microservice Architectures on AWS - Technical 201
Smaller is Better - Exploiting Microservice Architectures on AWS - Technical 201Amazon Web Services
 
devops, platforms and devops platforms
devops, platforms and devops platformsdevops, platforms and devops platforms
devops, platforms and devops platformsVMware Tanzu
 
devops, platforms and devops platforms
devops, platforms and devops platformsdevops, platforms and devops platforms
devops, platforms and devops platformsAndrew Shafer
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?Eduard Tomàs
 
Grokking microservices in 5 minutes
Grokking microservices in 5 minutesGrokking microservices in 5 minutes
Grokking microservices in 5 minutesAndrew Siemer
 
Microsoft Microservices
Microsoft MicroservicesMicrosoft Microservices
Microsoft MicroservicesChase Aucoin
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Markus Eisele
 
Migrating to cloud-native_app_architectures_pivotal
Migrating to cloud-native_app_architectures_pivotalMigrating to cloud-native_app_architectures_pivotal
Migrating to cloud-native_app_architectures_pivotalkkdlavak3
 
Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)
Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)
Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)Tim Kirby
 
Migrating_to_Cloud-Native_App_Architectures_Pivotal
Migrating_to_Cloud-Native_App_Architectures_PivotalMigrating_to_Cloud-Native_App_Architectures_Pivotal
Migrating_to_Cloud-Native_App_Architectures_PivotalEstevan McCalley
 
Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)
Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)
Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)Dean Bruckman
 
Are you ready for Microservices
Are you ready for MicroservicesAre you ready for Microservices
Are you ready for MicroservicesAsiri Liyanage
 
AWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWSAWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWSAmazon Web Services
 
Technology insights: Decision Science Platform
Technology insights: Decision Science PlatformTechnology insights: Decision Science Platform
Technology insights: Decision Science PlatformDecision Science Community
 
Introduction to Microservices Architecture - SECCOMP 2020
Introduction to Microservices Architecture - SECCOMP 2020Introduction to Microservices Architecture - SECCOMP 2020
Introduction to Microservices Architecture - SECCOMP 2020Rodrigo Antonialli
 

Similar to Microservices - stress-free and without increased heart attack risk (20)

Microservices - stress-free and without increased heart-attack risk - Uwe Fri...
Microservices - stress-free and without increased heart-attack risk - Uwe Fri...Microservices - stress-free and without increased heart-attack risk - Uwe Fri...
Microservices - stress-free and without increased heart-attack risk - Uwe Fri...
 
Cloud Native Future
Cloud Native FutureCloud Native Future
Cloud Native Future
 
Microservices - when, why and how incontrodevops.it
Microservices  - when, why and how incontrodevops.itMicroservices  - when, why and how incontrodevops.it
Microservices - when, why and how incontrodevops.it
 
Microservices Gone Wrong!
Microservices Gone Wrong!Microservices Gone Wrong!
Microservices Gone Wrong!
 
Smaller is Better - Exploiting Microservice Architectures on AWS - Technical 201
Smaller is Better - Exploiting Microservice Architectures on AWS - Technical 201Smaller is Better - Exploiting Microservice Architectures on AWS - Technical 201
Smaller is Better - Exploiting Microservice Architectures on AWS - Technical 201
 
devops, platforms and devops platforms
devops, platforms and devops platformsdevops, platforms and devops platforms
devops, platforms and devops platforms
 
devops, platforms and devops platforms
devops, platforms and devops platformsdevops, platforms and devops platforms
devops, platforms and devops platforms
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 
Grokking microservices in 5 minutes
Grokking microservices in 5 minutesGrokking microservices in 5 minutes
Grokking microservices in 5 minutes
 
Microsoft Microservices
Microsoft MicroservicesMicrosoft Microservices
Microsoft Microservices
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Migrating to cloud-native_app_architectures_pivotal
Migrating to cloud-native_app_architectures_pivotalMigrating to cloud-native_app_architectures_pivotal
Migrating to cloud-native_app_architectures_pivotal
 
Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)
Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)
Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)
 
Migrating_to_Cloud-Native_App_Architectures_Pivotal
Migrating_to_Cloud-Native_App_Architectures_PivotalMigrating_to_Cloud-Native_App_Architectures_Pivotal
Migrating_to_Cloud-Native_App_Architectures_Pivotal
 
Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)
Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)
Migrating_to_Cloud-Native_App_Architectures_Pivotal (2)
 
Are you ready for Microservices
Are you ready for MicroservicesAre you ready for Microservices
Are you ready for Microservices
 
AWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWSAWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWS
 
Technology insights: Decision Science Platform
Technology insights: Decision Science PlatformTechnology insights: Decision Science Platform
Technology insights: Decision Science Platform
 
Introduction to Microservices Architecture - SECCOMP 2020
Introduction to Microservices Architecture - SECCOMP 2020Introduction to Microservices Architecture - SECCOMP 2020
Introduction to Microservices Architecture - SECCOMP 2020
 

Recently uploaded

Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 

Recently uploaded (20)

Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 

Microservices - stress-free and without increased heart attack risk

  • 1. Microservices stress-free and without increased heart-attack risk Uwe Friedrichsen, codecentric AG, 2015
  • 2. @ufried Uwe Friedrichsen | uwe.friedrichsen@codecentric.de | http://slideshare.net/ufried | http://ufried.tumblr.com
  • 3. I must do µservices!
  • 5. µServices are an architectural choice
  • 6. When do I need µservices?
  • 7. The need for speed
  • 8. The need for speed Autonomous teams µServices DevOps Continuous Delivery Cloud Craftsmanship …
  • 9. The need for speed Autonomous teams µServices DevOps Continuous Delivery Cloud Craftsmanship … Can’t I just go for µservices without all that other stuff?
  • 10. Of course you can, but you shouldn’t … … because you would pay the full price for µservices and hardly gain anything
  • 11. What is the price for µservices?
  • 12. Well, ever heard about µservice hell?
  • 13. A single µservice is easy … … but the complexity of the business functionality remains the same ☛ Complexity is shifted from single µservices to µservice collaboration µServices are usually self-contained … … i.e., µservices are independent runtime processes ☛ This results in a highly interconnected, distributed system landscape
  • 14. Consequences •  Design is more challenging •  Implementation is more challenging •  Distributed systems are challenging •  Lookup •  Liveness •  Partitioning •  Latency •  Consistency •  … •  New challenges for “monolith developers” à µServices are not easy at all
  • 15. How can we avoid µservice hell?
  • 17. Topic areas Design Interfaces User Interface Frameworks Datastores Developer Runtime Environment Deployment Production Resilience
  • 18. "It seems as if teams are jumping on µservices because they're sexy, but the design thinking and decomposition strategy required to create a good µservices architecture are the same as those needed to create a well structured monolith. If teams find it hard to create a well structured monolith, I don't rate their chances of creating a well structured µservices architecture.” - Simon Brown http://www.codingthearchitecture.com/2014/07/06/distributed_big_balls_of_mud.html
  • 19. "In theory, programming languages give us all we need to encapsulate state and environment - we just need to use them well. Maybe we just don’t have the discipline? Maybe we had to explicitly advocate the practice of writing services running in completely different environments using different languages to trigger the sort of encapsulation that we want? If that’s the case, we can either see it as a clever self-hack or something we were forced into by the fact that we programmers are adept at overcoming any sort of self-discipline we try to impose on ourselves. Perhaps both are true.” - Michael Feathers https://michaelfeathers.silvrback.com/microservices-and-the-failure-of-encapsulaton
  • 20. Design •  Master modularization first •  Use bounded contexts as a modularization starting point •  Forget about layered architecture •  Rethink DRY – avoid deployment dependencies
  • 21. ”If every service needs to be updated at the same time it’s not loosely coupled” - Adrian Cockcroft http://de.slideshare.net/adriancockcroft/dockercon-state-of-the-art-in-microservices
  • 22. Interfaces •  Plan for interface evolution •  Remember Postel’s law •  Consider API gateways •  Synchronous vs. asynchronous
  • 23. µS Request/Response : Horizontal slicing Flow / Process µS µS µS µS µS µS Event-driven : Vertical slicing µS µS µS µS µS Flow / Process
  • 24. User Interface •  The single UI application is history •  Separate UI and services by default •  Decouple via client centric API gateway •  Including UI in service can make sense in special cases
  • 25. Bounded Context Bounded Context Bounded Context µS µS µS µS µS µS µS µS µS µS µS µS µS µS µS UI e.g., B2C-Portal UI e.g., embedded in Partner-Portal UI e.g., Mobile App UI e.g., Clerk Desktop API Gateway API Gateway API Gateway
  • 26. Frameworks •  Not the most important issue of µservices •  Should support at least uniform interfaces, observability, resilience •  Nice if also support for uniform configuration and discoverability •  Spring Boot/Cloud, Dropwizard, Netflix Karyon, …
  • 27. Datastores •  Avoid the “single, big database” •  Avoid distributed transactions •  Try to relax temporal constraints (and make actions idempotent) •  Treat your storage as being “ephemeral”
  • 28. Development Runtime Environment •  Developers should be able to run the application locally •  Provide automatically deployable “development runtime environment” •  Containers are your friend •  Make sure things build and deploy fast locally
  • 29. Deployment •  Continuous deployment pipeline is a must •  Unify deployment artifact format •  Use either IaC tool deployment … •  … or distributed infrastructure & scheduler
  • 30. Production readiness •  You need to solve at least the following issues •  Configuration, Orchestration, Discovery, Routing, Observability, Resilience •  No standard solution (yet) in sight •  Container management infrastructures evolve quickly
  • 31. Configuration •  Netflix Archaius Orchestration •  Apache Aurora on Apache Mesos •  Marathon •  Kubernetes •  Fleet Discovery •  Netflix Eureka •  Apache ZooKeeper •  Kubernetes •  Etcd •  Consul Routing •  Netflix Zuul & Ribbon •  Twitter Finagle Monitoring •  Hystrix •  Twitter Zipkin (Distributed Tracing) Measuring •  Dropwizard Metrics Logging •  ELK •  Graylog2 •  Splunk
  • 32. A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable. Leslie Lamport
  • 33. Failures in complex, distributed, interconnected systems are not an exceptional case •  They are the normal case •  They are not predictable •  They are not avoidable
  • 34. µService systems are complex, distributed, interconnected systems
  • 35. Failures in µservice systems
 are not an exceptional case •  They are the normal case •  They are not predictable •  They are not avoidable
  • 36. Do not try to avoid failures. Embrace them.
  • 37. resilience (IT) the ability of a system to handle unexpected situations -  without the user noticing it (best case) -  with a graceful degradation of service (worst case)
  • 38. Resilience •  Resilient software design is mandatory •  Start with isolation and latency control •  Add automated error recovery and mitigation •  Separate control and data flow
  • 39. Event/data flow Event/data flow Resource access Error flow Control flow µS Isolation
  • 40. Separation of control/error and data/event flow W Flow / Process W W W W W W W S S S S S Escalation
  • 41. Isolation Latency Control Fail Fast Circuit Breaker Timeouts Fan out & quickest reply Bounded Queues Shed Load Bulkheads Loose Coupling Asynchronous Communication Event-Driven Idempotency Self-Containment Relaxed Temporal Constraints Location Transparency Stateless Supervision Monitor Complete Parameter Checking Error Handler Escalation
  • 42. Wrap-up •  µServices are no free lunch •  Use if responsiveness is crucial •  Reduce stress by especially taking care of •  Good functional design •  Production readiness (incl. resilience) •  New challenges for developers (& ops)
  • 43. So, hope your hell will be more like this …
  • 44. @ufried Uwe Friedrichsen | uwe.friedrichsen@codecentric.de | http://slideshare.net/ufried | http://ufried.tumblr.com