SlideShare a Scribd company logo
1 of 26
Micro Services
Sebastian Mancke
Creative Commons BY-SA 3.0
24.08.14 2
Monolythic Software
Why are monolythic systems 'evil' ?
Because of their dependencies:
●
Software is not easy to test
●
And hard to refactor
●
Effects of changes can not be isolated
●
Working with multiple developers/teams is challenging
●
No reuse of functionality
●
Runtime and deployment dependencies:
●
Performance and scaling
●
Deployment of features and releases
24.08.14 3
Avoid a Monolyth
Monolyths arise from bad design,
independent of the technology!
●
You can build a monolyth with every software framework.
●
Even distributed systems with a lot of services can be monolythic.
●
And even software with monolythic builds and deployments may have a
good internal structure.
So, chosing a popular micro services framework is not enough!
24.08.14 4
Think Vertical!
Split the application in functional modules
Maximal reduction of dependencies
between different functional parts
Vertical teams (End-to-End)
24.08.14 5
Classical Approach
GUI -Layer
Services
Database/Persistance
24.08.14 6
SOA Approach
GUI -Layer
Business
Service
DB
Business Service
Business
Service
Persistence Service
DB
Persistence Service
DB
Persistence Service
DB
Persistence Service
DB
Persistence Service
24.08.14 7
The Micro Services Way...
GUI
Service
DB
GUI
Service
DB
GUI
Service
DB
GUI
Service
DB
24.08.14 8
Shop Example
Micro Services
24.08.14 10
Micro Services Principles 1/2
Small with a single responsibility
• Each application only does one thing
• Small enough to fit in your head
– “If a service is bigger than your head, than it is too big”
• Small enough that you can throw them away
– Rewrite or Maintain
by James Lewis:
24.08.14 11
Micro Services Principles 2/2
by James Lewis:
Located in different VCS roots
• Each application is completely seperate
• Domain Driven Design / Conway’s law
– Domains in different bounded contexts shoud be distinct - and it is ok to have
duplication
– Use physical separation to enforce this
• There will be common code, but it should be library and infrastructure code
– Treat it as you would any other open source library
– Stick it in a nexus repo somewhere and treat it as a binary dependency
24.08.14 12
Implementation
No application servers
●
Every service runs in it's own process
●
Every service brings it's own environment
Choose the right stack for the requirements
●
1 monolyth 1 stack, 100 Micro Services flexibility→ →
●
Free choice of: OS, language, framework, database, ..
●
But: Be careful!
New feature, new service?
●
At first check, if a feature should build a new functional module
●
Only in the second step extend an existing service
●
Rule: Merging services is easy, splitting is hard!
24.08.14 13
Java Frameworks
●
Spring Boot
●
Dropwizard
●
Vert.x
24.08.14 14
Database
Design goal:
Every service should have it's own exclusive database
Strategies
●
NoSQL / document oriented design
●
Treat foreign keys as REST URI references
●
When a service needs external data: Call a service
●
Don't fear data redundancy
●
Replication of data: Pulling feeds with changelogs
Tradeoff solutions
●
Multiple schemas within the same database
●
Read-only views for data of other services
●
Use DB features for replication (e.g. database link)
24.08.14 15
UI
Design goal:
Services should provide their UI themselves
Strategies
●
Every service serves the full page, including layout and menu bar
●
Commitment on one CSS naming schema
●
Central asset service (menu, styles, common resources)
●
Single page apps only within one service
●
GUI composition only on the client (in the browser)
●
Use UI fragments / widgets when embedding data of another service
24.08.14 16
Security
Problem: The security context is spread over 100 services
Solution: Identity Management System
●
Identity Management is also a service module (or even multiple)
●
Service for management of identities
●
Service for login/logout
●
Service for self administration
●
OAuth2 allows distribution of the login to different services
24.08.14 17
Login implementations
Variant a: Shared Cookie
●
All services are available under the same domain
●
The login service creates a cookie available to all others
●
Username, timestamp, rolles/permissions
●
Crypted and signed
●
All services can verify the cookie by checking the signature
Variant b: Independent Applications
●
Every service maintains it's own session
●
Login is done by OAuth2
●
Double redirect
●
Token exchange
●
The login service maintains a sessions as well
●
Multiple logins are done transparent to the user
24.08.14 18
OSIAM
https://github.com/osiam/
24.08.14 19
Communication
Everything is allowed
But: You should establish one standard for your platform.
Principles
●
Loose coupling – services should not know about each other
●
Smart endpoints, dump pipes
●
No intelligence in the communication channel
●
No ESB
REST is a good choice for many scenarios
●
Easy consumable with all languages
●
Interfaces are maintainable towards compatibility
●
URI references are helpful for navigation to different services and
abstraction of the physical location of resources.
24.08.14 20
Communication– further principles
Asynchronous Messaging
●
Reliable event distribution
●
High performance
●
Load protection of critical services
Resilience
●
Tolerance against failures
●
Error recovery
●
Avoid error cascades
API Versioning
●
Don't do it for internal APIs!
24.08.14 21
Testing
Unit Tests
●
Integration tests suffice in many cases because the services are small
●
Test the isolated service (Other services should be mocked)
Consumer Driven Tests
Idea: The integration tests of a service will be defined and implemented by the
consumer (not by the service provider).
No release before the service passes all consumer's tests
●
Test with the real expectations, not with the service specification
●
Very smart concept, but hard to maintain
●
Has the risk of high test-redundancy for common APIs
24.08.14 22
Deployment
Contiuous Delivery
●
Create a deployment pipeline
●
Need to automate everything
One monolyth may be easy to deploy, 100 Micro Services may not!
Packaging & Provisioning
●
Usage of established standards: DEB, RPM, …
●
Robust init scripts
●
Configuration management: Puppet, Chef, ...
24.08.14 23
Deployment as platform
1 Micro Service : 1 Linux System
Docker
●
LXC based virtualisation
●
Similar to changeroot (but a lot better!)
●
Slim and fast
●
Based on git, so changes of the images can be tracked
For Hardliners
●
Install the Micro Service by shipping and starting the system image
●
No packaging
●
No init scripts
24.08.14 24
Monitoring
Realtime metrics
●
Monitor, what currently happens
●
Fast reaction to problems
●
Do monitoring inside the application, not outside
●
Tools: Metrics, Spring Boot Actuator
Logging
●
Manual search in logs of 100 services is not possible
●
Central log aggregation
●
Filtering and analyses in realtime
●
Tools: Logstash, Graylog2, Kibana, Apache Flume, fluentd
24.08.14 25
Risks
Micro Services are a promising paradigm
But, you should always be careful with new paradigms!
●
Inventarisation of many services
●
Challenging for operations
●
High network load (if not done right)
●
New way of thinking
●
The freedom of technology selection may lead to chaos,
if it is no governance
Thank You!

