SlideShare a Scribd company logo
Design patterns for
microservice architecture
x
whoami
• Lead Software Developer

@ The Software House

• adiqpl @ twitter

• adrian@zmenda.com

• linkedin.com/in/adrianzmenda
Adrian Zmenda
What we’ll cover today
• Basics

• Communication

• Internal Communication

• Security

• Availability

• Configuration

• Logging
Should I use microservices?
What is a microservice?
• Loosely coupled

• Independently deployable

• Highly maintainable and testable

• Organized around business capabilities

• Owned by a small team
When microservices are good idea
• Complex application

• High scalability

• Rapid and frequent delivery
Drawbacks
• running distributed system is hard
• maintaining consistency is challenging

• ops complexity is high
Should I start with microservices?
Monolith
Monolith
source: CBS
source: Simon Brown
Modular Monolith
source: Simon Brown
Can we go even further?
Self-Contained System
source: Roman Stranghöner
Self-Contained System
sooo, it’s like microservices. right?
Communication
Direct
Gateway
Backend For Frontend
Internal Communication
Remote Procedure Invocation
• Synchronous

• Simple

• Easy to understand

• Follows Request / (Response)
REST
• Familiar

• Based on HTTP

• No intermediate broker
source: nginx
Apache Thrift
• Backed by Facebook

• Language neutral contract-file

• Code generation

• Support for notifications
• Backed by Google

• Calls visible as internal

• Code generation

• Simple contracts (Protocol Buffers)
Message Broker
• Asynchronous

• Follows Publish / Subscribe

• Increases complexity
source: nginx
Message Broker
Combined Messaging
source: nginx
Security
No ACL
• Simple

• Rarely possible

• No additional over-head
ACL in every microservice
• Duplication of ACL logic

• Redistributes ACL across all microservices

• Contexts mixing
ACL as dependent microservice
• ACL defined as single microservice

• Prevents duplication and redistribution

• Could be a Single Point of Failure
ACL on Gateway
• ACL on Gateway (could be implemented as microservice)

• No duplicated ACL code in microservices

• No huge over-head, simplifies internal communication
Availability
?
?
DNS
?
Load Balancer
(router)
Service Discovery
Client-Side Service Discovery
Server-Side Service Discovery
Service Registries
Self-Registration
3rd Party Registration
Consul
• Service Registry

• Healthchecking

• Key/Value Storage

• Secure Communication

• Multi Datacenter
Handle Failures
• Define network timeouts

• Limit no. of outstanding requests

• Provide fallbacks
Circuit Braker
Configuration
Externalized Configuration
{
   "sectionA":{
      "valueA":"ABC123",
      "valueB":"XYZ321"
   }
}
One configuration to rule them all
{
   "sectionA":{
      "valueA":"ABC123",
      "valueB":"XYZ321"
   },
   "sectionB":{
      "valueC":"ABC123",
      "valueD":"XYZ321"
   }
}
One configuration to rule them all
{
   "sectionA":{
      "valueA":"ABC123",
      "valueB":"XYZ321"
   },
   "sectionB":{
      "valueC":"ABC123",
      "valueD":"XYZ321"
   }
}
{
   "sectionA":{
      "valueA":"ABC123",
      "valueB":"XYZ321"
   }
}
Logging( )
Tracing
How to debug microservices?
• Aggregate all logs in one place

• Track Exceptions

• Trace requests

• Visualize
Design patterns for microservice architecture
Measure
• Monitor relevant platform details:

• execution time of db queries;

• request execution time;

• number of request per minute;

• response times;

• success/failure ratio;

• resources usage
Prometheus
Grafana
Now, we can do microservices
the right way
Can we do them fast?
Define standards / contracts
Embrace tooling
Example: Service structure generation
Example: GRPC code generation
Example: GRPC code generation
How to organize microservices
in code repositories?
Multi-repository
• Pros:

• better owner (team) separation;

• clear scope

• Cons:

• hard to keep consistency (versioning is complex);

• risk of becoming a monolith;

• introduces more CI/CD setup costs
Mono-repository
• Pros:

• easy to maintain consistency;

• easier versioning