More Related Content

What's hot

Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesMahmoudZidan41
 
Building .NET Microservices
Building .NET MicroservicesBuilding .NET Microservices
Building .NET MicroservicesVMware Tanzu
 
Introduction to microservices (from rails monolith)
Introduction to microservices (from rails monolith)Introduction to microservices (from rails monolith)
Introduction to microservices (from rails monolith)Leandro Parazito
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architectureThe Software House
 
The Microservices world in. NET Core and. NET framework
The Microservices world in. NET Core and. NET frameworkThe Microservices world in. NET Core and. NET framework
The Microservices world in. NET Core and. NET frameworkMassimo Bonanni
 
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)Red Hat Developers
 
Tokyo azure meetup #12 service fabric internals
Tokyo azure meetup #12   service fabric internalsTokyo azure meetup #12   service fabric internals
Tokyo azure meetup #12 service fabric internalsTokyo Azure Meetup
 
Things I wish someone had told me about Istio, Omer Levi Hevroni
Things I wish someone had told me about Istio, Omer Levi HevroniThings I wish someone had told me about Istio, Omer Levi Hevroni
Things I wish someone had told me about Istio, Omer Levi HevroniSoluto
 
Innovation with Open Sources and App Modernization for Developers | Ian Y. Choi
Innovation with Open Sources and App Modernization for Developers | Ian Y. ChoiInnovation with Open Sources and App Modernization for Developers | Ian Y. Choi
Innovation with Open Sources and App Modernization for Developers | Ian Y. ChoiVietnam Open Infrastructure User Group
 
Microservices
MicroservicesMicroservices
MicroservicesSmartBear
 
An Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI CompositionAn Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI CompositionDr. Arif Wider
 
THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
 THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONSMarkus Eisele
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservicesAnil Allewar
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology StackEberhard Wolff
 
Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Chris Richardson
 

What's hot (20)

Microservices in Java
Microservices in JavaMicroservices in Java
Microservices in Java
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Building .NET Microservices
Building .NET MicroservicesBuilding .NET Microservices
Building .NET Microservices
 
Introduction to microservices (from rails monolith)
Introduction to microservices (from rails monolith)Introduction to microservices (from rails monolith)
Introduction to microservices (from rails monolith)
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
The Microservices world in. NET Core and. NET framework
The Microservices world in. NET Core and. NET frameworkThe Microservices world in. NET Core and. NET framework
The Microservices world in. NET Core and. NET framework
 
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
 
Tokyo azure meetup #12 service fabric internals
Tokyo azure meetup #12   service fabric internalsTokyo azure meetup #12   service fabric internals
Tokyo azure meetup #12 service fabric internals
 
Things I wish someone had told me about Istio, Omer Levi Hevroni
Things I wish someone had told me about Istio, Omer Levi HevroniThings I wish someone had told me about Istio, Omer Levi Hevroni
Things I wish someone had told me about Istio, Omer Levi Hevroni
 
Innovation with Open Sources and App Modernization for Developers | Ian Y. Choi
Innovation with Open Sources and App Modernization for Developers | Ian Y. ChoiInnovation with Open Sources and App Modernization for Developers | Ian Y. Choi
Innovation with Open Sources and App Modernization for Developers | Ian Y. Choi
 
Microservices
MicroservicesMicroservices
Microservices
 
An Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI CompositionAn Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI Composition
 
THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
 THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Javantura v4 - Cloud-native Architectures and Java - Matjaž B. Jurič
Javantura v4 - Cloud-native Architectures and Java - Matjaž B. JuričJavantura v4 - Cloud-native Architectures and Java - Matjaž B. Jurič
Javantura v4 - Cloud-native Architectures and Java - Matjaž B. Jurič
 
Azure Service Fabric Overview
Azure Service Fabric OverviewAzure Service Fabric Overview
Azure Service Fabric Overview
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology Stack
 
Azure privatelink
Azure privatelinkAzure privatelink
Azure privatelink
 
Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...
 

Viewers also liked

Design Patterns in Micro-services architectures & Gilmour
Design Patterns in Micro-services architectures & GilmourDesign Patterns in Micro-services architectures & Gilmour
Design Patterns in Micro-services architectures & GilmourPiyush Verma
 
Micro-services Battle Scars
Micro-services Battle ScarsMicro-services Battle Scars
Micro-services Battle ScarsRichard Rodger
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service ArchitectureEduards Sizovs
 
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...rhatr
 
Micro Services - Neither Micro Nor Service
Micro Services - Neither Micro Nor ServiceMicro Services - Neither Micro Nor Service
Micro Services - Neither Micro Nor ServiceEberhard Wolff
 
Towards Realizing Dynamic QoS-aware Web Service Composition
Towards Realizing  Dynamic QoS-aware Web Service CompositionTowards Realizing  Dynamic QoS-aware Web Service Composition
Towards Realizing Dynamic QoS-aware Web Service CompositionGeorge Baryannis
 
BBVA Arquitectura - Demo DevOps
BBVA Arquitectura - Demo DevOpsBBVA Arquitectura - Demo DevOps
BBVA Arquitectura - Demo DevOpsErnesto Anaya
 