• Cons:

• different teams may affect each other;

• might lead to tight coupling;

• longer build times
• Databases

• Testing

• CI / CD as essential tool

• Destructive Testing

• Deployments

• many, many more…
What we didn’t covered today
youtu.be/D8l19VEokBA
Summary
• think twice if you really need a microservice architecture

• ensure you have all necessary resources to operate distributed systems

• make cold and educated decisions what’s best for your case, not netflix

• embrace contracts and tooling
Resources
• microservices.io

• martinfowler.com/microservices

• scs-architecture.org

• codingthearchitecture.com

• nginx.com/blog/introduction-to-microservices
Don’t miss our upcoming webinars!
Sign up for our newsletter! ✍
tsh.io/newsletter
Thanks 😉
tsh.io

More Related Content

PPTX
Introduction to microservices
Paulo Gandra de Sousa
 
PPTX
Microservices
SmartBear
 
PPTX
Introduction To Microservices
Lalit Kale
 
PDF
Microservice Architecture
Nguyen Tung
 
PPTX
Introduction to Microservices
Roger van de Kimmenade
 
PDF
Microservice Architecture
tyrantbrian
 
PPSX
Microservices Architecture, Monolith Migration Patterns
Araf Karsh Hamid
 
PPTX
Microservice architecture design principles
Sanjoy Kumar Roy
 
Introduction to microservices
Paulo Gandra de Sousa
 
Microservices
SmartBear
 
Introduction To Microservices
Lalit Kale
 
Microservice Architecture
Nguyen Tung
 
Introduction to Microservices
Roger van de Kimmenade
 
Microservice Architecture
tyrantbrian
 
Microservices Architecture, Monolith Migration Patterns
Araf Karsh Hamid
 
Microservice architecture design principles
Sanjoy Kumar Roy
 

What's hot (20)

PPTX
Microservices Architecture - Bangkok 2018
Araf Karsh Hamid
 
PDF
Microservices architecture
Abdelghani Azri
 
PPSX
Microservices Architecture - Cloud Native Apps
Araf Karsh Hamid
 
PDF
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Richard Langlois P. Eng.
 
PPSX
Microservices Testing Strategies JUnit Cucumber Mockito Pact
Araf Karsh Hamid
 
PDF
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Edureka!
 
PDF
Why Microservice
Kelvin Yeung
 
PPTX
Microservice vs. Monolithic Architecture
Paul Mooney
 
PPSX
Service Mesh - Observability
Araf Karsh Hamid
 
PPTX
Introduction to Microservices Patterns
Dimosthenis Botsaris
 
PDF
A pattern language for microservices - June 2021
Chris Richardson
 
PPTX
Platform engineering 101
Sander Knape
 
PDF
Practical Microservice Architecture (edition 2022).pdf
Ahmed Misbah
 
PDF
Micro Frontends
Spyros Ioakeimidis
 
PPTX
Introduction to Microservices
MahmoudZidan41
 
PDF
Docker swarm
Alberto Guimarães Viana
 
PPTX
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Simplilearn
 
PPTX
Microsoft Azure Technical Overview
gjuljo
 
PPTX
Microservices Part 3 Service Mesh and Kafka
Araf Karsh Hamid
 
PPTX
Springboot Microservices
NexThoughts Technologies
 
Microservices Architecture - Bangkok 2018
Araf Karsh Hamid
 
Microservices architecture
Abdelghani Azri
 
Microservices Architecture - Cloud Native Apps
Araf Karsh Hamid
 
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Richard Langlois P. Eng.
 
Microservices Testing Strategies JUnit Cucumber Mockito Pact
Araf Karsh Hamid
 
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Edureka!
 
Why Microservice
Kelvin Yeung
 
Microservice vs. Monolithic Architecture
Paul Mooney
 
Service Mesh - Observability
Araf Karsh Hamid
 
Introduction to Microservices Patterns
Dimosthenis Botsaris
 
A pattern language for microservices - June 2021
Chris Richardson
 
Platform engineering 101
Sander Knape
 
Practical Microservice Architecture (edition 2022).pdf
Ahmed Misbah
 