Continuous Delivery and Micro Services - A Symbiosis
Continuous Delivery and Micro Services - A SymbiosisContinuous Delivery and Micro Services - A Symbiosis
Continuous Delivery and Micro Services - A SymbiosisEberhard Wolff
 
Microservices 101 - The Big Why?
Microservices 101 - The Big Why?Microservices 101 - The Big Why?
Microservices 101 - The Big Why?Yamen Sader
 
Containers #101 Meetup: Building a micro-service using Node.js and Docker - P...
Containers #101 Meetup: Building a micro-service using Node.js and Docker - P...Containers #101 Meetup: Building a micro-service using Node.js and Docker - P...
Containers #101 Meetup: Building a micro-service using Node.js and Docker - P...Codefresh
 
A High-Performance Solution to Microservice UI Composition @ XConf Hamburg
A High-Performance Solution to Microservice UI Composition @ XConf HamburgA High-Performance Solution to Microservice UI Composition @ XConf Hamburg
A High-Performance Solution to Microservice UI Composition @ XConf HamburgDr. Arif Wider
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services ArchitectureRanjan Baisak
 
A High-Performance Solution To Microservices UI Composition
A High-Performance Solution To Microservices UI CompositionA High-Performance Solution To Microservices UI Composition
A High-Performance Solution To Microservices UI CompositionAlexey Gravanov
 
Micro Services - Smaller is Better?
Micro Services - Smaller is Better?Micro Services - Smaller is Better?
Micro Services - Smaller is Better?Eberhard Wolff
 
MicroServices, yet another architectural style?
MicroServices, yet another architectural style?MicroServices, yet another architectural style?
MicroServices, yet another architectural style?ACA IT-Solutions
 
Global Big Data Conference Sept 2014 AWS Kinesis Spark Streaming Approximatio...
Global Big Data Conference Sept 2014 AWS Kinesis Spark Streaming Approximatio...Global Big Data Conference Sept 2014 AWS Kinesis Spark Streaming Approximatio...
Global Big Data Conference Sept 2014 AWS Kinesis Spark Streaming Approximatio...Chris Fregly
 
Deep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer ArchitectureDeep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer ArchitectureWSO2
 
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationCode Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationLemi Orhan Ergin
 
Delivering with Microservices - How to Iterate Towards Sophistication
Delivering with Microservices - How to Iterate Towards SophisticationDelivering with Microservices - How to Iterate Towards Sophistication
Delivering with Microservices - How to Iterate Towards SophisticationThoughtworks
 

Viewers also liked (20)

Design Patterns in Micro-services architectures & Gilmour
Design Patterns in Micro-services architectures & GilmourDesign Patterns in Micro-services architectures & Gilmour
Design Patterns in Micro-services architectures & Gilmour
 
Micro-services Battle Scars
Micro-services Battle ScarsMicro-services Battle Scars
Micro-services Battle Scars
 
From SOA to MSA
From SOA to MSAFrom SOA to MSA
From SOA to MSA
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service Architecture
 
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
 
Micro Services - Neither Micro Nor Service
Micro Services - Neither Micro Nor ServiceMicro Services - Neither Micro Nor Service
Micro Services - Neither Micro Nor Service
 
Towards Realizing Dynamic QoS-aware Web Service Composition
Towards Realizing  Dynamic QoS-aware Web Service CompositionTowards Realizing  Dynamic QoS-aware Web Service Composition
Towards Realizing Dynamic QoS-aware Web Service Composition
 
BBVA Arquitectura - Demo DevOps
BBVA Arquitectura - Demo DevOpsBBVA Arquitectura - Demo DevOps
BBVA Arquitectura - Demo DevOps
 
Continuous Delivery and Micro Services - A Symbiosis
Continuous Delivery and Micro Services - A SymbiosisContinuous Delivery and Micro Services - A Symbiosis
Continuous Delivery and Micro Services - A Symbiosis
 
Microservices 101 - The Big Why?
Microservices 101 - The Big Why?Microservices 101 - The Big Why?
Microservices 101 - The Big Why?
 
Containers #101 Meetup: Building a micro-service using Node.js and Docker - P...
Containers #101 Meetup: Building a micro-service using Node.js and Docker - P...Containers #101 Meetup: Building a micro-service using Node.js and Docker - P...
Containers #101 Meetup: Building a micro-service using Node.js and Docker - P...
 
A High-Performance Solution to Microservice UI Composition @ XConf Hamburg
A High-Performance Solution to Microservice UI Composition @ XConf HamburgA High-Performance Solution to Microservice UI Composition @ XConf Hamburg
A High-Performance Solution to Microservice UI Composition @ XConf Hamburg
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services Architecture
 
A High-Performance Solution To Microservices UI Composition
A High-Performance Solution To Microservices UI CompositionA High-Performance Solution To Microservices UI Composition
A High-Performance Solution To Microservices UI Composition
 
Micro Services - Smaller is Better?
Micro Services - Smaller is Better?Micro Services - Smaller is Better?
Micro Services - Smaller is Better?
 
MicroServices, yet another architectural style?
MicroServices, yet another architectural style?MicroServices, yet another architectural style?
MicroServices, yet another architectural style?
 
Global Big Data Conference Sept 2014 AWS Kinesis Spark Streaming Approximatio...
Global Big Data Conference Sept 2014 AWS Kinesis Spark Streaming Approximatio...Global Big Data Conference Sept 2014 AWS Kinesis Spark Streaming Approximatio...
Global Big Data Conference Sept 2014 AWS Kinesis Spark Streaming Approximatio...
 
Deep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer ArchitectureDeep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer Architecture
 
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationCode Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
 
Delivering with Microservices - How to Iterate Towards Sophistication
Delivering with Microservices - How to Iterate Towards SophisticationDelivering with Microservices - How to Iterate Towards Sophistication
Delivering with Microservices - How to Iterate Towards Sophistication
 

Similar to micro services architecture (FrosCon2014)

Montreal MuleSoft_Meetup_16-Aug.pptx
Montreal MuleSoft_Meetup_16-Aug.pptxMontreal MuleSoft_Meetup_16-Aug.pptx
Montreal MuleSoft_Meetup_16-Aug.pptxshubhamkalsi2
 
Warsaw MuleSoft Meetup #13.pptx
Warsaw MuleSoft Meetup #13.pptxWarsaw MuleSoft Meetup #13.pptx
Warsaw MuleSoft Meetup #13.pptxPatryk Bandurski
 
The journey to Native Cloud Architecture & Microservices, tracing the footste...
The journey to Native Cloud Architecture & Microservices, tracing the footste...The journey to Native Cloud Architecture & Microservices, tracing the footste...
The journey to Native Cloud Architecture & Microservices, tracing the footste...Mek Srunyu Stittri
 
Design Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise SolutionsDesign Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise SolutionsInductive Automation
 
Design Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise SolutionsDesign Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise SolutionsInductive Automation
 
Moving from Monolith to Microservices
Moving from Monolith to MicroservicesMoving from Monolith to Microservices
Moving from Monolith to MicroservicesMist.io
 
MuleSoft Manchester Meetup #4 slides 11th February 2021
MuleSoft Manchester Meetup #4 slides 11th February 2021MuleSoft Manchester Meetup #4 slides 11th February 2021
MuleSoft Manchester Meetup #4 slides 11th February 2021Ieva Navickaite
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?Eduard Tomàs
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservicesRon Barabash
 
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Ambassador Labs
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices ArchitectureLucian Neghina
 
Kenzan: Architecting for Microservices
Kenzan: Architecting for MicroservicesKenzan: Architecting for Microservices
Kenzan: Architecting for MicroservicesDarren Bathgate
 
API Microservices with Node.js and Docker
API Microservices with Node.js and DockerAPI Microservices with Node.js and Docker
API Microservices with Node.js and DockerApigee | Google Cloud
 