Micro Frontends
Spyros Ioakeimidis
 
Introduction to Microservices
MahmoudZidan41
 
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Simplilearn
 
Microsoft Azure Technical Overview
gjuljo
 
Microservices Part 3 Service Mesh and Kafka
Araf Karsh Hamid
 
Springboot Microservices
NexThoughts Technologies
 
Ad

Similar to Design patterns for microservice architecture (20)

PDF
Introduction to Microservices.pdf
ShehanNIlanka
 
PDF
Service Mesh Talk for CTO Forum
Rick Hightower
 
PDF
Microservices - Hitchhiker's guide to cloud native applications
Stijn Van Den Enden
 
PPTX
Yuriy Chapran - Building microservices.
Yuriy Chapran
 
PPTX
Service Mesh CTO Forum (Draft 3)
Rick Hightower
 
PDF
Microservices Interview Questions and Answers pdf by ScholarHat
Scholarhat
 
PPTX
Microservice architecture
Touraj Ebrahimi
 
PPTX
Microservices Architecture & Testing Strategies
Araf Karsh Hamid
 
PPTX
Microservices architecture
Faren faren
 
PDF
Everything you want to know about microservices
Youness Lasmak
 
PDF
Microservice - Intro and Discussion
SagarDevkota8
 
PDF
Microservices Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
ODP
Monolithic to Microservices Architecture - STM 6
Tricode (part of Dept)
 
PDF
A Gentle introduction to microservices
Gianluca Padovani
 
PPTX
Micro-services architecture
Farwa Ansari
 
PDF
Microservices architecture overview v3
Dmitry Skaredov
 
PPTX
Intro to spring cloud &microservices by Eugene Hanikblum
Eugene Hanikblum
 
PPTX
Microservices: A developer's approach
Foyzul Karim
 
PPSX
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Araf Karsh Hamid
 
PPTX
Microservices - Peixe Urbano Tech Talks
Pedro Mendes
 
Introduction to Microservices.pdf
ShehanNIlanka
 
Service Mesh Talk for CTO Forum
Rick Hightower
 
Microservices - Hitchhiker's guide to cloud native applications
Stijn Van Den Enden
 
Yuriy Chapran - Building microservices.
Yuriy Chapran
 
Service Mesh CTO Forum (Draft 3)
Rick Hightower
 
Microservices Interview Questions and Answers pdf by ScholarHat
Scholarhat
 
Microservice architecture
Touraj Ebrahimi
 
Microservices Architecture & Testing Strategies
Araf Karsh Hamid
 
Microservices architecture
Faren faren
 
Everything you want to know about microservices
Youness Lasmak
 
Microservice - Intro and Discussion
SagarDevkota8
 
Microservices Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Monolithic to Microservices Architecture - STM 6
Tricode (part of Dept)
 
A Gentle introduction to microservices
Gianluca Padovani
 
Micro-services architecture
Farwa Ansari
 
Microservices architecture overview v3
Dmitry Skaredov
 
Intro to spring cloud &microservices by Eugene Hanikblum
Eugene Hanikblum
 
Microservices: A developer's approach
Foyzul Karim
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Araf Karsh Hamid
 
Microservices - Peixe Urbano Tech Talks
Pedro Mendes
 
Ad

More from The Software House (20)

PDF
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
The Software House
 
PDF
Uszanowanko Podsumowanko
The Software House
 
PDF
Jak efektywnie podejść do certyfikacji w AWS?
The Software House
 
PDF
O co chodzi z tą dostępnością cyfrową?
The Software House
 
PDF
Chat tekstowy z użyciem Amazon Chime
The Software House
 
PDF
Migracje danych serverless
The Software House
 
PDF
Jak nie zwariować z architekturą Serverless?
The Software House
 
PDF
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
The Software House
 
PDF
Feature flags na ratunek projektu w JavaScript
The Software House
 
PDF
Typowanie nominalne w TypeScript
The Software House
 
PDF
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
The Software House
 
PDF
Serverless Compose vs hurtownia danych
The Software House
 
PDF
Testy API: połączenie z bazą danych czy implementacja w pamięci
The Software House
 