Introduction to CloudHub 2.0
Introduction to CloudHub 2.0Introduction to CloudHub 2.0
Introduction to CloudHub 2.0NeerajKumar1965
 
10 Steps to Architecting a Sustainable SCADA System
10 Steps to Architecting a Sustainable SCADA System10 Steps to Architecting a Sustainable SCADA System
10 Steps to Architecting a Sustainable SCADA SystemInductive Automation
 
10 Steps to Architecting a Sustainable SCADA System
10 Steps to Architecting a Sustainable SCADA System10 Steps to Architecting a Sustainable SCADA System
10 Steps to Architecting a Sustainable SCADA SystemInductive Automation
 
Devops - Microservice and Kubernetes
Devops - Microservice and KubernetesDevops - Microservice and Kubernetes
Devops - Microservice and KubernetesNodeXperts
 

Similar to micro services architecture (FrosCon2014) (20)

Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
 
Montreal MuleSoft_Meetup_16-Aug.pptx
Montreal MuleSoft_Meetup_16-Aug.pptxMontreal MuleSoft_Meetup_16-Aug.pptx
Montreal MuleSoft_Meetup_16-Aug.pptx
 
Warsaw MuleSoft Meetup #13.pptx
Warsaw MuleSoft Meetup #13.pptxWarsaw MuleSoft Meetup #13.pptx
Warsaw MuleSoft Meetup #13.pptx
 
The journey to Native Cloud Architecture & Microservices, tracing the footste...
The journey to Native Cloud Architecture & Microservices, tracing the footste...The journey to Native Cloud Architecture & Microservices, tracing the footste...
The journey to Native Cloud Architecture & Microservices, tracing the footste...
 
Microservices
MicroservicesMicroservices
Microservices
 
Design Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise SolutionsDesign Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise Solutions
 
Design Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise SolutionsDesign Like a Pro: Planning Enterprise Solutions
Design Like a Pro: Planning Enterprise Solutions
 
Moving from Monolith to Microservices
Moving from Monolith to MicroservicesMoving from Monolith to Microservices
Moving from Monolith to Microservices
 
MuleSoft Manchester Meetup #4 slides 11th February 2021
MuleSoft Manchester Meetup #4 slides 11th February 2021MuleSoft Manchester Meetup #4 slides 11th February 2021
MuleSoft Manchester Meetup #4 slides 11th February 2021
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservices
 
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Kenzan: Architecting for Microservices
Kenzan: Architecting for MicroservicesKenzan: Architecting for Microservices
Kenzan: Architecting for Microservices
 
API Microservices with Node.js and Docker
API Microservices with Node.js and DockerAPI Microservices with Node.js and Docker
API Microservices with Node.js and Docker
 
Introduction to CloudHub 2.0
Introduction to CloudHub 2.0Introduction to CloudHub 2.0
Introduction to CloudHub 2.0
 
10 Steps to Architecting a Sustainable SCADA System
10 Steps to Architecting a Sustainable SCADA System10 Steps to Architecting a Sustainable SCADA System
10 Steps to Architecting a Sustainable SCADA System
 
10 Steps to Architecting a Sustainable SCADA System
10 Steps to Architecting a Sustainable SCADA System10 Steps to Architecting a Sustainable SCADA System
10 Steps to Architecting a Sustainable SCADA System
 
Devops - Microservice and Kubernetes
Devops - Microservice and KubernetesDevops - Microservice and Kubernetes
Devops - Microservice and Kubernetes
 
LinuxTag 2013
LinuxTag 2013LinuxTag 2013
LinuxTag 2013
 

More from smancke

micro services
micro servicesmicro services
micro servicessmancke
 
crowdgovernance, laterale it governance mit agilen teams
crowdgovernance, laterale it governance mit agilen teams crowdgovernance, laterale it governance mit agilen teams
crowdgovernance, laterale it governance mit agilen teams smancke
 
mobile development platforms
mobile development platformsmobile development platforms
mobile development platformssmancke
 
Jalimo Slides Linuxtag2008
Jalimo Slides Linuxtag2008Jalimo Slides Linuxtag2008
Jalimo Slides Linuxtag2008smancke
 
Jalimo Slides Linuxtag2007 (English)
Jalimo Slides Linuxtag2007 (English)Jalimo Slides Linuxtag2007 (English)
Jalimo Slides Linuxtag2007 (English)smancke
 
Jalimo Slides Linuxtag2007
Jalimo Slides Linuxtag2007Jalimo Slides Linuxtag2007
Jalimo Slides Linuxtag2007smancke
 

More from smancke (6)

micro services
micro servicesmicro services
micro services
 
crowdgovernance, laterale it governance mit agilen teams
crowdgovernance, laterale it governance mit agilen teams crowdgovernance, laterale it governance mit agilen teams
crowdgovernance, laterale it governance mit agilen teams
 
mobile development platforms
mobile development platformsmobile development platforms
mobile development platforms
 
Jalimo Slides Linuxtag2008
Jalimo Slides Linuxtag2008Jalimo Slides Linuxtag2008
Jalimo Slides Linuxtag2008
 
Jalimo Slides Linuxtag2007 (English)
Jalimo Slides Linuxtag2007 (English)Jalimo Slides Linuxtag2007 (English)
Jalimo Slides Linuxtag2007 (English)
 
Jalimo Slides Linuxtag2007
Jalimo Slides Linuxtag2007Jalimo Slides Linuxtag2007
Jalimo Slides Linuxtag2007
 