PDF
Jak skutecznie read model. Case study
The Software House
 
PDF
Firestore czyli ognista baza od giganta z Doliny Krzemowej
The Software House
 
PDF
Jak utrzymać stado Lambd w ryzach
The Software House
 
PDF
Jak poskromić AWS?
The Software House
 
PDF
O łączeniu Storyblok i Next.js
The Software House
 
PDF
Amazon Step Functions. Sposób na implementację procesów w chmurze
The Software House
 
PDF
Od Figmy do gotowej aplikacji bez linijki kodu
The Software House
 
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
The Software House
 
Uszanowanko Podsumowanko
The Software House
 
Jak efektywnie podejść do certyfikacji w AWS?
The Software House
 
O co chodzi z tą dostępnością cyfrową?
The Software House
 
Chat tekstowy z użyciem Amazon Chime
The Software House
 
Migracje danych serverless
The Software House
 
Jak nie zwariować z architekturą Serverless?
The Software House
 
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
The Software House
 
Feature flags na ratunek projektu w JavaScript
The Software House
 
Typowanie nominalne w TypeScript
The Software House
 
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
The Software House
 
Serverless Compose vs hurtownia danych
The Software House
 
Testy API: połączenie z bazą danych czy implementacja w pamięci
The Software House
 
Jak skutecznie read model. Case study
The Software House
 
Firestore czyli ognista baza od giganta z Doliny Krzemowej
The Software House
 
Jak utrzymać stado Lambd w ryzach
The Software House
 
Jak poskromić AWS?
The Software House
 
O łączeniu Storyblok i Next.js
The Software House
 
Amazon Step Functions. Sposób na implementację procesów w chmurze
The Software House
 
Od Figmy do gotowej aplikacji bez linijki kodu
The Software House
 

Recently uploaded (20)

PPT
FALLSEM2025-26_ISWE304L_TH_VL2025260102786_2025-07-10_Reference-Material-II.ppt
AKSHAYA255427
 
PPTX
Save Business Costs with CRM Software for Insurance Agents
Insurance Tech Services
 
PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
PPTX
Materi-Enum-and-Record-Data-Type (1).pptx
RanuFajar1
 
PDF
Build Multi-agent using Agent Development Kit
FadyIbrahim23
 
PPTX
Presentation of Computer CLASS 2 .pptx
darshilchaudhary558
 
PDF
Multi-factor Authentication (MFA) requirement for Microsoft 365 Admin Center_...
Q-Advise
 
PDF
Become an Agentblazer Champion Challenge Kickoff
Dele Amefo
 
PDF
Comprehensive Salesforce Implementation Services.pdf
VALiNTRY360
 
PDF
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PDF
Become an Agentblazer Champion Challenge
Dele Amefo
 
PPTX
Why Use Open Source Reporting Tools for Business Intelligence.pptx
Varsha Nayak
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Exploring AI Agents in Process Industries
amoreira6
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
PDF
A REACT POMODORO TIMER WEB APPLICATION.pdf
Michael624841
 
FALLSEM2025-26_ISWE304L_TH_VL2025260102786_2025-07-10_Reference-Material-II.ppt
AKSHAYA255427
 
Save Business Costs with CRM Software for Insurance Agents
Insurance Tech Services
 
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
Materi-Enum-and-Record-Data-Type (1).pptx
RanuFajar1
 
Build Multi-agent using Agent Development Kit
FadyIbrahim23
 
Presentation of Computer CLASS 2 .pptx
darshilchaudhary558
 
Multi-factor Authentication (MFA) requirement for Microsoft 365 Admin Center_...
Q-Advise
 
Become an Agentblazer Champion Challenge Kickoff
Dele Amefo
 
Comprehensive Salesforce Implementation Services.pdf
VALiNTRY360
 
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
Become an Agentblazer Champion Challenge
Dele Amefo
 
Why Use Open Source Reporting Tools for Business Intelligence.pptx
Varsha Nayak
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Exploring AI Agents in Process Industries
amoreira6
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
A REACT POMODORO TIMER WEB APPLICATION.pdf
Michael624841
 

Design patterns for microservice architecture