micro services architecture (FrosCon2014)

  • 2. 24.08.14 2 Monolythic Software Why are monolythic systems 'evil' ? Because of their dependencies: ● Software is not easy to test ● And hard to refactor ● Effects of changes can not be isolated ● Working with multiple developers/teams is challenging ● No reuse of functionality ● Runtime and deployment dependencies: ● Performance and scaling ● Deployment of features and releases
  • 3. 24.08.14 3 Avoid a Monolyth Monolyths arise from bad design, independent of the technology! ● You can build a monolyth with every software framework. ● Even distributed systems with a lot of services can be monolythic. ● And even software with monolythic builds and deployments may have a good internal structure. So, chosing a popular micro services framework is not enough!
  • 4. 24.08.14 4 Think Vertical! Split the application in functional modules Maximal reduction of dependencies between different functional parts Vertical teams (End-to-End)
  • 5. 24.08.14 5 Classical Approach GUI -Layer Services Database/Persistance
  • 6. 24.08.14 6 SOA Approach GUI -Layer Business Service DB Business Service Business Service Persistence Service DB Persistence Service DB Persistence Service DB Persistence Service DB Persistence Service
  • 7. 24.08.14 7 The Micro Services Way... GUI Service DB GUI Service DB GUI Service DB GUI Service DB
  • 10. 24.08.14 10 Micro Services Principles 1/2 Small with a single responsibility • Each application only does one thing • Small enough to fit in your head – “If a service is bigger than your head, than it is too big” • Small enough that you can throw them away – Rewrite or Maintain by James Lewis:
  • 11. 24.08.14 11 Micro Services Principles 2/2 by James Lewis: Located in different VCS roots • Each application is completely seperate • Domain Driven Design / Conway’s law – Domains in different bounded contexts shoud be distinct - and it is ok to have duplication – Use physical separation to enforce this • There will be common code, but it should be library and infrastructure code – Treat it as you would any other open source library – Stick it in a nexus repo somewhere and treat it as a binary dependency
  • 12. 24.08.14 12 Implementation No application servers ● Every service runs in it's own process ● Every service brings it's own environment Choose the right stack for the requirements ● 1 monolyth 1 stack, 100 Micro Services flexibility→ → ● Free choice of: OS, language, framework, database, .. ● But: Be careful! New feature, new service? ● At first check, if a feature should build a new functional module ● Only in the second step extend an existing service ● Rule: Merging services is easy, splitting is hard!
  • 13. 24.08.14 13 Java Frameworks ● Spring Boot ● Dropwizard ● Vert.x
  • 14. 24.08.14 14 Database Design goal: Every service should have it's own exclusive database Strategies ● NoSQL / document oriented design ● Treat foreign keys as REST URI references ● When a service needs external data: Call a service ● Don't fear data redundancy ● Replication of data: Pulling feeds with changelogs Tradeoff solutions ● Multiple schemas within the same database ● Read-only views for data of other services ● Use DB features for replication (e.g. database link)
  • 15. 24.08.14 15 UI Design goal: Services should provide their UI themselves Strategies ● Every service serves the full page, including layout and menu bar ● Commitment on one CSS naming schema ● Central asset service (menu, styles, common resources) ● Single page apps only within one service ● GUI composition only on the client (in the browser) ● Use UI fragments / widgets when embedding data of another service
  • 16. 24.08.14 16 Security Problem: The security context is spread over 100 services Solution: Identity Management System ● Identity Management is also a service module (or even multiple) ● Service for management of identities ● Service for login/logout ● Service for self administration ● OAuth2 allows distribution of the login to different services
  • 17. 24.08.14 17 Login implementations Variant a: Shared Cookie ● All services are available under the same domain ● The login service creates a cookie available to all others ● Username, timestamp, rolles/permissions ● Crypted and signed ● All services can verify the cookie by checking the signature Variant b: Independent Applications ● Every service maintains it's own session ● Login is done by OAuth2 ● Double redirect ● Token exchange ● The login service maintains a sessions as well ● Multiple logins are done transparent to the user
  • 19. 24.08.14 19 Communication Everything is allowed But: You should establish one standard for your platform. Principles ● Loose coupling – services should not know about each other ● Smart endpoints, dump pipes ● No intelligence in the communication channel ● No ESB REST is a good choice for many scenarios ● Easy consumable with all languages ● Interfaces are maintainable towards compatibility ● URI references are helpful for navigation to different services and abstraction of the physical location of resources.
  • 20. 24.08.14 20 Communication– further principles Asynchronous Messaging ● Reliable event distribution ● High performance ● Load protection of critical services Resilience ● Tolerance against failures ● Error recovery ● Avoid error cascades API Versioning ● Don't do it for internal APIs!
  • 21. 24.08.14 21 Testing Unit Tests ● Integration tests suffice in many cases because the services are small ● Test the isolated service (Other services should be mocked) Consumer Driven Tests Idea: The integration tests of a service will be defined and implemented by the consumer (not by the service provider). No release before the service passes all consumer's tests ● Test with the real expectations, not with the service specification ● Very smart concept, but hard to maintain ● Has the risk of high test-redundancy for common APIs
  • 22. 24.08.14 22 Deployment Contiuous Delivery ● Create a deployment pipeline ● Need to automate everything One monolyth may be easy to deploy, 100 Micro Services may not! Packaging & Provisioning ● Usage of established standards: DEB, RPM, … ● Robust init scripts ● Configuration management: Puppet, Chef, ...
  • 23. 24.08.14 23 Deployment as platform 1 Micro Service : 1 Linux System Docker ● LXC based virtualisation ● Similar to changeroot (but a lot better!) ● Slim and fast ● Based on git, so changes of the images can be tracked For Hardliners ● Install the Micro Service by shipping and starting the system image ● No packaging ● No init scripts
  • 24. 24.08.14 24 Monitoring Realtime metrics ● Monitor, what currently happens ● Fast reaction to problems ● Do monitoring inside the application, not outside ● Tools: Metrics, Spring Boot Actuator Logging ● Manual search in logs of 100 services is not possible ● Central log aggregation ● Filtering and analyses in realtime ● Tools: Logstash, Graylog2, Kibana, Apache Flume, fluentd
  • 25. 24.08.14 25 Risks Micro Services are a promising paradigm But, you should always be careful with new paradigms! ● Inventarisation of many services ● Challenging for operations ● High network load (if not done right) ● New way of thinking ● The freedom of technology selection may lead to chaos, if it is no governance