SlideShare a Scribd company logo
1 of 98
Ahmed MISBAH - December 2022
Practical Microservice
Architecture
2022 edition
About the speaker
Role and previous talks
• Chief Software Engineer
• Independent Consultant and Coach
• Speaker at:
‣ DevOpsDays Cairo
‣ AMECSE
‣ Orange DevTest Days
‣ GDG
‣ Delta Technopreneurs
‣ JDC
About the speaker
Topics of interest
• DevOps
• Agile and Lean
• Cloud-Native Apps and beyond
• Software Architecture
• Java
• FOSS
• Arti
fi
cial Intelligence and ML
About the speaker
Experience
• 9 years at Orange Innovation Egypt
• Delivered two award winning innovative
solutions
• Worked at two startups
• Helped many others!
• Winner of Dell Hacktrick 2022 UI/UX track
• MSc. degree in ML and many other
professional certi
fi
cations
Nile University
J;.lll ~l:J.. Qtertifirate
(3/'~
This is to certify that
Ahmed Mahmoud Amir Misbah
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
Has successfully completed the program of study
and fulfilled the requirements for
BigData & Data Science Diploma
for the period from October 2015 to July 2016
...f:.!.l...~'!!~~!.tf....El..#.!(!.~.1..
INF Program Director
~~.__QI II
C.a.::::a..;r:q;;; AU J M
IW fl ,
: ~t '-M4'
October 2016 ·
····························••-
•··············
Date
Practical Microservice Architecture
Agenda
• Section 1: Introduction
• Section 2: Microservices for Greenfield projects
• Section 3: Microservices for Brownfield projects
Practical Microservice Architecture
Agenda
➡ Section 1: Introduction
• Section 2: Microservices for Greenfield projects
• Section 3: Microservices for Brownfield projects
Introduction
Topics
• Motivations
• What is Microservice Architecture?
• Why Microservice Architecture?
• Microservice Architecture Challenges
• When and when not to go for Microservices?
Introduction
Topics
➡ Motivations
• What is Microservice Architecture?
• Why Microservice Architecture?
• Microservice Architecture Challenges
• When and when not to go for Microservices?
Motivations
Why this session?
• Been working with Service Oriented Architecture (SOA) since 2009.
• Been working with Microservices since 2016 in both green
fi
eld and brown
fi
eld
projects and products.
• Seen Microservice Architecture being adopted and implemented both right
and wrong, mostly wrong!
• Was inspired by Lean practice of “Do it Right the First Time” (DRIFT).
Introduction
Topics
• Motivations
➡ What is Microservice Architecture?
• Why Microservice Architecture?
• Microservice Architecture Challenges
• When and when not to go for Microservices?
What is Microservice Architecture?
The De
fi
nition
Microservice Architecture is an architectural
style that structures an application as a
collection of services that are:
• Highly maintainable and testable
• Loosely coupled
• Independently deployable
• Organized around business capabilities or
bounded context
• Owned by small teams
What is Microservice Architecture?
The Seven Principles
Principle Patterns / Practices
Modeled around business domain Conway’s Law, Domain Driven Design (DDD)
Hide implementation details Remote Procedure Invocation (RPI) and Messaging
Culture of automation Extreme Programming (XP) Practices, DevOps
Highly decentralized Domain Driven Design (DDD)
Deployed independently Continuous Delivery and Deployment
Isolate failure Circuit Breaker Pattern, Reactive Manifesto
Highly observable Continuos Monitoring, Service Mesh
What is Microservice Architecture?
The Patterns
What is Microservice Architecture?
Enablers
• Domain Driven Design (DDD)
• DevOps (and its extensions)
• Agile Software Development
• Containers (e.g., Docker)
• Container Orchestration (e.g., Kubernetes)
• Service Mesh (e.g., Istio or eBPF)
• Message Brokers and Streaming (e.g., Kafka)
• Public Cloud (e.g., AWS)
What is Microservice Architecture?
Is it new?
What is Microservice Architecture?
Is it new?
• Dr. Peter Rodgers used the term “Micro-Web-Services” in 2005 during a
presentation on cloud computing.
• The term “microservices” was discussed at a conference / workshop of
software architects in May 2011 to describe what the participants saw as a
common architectural style that many of them had been recently exploring.
• March 2012, Microservices were presented as a case study in March 2012 at
33rd Degree in Krakow in “Microservices - Java, the Unix Way”.
• Adrian Cockcroft at Net
fl
ix, described this approach as "
fi
ne grained SOA”.
What is Microservice Architecture?
Is it just SOA++?
2005 2008 2016
Introduction
Topics
• Motivations
• What is Microservice Architecture?
➡ Why Microservice Architecture?
• Microservice Architecture Challenges
• When and when not to go for Microservices?
Marc Andreessen
“Software is eating the world.”
Watts S. Humphrey
“Every business is a software business.”
Satya Nadella
“Every company is a software company. You have to start
thinking and operating like a digital company.”
Why Microservices?
Business and Digital Transformation
• Transformation (aka. Organization Transformation) is the process of
implementing changes across di
ff
erent core organization pillars (people,
process, technology, and culture) in order to improve, boost and benchmark
the organizational performance and sustain such results in a resilient way.
• Business Transformation: an umbrella term that is used for referring to the
fundamental changes in how an organization conducts its business.
• Digital Transformation: the process of using digital technologies to: (1) meet
the needs of the transformed business processes and (2) create innovative
customer engagement mechanisms.
Why Microservices?
Microservices and Digital Transformation
• Microservices enable organizations to evolve their structure and technology
stack through structuring their application(s) as a collection of services.
• In Digital Transformation, Microservice Architecture is a catalyst for the
creation of exceptional customer and employee value through signi
fi
cant
change that leverages the potential of process, technology, data and culture
to create this value.
Why Microservices?
Digital Transformation Trends - Past and Present
Development Process Application Architecture Deployment and Packaging Application Infrastructure
Waterfall
Agile
DevOps
Monolithic
N-Tier | SOA
Microservices
Physical Servers
Virtual Server
Containers
Datacenter
Hosted
Cloud
Why Microservices?
Technical Bene
fi
ts
• Technology Heterogeneity
• Ease of Deployment
• Scaling
• Robustness
• Composability
Why Microservices?
Organizational and Business Bene
fi
ts
• Improve Team Autonomy
• Reduce Time to Market
• Scale Cost-e
ff
ectively for Load
• Improve Robustness
• Easily scale teams
• Embrace New Technology
Introduction
Topics
• Motivations
• What is Microservice Architecture?
• Why Microservice Architecture?
➡ Microservice Architecture Challenges
• When and when not to go for Microservices?
Microservice Architecture Challenges
It’s not all sunshine and roses!
1. Learning Curve
2. Monitoring
3. Troubleshooting and debugging
4. Handling failures
5. Security
6. Testing
7. Latency
8. Data Consistency
9. Infrastructure provisioning
10. Deployment
Introduction
Topics
• Motivations
• What is Microservice Architecture?
• Why Microservice Architecture?
• Microservice Architecture Challenges
➡ When and when not to go for Microservices?
When and when not to go for Microservices?
Questions to ask
• What are your goals and vision on scaling up?
• Is your business model tested and proven?
• Is your business mature enough to adopt Microservices?
• Do you have a complete understanding of what Microservices are and how they
could in
fl
uence your development operations?
• How strong is your practice of application infrastructure?
• Do you have a tried and tested agile or DevOps practices?
• Is your data management team skilled enough to support the incorporation?
When and when not to go for Microservices?
When to go for Microservices?
• If you’re building a highly agile application (product or service) that demands
swift speed of delivery, innovation and more
• When you want your (legacy) monolithic application to accommodate
scalability, agility, manageability and delivery speed
• When you have standalone business applications or modules that have to be
reused across diverse channels
When and when not to go for Microservices?
When not to go for Microservices?
• When you’re a Startup.
• The application is too small to justify Microservices.
• The domain is unclear or uncertain, which makes the domain model uncertain.
• The organization can’t change to adapt to the Microservice way.
• Team lacks experience and understanding of Microservice concepts, DDD, or conceptual
design.
• Team is not mature, technical skillset is not adapted, or turnover is high. Since code
cleanliness and architecture tend to decay over time because of entropy, and since a more
complex architecture is harder to maintain, this may exacerbate consequences of point.
Practical Microservice Architecture
Agenda
• Section 1: Introduction
➡ Section 2: Microservices for Greenfield projects
• Section 3: Microservices for Brownfield projects
Microservices for Greenfield projects
What are Green
fi
eld projects?
• In many disciplines, a Green
fi
eld project is one that lacks constraints
imposed by prior work.
• The analogy is similar to that of construction on green
fi
eld land where there is
no need to work within the constraints of existing buildings or infrastructure.
• In Software Development, a green
fi
eld project is a brand-new project
developed from scratch.
• This project does not rely on any existing code, use minimal to no established
infrastructure, and don't need to
fi
t any particular mold.
Microservices for Greenfield projects
Microservices Adoption Strategies
Is the the team(s) and
organization in need of and ready
for Microservices?
Microservice-
fi
rst
Monolith-
fi
rst
No Yes
Assessing readiness
Microservices for Greenfield projects
Assess Team Readiness
Microservices for Greenfield projects
Assess Ability - The checklist
✓ Conway’s Law
✓ Domain Driven Design (DDD)
✓ Distributed Architecture
✓ Event-driven Architecture
✓ Microservice Architecture, its patterns, and its test strategies
✓ DevOps (CI/CD, Release Strategies, IaC, etc.)
✓ Cloud-native architecture and technologies
✓ Agile software development and organization at scale
✓ Test Automation (Application - functional non-functional and Infrastructure)
✓ The domain and its sub-domains are clear
Microservices for Greenfield projects
Situational Leadership
R1 R2
R3 R4
Monolith-first
Microservices for Greenfield projects
Microservices Adoption Strategies
Is the the team(s) and
organization in need of and ready
for Microservices?
Microservice-
fi
rst
Monolith-
fi
rst
No Yes
Microservices for Greenfield projects
Monolith-
fi
rst Approach
• If your team and organization are not yet ready to adopt Microservice
Architecture, it is advisable to start with Monolith-
fi
rst approach.
• Not all monoliths are bad!
• Start with a Modular Monolith (aka. Modulith).
• A modular monolith can be achieved by applying DDD with Hexagonal,
Onion, or Clean Architecture.
• Once the team and organization are ready, the monolith can be split and
migrated to Microservice architecture (to be discussed in Section 3).
Microservices for Greenfield projects
Basic forces acting on software design
• Those were incepted in the mid-70s by Yourdon and
Constantine in “Structured Design” and haven’t changed.
• Their argument goes like this:
‣ We design software to reduce its cost.
‣ The cost of software is = the cost of changing the software.
‣ The cost of changing the software is = the cost of the
expensive changes.
‣ The cost of the expensive changes is generated by
cascading changes (i.e., Coupling)
‣ So, design = cost = change = big change = coupling.
‣ Transitively, software design = managing coupling.
Microservices for Greenfield projects
Monoliths are not bad!
• Teams hastily jump to Microservices
• That is because they’re seeking bene
fi
ts they aren’t currently getting and
expect them from Microservices
• We need to remember that Microservices aren’t the point!
Microservice-first
Microservices for Greenfield projects
Microservices Adoption Strategies
Is the the team(s) and
organization in need of and ready
for Microservices?
Microservice-
fi
rst
Monolith-
fi
rst
No Yes
Microservices for Greenfield projects
Microservice-
fi
rst Approach
1. Choose a decomposition strategy:
• Business Capability (Conway’s Law)
• Sub-domain (DDD)
• Team
2. If Decomposition by Sub-domain is chosen, the
fi
rst step is to identify the
sub-domain and bounded contexts. Event Storming can be used for that.
3. Design your architecture and choose your technology stack.
Melvin E. Conway - Conway’s Law (1968)
“Any organization that designs a system (defined broadly) will
produce a design whose structure is a copy of the
organization's communication structure.”
Microservices for Greenfield projects
Spotify Engineering Culture
Microservices for Greenfield projects
What’s next?
• Remember the goals!
• Start with a walking skeleton (the MVP of architecture)
• De
fi
ne measures
• Compare with maturity matrix
• Implement feedback loops
• Continuously measure and improve
• Once you have something implemented, deployed and releases, you know have a
brown
fi
eld project. Check the next section!
Microservices for Greenfield projects
Measuring Software Architecture
• Four Key Metrics:
‣ Deployment Frequency
‣ Lead time for changes
‣ Change failure rate
‣ Time to restore service
• Fitness Functions
Microservices for Greenfield projects
More Metrics
Scan QR for my LinkedIn
post
Microservices for Greenfield projects
Fitness Functions
• “An architectural
fi
tness function is any mechanism
that provides an objective integrity assessment of
some architectural characteristic(s).”
• “An objective function used to summarize how
close a prospective design solution is to achieving
the set aims.”
• “Fitness functions, a concept borrowed from
evolutionary computing, are a concise method that
can also be used to de
fi
ne software system
metrics.”
Microservices for Greenfield projects
Fitness Function Categories
Mandatory Optional
Microservices for Greenfield projects
Tools used to de
fi
ne Fitness Functions
• Monitoring Tools (performance, scalability, etc.)
• Code metrics (coupling, cyclomatic complexity, etc.)
• Chaos Engineering
• Architecture Testing frameworks
• Security scanning
Microservices for Greenfield projects
An example of a Fitness Function (1)
“Unit Test Coverage > 0.9;
Execute on each CI Build; Fail when below target coverage”
• Breadth of feedback: Atomic
• Execution Trigger: Triggered
• Execution Location: CI
• Metric Type: a speci
fi
c value (90%)
• Quality attribute requirement: maintainability
• Static or dynamic: static
Microservices for Greenfield projects
An example of a Fitness Function (2)
“Deploy the new release to our production system (at night, 01:00 AM).
While the release is rolled out, constantly perform the regression test set
containing the 5 main end user use cases (login, put item to cart,
remove item from cart, view cart, checkout). The system performs all actions
and responds within 100ms. Fail when test case fails; Fail when system doesn’t perform actions and respond < 100ms”
• Breadth of feedback: Holistic
• Execution Trigger and location: Triggered, production environment
• Metric Type: discrete (performance), true/false (system is deployed or not)
• Quality attribute requirement: performance, reliability
• Static or dynamic: static
Practical Microservice Architecture
Agenda
• Section 1: Introduction
• Section 2: Microservices for Greenfield projects
➡ Section 3: Microservices for Brownfield projects
Microservices for Brownfield projects
What is a Brown
fi
eld project?
• A brown
fi
eld project is one that carries constraints related to the current state
of the site.
• In other words, the site might be contaminated or have existing structures that
architects have to tear down or modify in some way before the project can move
forward.
• Brown
fi
eld software development refers to the development and deployment of
a new software system in the presence of existing or legacy software systems.
• Brown
fi
eld development usually happens when you want to develop or improve
upon an existing application, and compels you to work with previously created
code.
Microservices for Brownfield projects
Microservices Adoption Strategies
Is the project a
Monolith?
Refactor or rewrite
existing project to a
modular design
No Yes
Is the the team and
organization ready?
Yes
No
Migrate to
Microservices
1
We will talk
about this
Are bounded contexts
well de
fi
ned?
Merge the services
No Yes
1 Using Microservices
Are you
succeeding with
Microservices?
No Yes
Continue using
Microservices
Refactor or improve
based on the problem
We will talk
about this
We will talk
about this
Migrating to Microservices
Microservices for Brownfield projects
Microservices Adoption Strategies
Is the project a
Monolith?
Refactor or rewrite
existing project to a
modular design
No Yes
Is the the team and
organization ready?
Yes
No
Migrate to
Microservices
1
Migrating to Microservices
Migration Approaches
1. Big Bang Approach: Creating a new application from scratch
2. Incremental Approach: Gradually migrate to Microservice Architecture
Big Bang Approach Gradual Approach
Migrating to Microservices
Incremental Approach
• Monolithic functionalities can be extracted gradually to be implemented in
Microservices by splitting the monolithic application based on business
capabilities, teams, or sub-domain (DDD).
• Such Microservices include business functionalities exposed as API calls.
They can also access the monolithic database or have their own autonomous
database.
• Many patterns exist for splitting monolithic application. One of the most
useful and commonly used techniques is the Strangler Fig Application.
Migrating to Microservices
Strangler Fig Application Pattern
• The idea of Strangler Fig Application
Pattern is to have the new system
initially supported by the existing
system.
• The old and the new systems can
coexist, giving the new system time
to grow and potentially entirely
replace the old system.
Migrating to Microservices
Bene
fi
ts of Incremental Approach and Strangler Fig
• Allows new evolutions to be delivered during the migration phase.
• The new system will always be up-to-date.
• Zero Downtime Deployments (ZDD).
Migrating to Microservices
Stages of Strangler Fig Application Pattern
1. Identify: identify parts of the legacy
application that will be migrated. DDD can be
used to identify various bounded contexts
2. Transform: implement this functionality in a
new Microservice
3. Co-exist: leave the existing module in the
legacy application as is. Incrementally re-route
calls from the monolith to the new micro service
4. Eliminate: once the tra
ffi
c is completely
redirected to the micro service, eliminate the
legacy module
Migrating to Microservices
What about the Databases?
• You can start with a shared DB,
• Then start decomposing the DB using a
pattern,
• Finally, you should end up with one DB per
Microservice.
Microservices gone wrong!
Microservices gone wrong!
How can you tell if you’re doing Microservices wrong?
• There are no bounded contexts
• You have a Microservice per resource (like REST APIs)
• A single team is working on multiple services
• There is high coupling between services
• Your deployment strategy is Multi-service deployment
• Deployments are hard
• Operational costs are high with no real ROI
• Not meeting organization goals (and not having measures to know that)
Merging the services
Microservices for Brownfield projects
Microservices Adoption Strategies
Is the project a
Monolith?
Refactor or rewrite
existing project to a
modular design
No Yes
Is the the team and
organization ready?
Yes
No
Migrate to
Microservices
1
Are bounded contexts
well de
fi
ned?
Merge the
services
No Yes
1 Using Microservices
Are you
succeeding with
Microservices?
No Yes
Continue using
Microservices
Refactor or improve
based on the problem
Merging the Services
Microservice Architecture gone wrong
When teams and their organizations implement Microservice architecture before
they’re ready, two main anti-patterns occur:
1. Distributed Monolith
2. Nano-services: an SOA anti-pattern where services are too
fi
ne grained
that their overhead (communications, maintenance etc.) out-weights their
utility.
Merging the Services
Fixing Distributed Monoliths and Nano-services
• These two anti-patterns can be solved by merging services so that:
1. It is back to a single service (a monolith that is either layered or modular)
2. Bounded contexts are properly identi
fi
ed and services are merged to
represent these bounded contexts and be owned by small teams
• Stranger Fig pattern can be used in merging nano-services
Refactor or improve based on
the problem
Microservices for Brownfield projects
Microservices Adoption Strategies
Is the project a
Monolith?
Refactor or rewrite
existing project to a
modular design
No Yes
Is the the team and
organization ready?
Yes
No
Migrate to
Microservices
1
Are bounded contexts
well de
fi
ned?
Merge the services
No Yes
1 Using Microservices
Are you
succeeding with
Microservices?
No Yes
Continue using
Microservices
Refactor or improve
based on the problem
Refactor or improve based on the problem
How does it work?
• One technique that can be applied is the OODA Loop.
• OODA Loop can be completed with other techniques like 5 Whys, Fishbone
analysis, and Gap analysis.
Refactor or improve based on the problem
Common problems and possible solutions
• Dependency between services:
‣ Monorepos
‣ Feature Toggles
‣ Release Trains
‣ DDD
• Poor observability: Service Mesh
• Failures on production: Microservice Test Strategies (Martin Fowler)
Thank you!
References
References
References
My website
Scan QR to access my
website
Book a free call to arrange a workshop
• Microservice Architecture workshop
• Serverless Architectures workshop
• Service Mesh session
• DevOps Maturity Assessment workshop
• DevOps for Enterprises workshop
• CI/CD workshop
• Hands-on DevOps mentorship
Scan to book a free call

More Related Content

What's hot

What's hot (20)

Istio Service Mesh
Istio Service MeshIstio Service Mesh
Istio Service Mesh
 
Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICD
 
DevOps a pratical approach
DevOps a pratical approachDevOps a pratical approach
DevOps a pratical approach
 
Slide DevSecOps Microservices
Slide DevSecOps Microservices Slide DevSecOps Microservices
Slide DevSecOps Microservices
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous Delivery
 
2019 DevSecOps Reference Architectures
2019 DevSecOps Reference Architectures2019 DevSecOps Reference Architectures
2019 DevSecOps Reference Architectures
 
DevSecOps 101
DevSecOps 101DevSecOps 101
DevSecOps 101
 
Microservices
MicroservicesMicroservices
Microservices
 
About DevOps in simple steps
About DevOps in simple stepsAbout DevOps in simple steps
About DevOps in simple steps
 
Microservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
Microservices Architectures: Become a Unicorn like Netflix, Twitter and HailoMicroservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
Microservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
 
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
 
DevSecOps What Why and How
DevSecOps What Why and HowDevSecOps What Why and How
DevSecOps What Why and How
 
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
 
Edureka-DevOps-Ebook.pdf
Edureka-DevOps-Ebook.pdfEdureka-DevOps-Ebook.pdf
Edureka-DevOps-Ebook.pdf
 
Platform engineering 101
Platform engineering 101Platform engineering 101
Platform engineering 101
 
Devops Devops Devops, at Froscon
Devops Devops Devops, at FrosconDevops Devops Devops, at Froscon
Devops Devops Devops, at Froscon
 
Enterprise Software Architecture styles
Enterprise Software Architecture stylesEnterprise Software Architecture styles
Enterprise Software Architecture styles
 
Platform Engineering - a 360 degree view
Platform Engineering - a 360 degree viewPlatform Engineering - a 360 degree view
Platform Engineering - a 360 degree view
 
Kubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory GuideKubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory Guide
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 

Similar to Practical Microservice Architecture (edition 2022).pdf

MICROSERVICES ARCHITECTURE unit -2.pptx
MICROSERVICES ARCHITECTURE unit -2.pptxMICROSERVICES ARCHITECTURE unit -2.pptx
MICROSERVICES ARCHITECTURE unit -2.pptx
MohammedShahid562503
 

Similar to Practical Microservice Architecture (edition 2022).pdf (20)

Migrating to Microservices Patterns and Technologies (edition 2023)
 Migrating to Microservices Patterns and Technologies (edition 2023) Migrating to Microservices Patterns and Technologies (edition 2023)
Migrating to Microservices Patterns and Technologies (edition 2023)
 
microservices-is-it-the-holy-grail-a-perspective.pdf
microservices-is-it-the-holy-grail-a-perspective.pdfmicroservices-is-it-the-holy-grail-a-perspective.pdf
microservices-is-it-the-holy-grail-a-perspective.pdf
 
Application Centric Microservices from Redhat Summit 2015
Application Centric Microservices from Redhat Summit 2015Application Centric Microservices from Redhat Summit 2015
Application Centric Microservices from Redhat Summit 2015
 
Accelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business case for Agile DevOps, CI/CD and MicroservicesAccelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
 
Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...
 
Microserces Architecture
Microserces ArchitectureMicroserces Architecture
Microserces Architecture
 
Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
 
DevOps Vancouver Meetup - WSBC Progress
DevOps Vancouver Meetup - WSBC ProgressDevOps Vancouver Meetup - WSBC Progress
DevOps Vancouver Meetup - WSBC Progress
 
MICROSERVICES ARCHITECTURE unit -2.pptx
MICROSERVICES ARCHITECTURE unit -2.pptxMICROSERVICES ARCHITECTURE unit -2.pptx
MICROSERVICES ARCHITECTURE unit -2.pptx
 
A Guide on What Are Microservices: Pros, Cons, Use Cases, and More
A Guide on What Are Microservices: Pros, Cons, Use Cases, and MoreA Guide on What Are Microservices: Pros, Cons, Use Cases, and More
A Guide on What Are Microservices: Pros, Cons, Use Cases, and More
 
Microdeployments for microservices dev ops nashville
Microdeployments for microservices   dev ops nashvilleMicrodeployments for microservices   dev ops nashville
Microdeployments for microservices dev ops nashville
 
DEVNET-1170 Intercloud Microservices with Docker and Nirmata
DEVNET-1170	Intercloud Microservices with Docker and NirmataDEVNET-1170	Intercloud Microservices with Docker and Nirmata
DEVNET-1170 Intercloud Microservices with Docker and Nirmata
 
Pros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitecturePros & Cons of Microservices Architecture
Pros & Cons of Microservices Architecture
 
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
 
Istio as an enabler for migrating to microservices (edition 2022)
Istio as an enabler for migrating to microservices (edition 2022)Istio as an enabler for migrating to microservices (edition 2022)
Istio as an enabler for migrating to microservices (edition 2022)
 
MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.
 
Things I wish I'd known before I started with Microservices - GOTO Amsterdam ...
Things I wish I'd known before I started with Microservices - GOTO Amsterdam ...Things I wish I'd known before I started with Microservices - GOTO Amsterdam ...
Things I wish I'd known before I started with Microservices - GOTO Amsterdam ...
 
Building Resilient Microservices
Building Resilient Microservices Building Resilient Microservices
Building Resilient Microservices
 
CWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der walCWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der wal
 

More from Ahmed Misbah

More from Ahmed Misbah (20)

6+1 Technical Tips for Tech Startups (2023 Edition)
6+1 Technical Tips for Tech Startups (2023 Edition)6+1 Technical Tips for Tech Startups (2023 Edition)
6+1 Technical Tips for Tech Startups (2023 Edition)
 
DevOps for absolute beginners (2022 edition)
DevOps for absolute beginners (2022 edition)DevOps for absolute beginners (2022 edition)
DevOps for absolute beginners (2022 edition)
 
TDD Anti-patterns (2022 edition)
TDD Anti-patterns (2022 edition)TDD Anti-patterns (2022 edition)
TDD Anti-patterns (2022 edition)
 
Implementing FaaS on Kubernetes using Kubeless
Implementing FaaS on Kubernetes using KubelessImplementing FaaS on Kubernetes using Kubeless
Implementing FaaS on Kubernetes using Kubeless
 
Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3
Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3
Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3
 
Introduction to TDD
Introduction to TDDIntroduction to TDD
Introduction to TDD
 
Getting Started with DevOps
Getting Started with DevOpsGetting Started with DevOps
Getting Started with DevOps
 
DevOps for absolute beginners
DevOps for absolute beginnersDevOps for absolute beginners
DevOps for absolute beginners
 
Microservice test strategies for applications based on Spring, K8s and Istio
Microservice test strategies for applications based on Spring, K8s and IstioMicroservice test strategies for applications based on Spring, K8s and Istio
Microservice test strategies for applications based on Spring, K8s and Istio
 
Cucumber jvm best practices v3
Cucumber jvm best practices v3Cucumber jvm best practices v3
Cucumber jvm best practices v3
 
Welcome to the Professional World
Welcome to the Professional WorldWelcome to the Professional World
Welcome to the Professional World
 
More topics on Java
More topics on JavaMore topics on Java
More topics on Java
 
Career Paths for Software Professionals
Career Paths for Software ProfessionalsCareer Paths for Software Professionals
Career Paths for Software Professionals
 
Effective User Story Writing
Effective User Story WritingEffective User Story Writing
Effective User Story Writing
 
AndGen+
AndGen+AndGen+
AndGen+
 
DDT Testing Library for Android
DDT Testing Library for AndroidDDT Testing Library for Android
DDT Testing Library for Android
 
Big Data for QAs
Big Data for QAsBig Data for QAs
Big Data for QAs
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 
Software Design
Software DesignSoftware Design
Software Design
 
The Road to DevOps V3
The Road to DevOps V3The Road to DevOps V3
The Road to DevOps V3
 

Recently uploaded

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 

Practical Microservice Architecture (edition 2022).pdf

  • 1. Ahmed MISBAH - December 2022 Practical Microservice Architecture 2022 edition
  • 2. About the speaker Role and previous talks • Chief Software Engineer • Independent Consultant and Coach • Speaker at: ‣ DevOpsDays Cairo ‣ AMECSE ‣ Orange DevTest Days ‣ GDG ‣ Delta Technopreneurs ‣ JDC
  • 3. About the speaker Topics of interest • DevOps • Agile and Lean • Cloud-Native Apps and beyond • Software Architecture • Java • FOSS • Arti fi cial Intelligence and ML
  • 4. About the speaker Experience • 9 years at Orange Innovation Egypt • Delivered two award winning innovative solutions • Worked at two startups • Helped many others! • Winner of Dell Hacktrick 2022 UI/UX track • MSc. degree in ML and many other professional certi fi cations Nile University J;.lll ~l:J.. Qtertifirate (3/'~ This is to certify that Ahmed Mahmoud Amir Misbah •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• Has successfully completed the program of study and fulfilled the requirements for BigData & Data Science Diploma for the period from October 2015 to July 2016 ...f:.!.l...~'!!~~!.tf....El..#.!(!.~.1.. INF Program Director ~~.__QI II C.a.::::a..;r:q;;; AU J M IW fl , : ~t '-M4' October 2016 · ····························••- •·············· Date
  • 5. Practical Microservice Architecture Agenda • Section 1: Introduction • Section 2: Microservices for Greenfield projects • Section 3: Microservices for Brownfield projects
  • 6. Practical Microservice Architecture Agenda ➡ Section 1: Introduction • Section 2: Microservices for Greenfield projects • Section 3: Microservices for Brownfield projects
  • 7. Introduction Topics • Motivations • What is Microservice Architecture? • Why Microservice Architecture? • Microservice Architecture Challenges • When and when not to go for Microservices?
  • 8. Introduction Topics ➡ Motivations • What is Microservice Architecture? • Why Microservice Architecture? • Microservice Architecture Challenges • When and when not to go for Microservices?
  • 9. Motivations Why this session? • Been working with Service Oriented Architecture (SOA) since 2009. • Been working with Microservices since 2016 in both green fi eld and brown fi eld projects and products. • Seen Microservice Architecture being adopted and implemented both right and wrong, mostly wrong! • Was inspired by Lean practice of “Do it Right the First Time” (DRIFT).
  • 10. Introduction Topics • Motivations ➡ What is Microservice Architecture? • Why Microservice Architecture? • Microservice Architecture Challenges • When and when not to go for Microservices?
  • 11. What is Microservice Architecture? The De fi nition Microservice Architecture is an architectural style that structures an application as a collection of services that are: • Highly maintainable and testable • Loosely coupled • Independently deployable • Organized around business capabilities or bounded context • Owned by small teams
  • 12. What is Microservice Architecture? The Seven Principles Principle Patterns / Practices Modeled around business domain Conway’s Law, Domain Driven Design (DDD) Hide implementation details Remote Procedure Invocation (RPI) and Messaging Culture of automation Extreme Programming (XP) Practices, DevOps Highly decentralized Domain Driven Design (DDD) Deployed independently Continuous Delivery and Deployment Isolate failure Circuit Breaker Pattern, Reactive Manifesto Highly observable Continuos Monitoring, Service Mesh
  • 13. What is Microservice Architecture? The Patterns
  • 14. What is Microservice Architecture? Enablers • Domain Driven Design (DDD) • DevOps (and its extensions) • Agile Software Development • Containers (e.g., Docker) • Container Orchestration (e.g., Kubernetes) • Service Mesh (e.g., Istio or eBPF) • Message Brokers and Streaming (e.g., Kafka) • Public Cloud (e.g., AWS)
  • 15. What is Microservice Architecture? Is it new?
  • 16. What is Microservice Architecture? Is it new? • Dr. Peter Rodgers used the term “Micro-Web-Services” in 2005 during a presentation on cloud computing. • The term “microservices” was discussed at a conference / workshop of software architects in May 2011 to describe what the participants saw as a common architectural style that many of them had been recently exploring. • March 2012, Microservices were presented as a case study in March 2012 at 33rd Degree in Krakow in “Microservices - Java, the Unix Way”. • Adrian Cockcroft at Net fl ix, described this approach as " fi ne grained SOA”.
  • 17. What is Microservice Architecture? Is it just SOA++? 2005 2008 2016
  • 18. Introduction Topics • Motivations • What is Microservice Architecture? ➡ Why Microservice Architecture? • Microservice Architecture Challenges • When and when not to go for Microservices?
  • 19. Marc Andreessen “Software is eating the world.”
  • 20. Watts S. Humphrey “Every business is a software business.”
  • 21. Satya Nadella “Every company is a software company. You have to start thinking and operating like a digital company.”
  • 22. Why Microservices? Business and Digital Transformation • Transformation (aka. Organization Transformation) is the process of implementing changes across di ff erent core organization pillars (people, process, technology, and culture) in order to improve, boost and benchmark the organizational performance and sustain such results in a resilient way. • Business Transformation: an umbrella term that is used for referring to the fundamental changes in how an organization conducts its business. • Digital Transformation: the process of using digital technologies to: (1) meet the needs of the transformed business processes and (2) create innovative customer engagement mechanisms.
  • 23. Why Microservices? Microservices and Digital Transformation • Microservices enable organizations to evolve their structure and technology stack through structuring their application(s) as a collection of services. • In Digital Transformation, Microservice Architecture is a catalyst for the creation of exceptional customer and employee value through signi fi cant change that leverages the potential of process, technology, data and culture to create this value.
  • 24. Why Microservices? Digital Transformation Trends - Past and Present Development Process Application Architecture Deployment and Packaging Application Infrastructure Waterfall Agile DevOps Monolithic N-Tier | SOA Microservices Physical Servers Virtual Server Containers Datacenter Hosted Cloud
  • 25. Why Microservices? Technical Bene fi ts • Technology Heterogeneity • Ease of Deployment • Scaling • Robustness • Composability
  • 26. Why Microservices? Organizational and Business Bene fi ts • Improve Team Autonomy • Reduce Time to Market • Scale Cost-e ff ectively for Load • Improve Robustness • Easily scale teams • Embrace New Technology
  • 27. Introduction Topics • Motivations • What is Microservice Architecture? • Why Microservice Architecture? ➡ Microservice Architecture Challenges • When and when not to go for Microservices?
  • 28. Microservice Architecture Challenges It’s not all sunshine and roses! 1. Learning Curve 2. Monitoring 3. Troubleshooting and debugging 4. Handling failures 5. Security 6. Testing 7. Latency 8. Data Consistency 9. Infrastructure provisioning 10. Deployment
  • 29. Introduction Topics • Motivations • What is Microservice Architecture? • Why Microservice Architecture? • Microservice Architecture Challenges ➡ When and when not to go for Microservices?
  • 30. When and when not to go for Microservices? Questions to ask • What are your goals and vision on scaling up? • Is your business model tested and proven? • Is your business mature enough to adopt Microservices? • Do you have a complete understanding of what Microservices are and how they could in fl uence your development operations? • How strong is your practice of application infrastructure? • Do you have a tried and tested agile or DevOps practices? • Is your data management team skilled enough to support the incorporation?
  • 31. When and when not to go for Microservices? When to go for Microservices? • If you’re building a highly agile application (product or service) that demands swift speed of delivery, innovation and more • When you want your (legacy) monolithic application to accommodate scalability, agility, manageability and delivery speed • When you have standalone business applications or modules that have to be reused across diverse channels
  • 32. When and when not to go for Microservices? When not to go for Microservices? • When you’re a Startup. • The application is too small to justify Microservices. • The domain is unclear or uncertain, which makes the domain model uncertain. • The organization can’t change to adapt to the Microservice way. • Team lacks experience and understanding of Microservice concepts, DDD, or conceptual design. • Team is not mature, technical skillset is not adapted, or turnover is high. Since code cleanliness and architecture tend to decay over time because of entropy, and since a more complex architecture is harder to maintain, this may exacerbate consequences of point.
  • 33. Practical Microservice Architecture Agenda • Section 1: Introduction ➡ Section 2: Microservices for Greenfield projects • Section 3: Microservices for Brownfield projects
  • 34. Microservices for Greenfield projects What are Green fi eld projects? • In many disciplines, a Green fi eld project is one that lacks constraints imposed by prior work. • The analogy is similar to that of construction on green fi eld land where there is no need to work within the constraints of existing buildings or infrastructure. • In Software Development, a green fi eld project is a brand-new project developed from scratch. • This project does not rely on any existing code, use minimal to no established infrastructure, and don't need to fi t any particular mold.
  • 35. Microservices for Greenfield projects Microservices Adoption Strategies Is the the team(s) and organization in need of and ready for Microservices? Microservice- fi rst Monolith- fi rst No Yes
  • 37. Microservices for Greenfield projects Assess Team Readiness
  • 38. Microservices for Greenfield projects Assess Ability - The checklist ✓ Conway’s Law ✓ Domain Driven Design (DDD) ✓ Distributed Architecture ✓ Event-driven Architecture ✓ Microservice Architecture, its patterns, and its test strategies ✓ DevOps (CI/CD, Release Strategies, IaC, etc.) ✓ Cloud-native architecture and technologies ✓ Agile software development and organization at scale ✓ Test Automation (Application - functional non-functional and Infrastructure) ✓ The domain and its sub-domains are clear
  • 39. Microservices for Greenfield projects Situational Leadership R1 R2 R3 R4
  • 41. Microservices for Greenfield projects Microservices Adoption Strategies Is the the team(s) and organization in need of and ready for Microservices? Microservice- fi rst Monolith- fi rst No Yes
  • 42. Microservices for Greenfield projects Monolith- fi rst Approach • If your team and organization are not yet ready to adopt Microservice Architecture, it is advisable to start with Monolith- fi rst approach. • Not all monoliths are bad! • Start with a Modular Monolith (aka. Modulith). • A modular monolith can be achieved by applying DDD with Hexagonal, Onion, or Clean Architecture. • Once the team and organization are ready, the monolith can be split and migrated to Microservice architecture (to be discussed in Section 3).
  • 43.
  • 44.
  • 45. Microservices for Greenfield projects Basic forces acting on software design • Those were incepted in the mid-70s by Yourdon and Constantine in “Structured Design” and haven’t changed. • Their argument goes like this: ‣ We design software to reduce its cost. ‣ The cost of software is = the cost of changing the software. ‣ The cost of changing the software is = the cost of the expensive changes. ‣ The cost of the expensive changes is generated by cascading changes (i.e., Coupling) ‣ So, design = cost = change = big change = coupling. ‣ Transitively, software design = managing coupling.
  • 46. Microservices for Greenfield projects Monoliths are not bad! • Teams hastily jump to Microservices • That is because they’re seeking bene fi ts they aren’t currently getting and expect them from Microservices • We need to remember that Microservices aren’t the point!
  • 48. Microservices for Greenfield projects Microservices Adoption Strategies Is the the team(s) and organization in need of and ready for Microservices? Microservice- fi rst Monolith- fi rst No Yes
  • 49. Microservices for Greenfield projects Microservice- fi rst Approach 1. Choose a decomposition strategy: • Business Capability (Conway’s Law) • Sub-domain (DDD) • Team 2. If Decomposition by Sub-domain is chosen, the fi rst step is to identify the sub-domain and bounded contexts. Event Storming can be used for that. 3. Design your architecture and choose your technology stack.
  • 50.
  • 51.
  • 52.
  • 53. Melvin E. Conway - Conway’s Law (1968) “Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure.”
  • 54.
  • 55.
  • 56. Microservices for Greenfield projects Spotify Engineering Culture
  • 57.
  • 58. Microservices for Greenfield projects What’s next? • Remember the goals! • Start with a walking skeleton (the MVP of architecture) • De fi ne measures • Compare with maturity matrix • Implement feedback loops • Continuously measure and improve • Once you have something implemented, deployed and releases, you know have a brown fi eld project. Check the next section!
  • 59.
  • 60. Microservices for Greenfield projects Measuring Software Architecture • Four Key Metrics: ‣ Deployment Frequency ‣ Lead time for changes ‣ Change failure rate ‣ Time to restore service • Fitness Functions
  • 61. Microservices for Greenfield projects More Metrics Scan QR for my LinkedIn post
  • 62. Microservices for Greenfield projects Fitness Functions • “An architectural fi tness function is any mechanism that provides an objective integrity assessment of some architectural characteristic(s).” • “An objective function used to summarize how close a prospective design solution is to achieving the set aims.” • “Fitness functions, a concept borrowed from evolutionary computing, are a concise method that can also be used to de fi ne software system metrics.”
  • 63.
  • 64. Microservices for Greenfield projects Fitness Function Categories Mandatory Optional
  • 65. Microservices for Greenfield projects Tools used to de fi ne Fitness Functions • Monitoring Tools (performance, scalability, etc.) • Code metrics (coupling, cyclomatic complexity, etc.) • Chaos Engineering • Architecture Testing frameworks • Security scanning
  • 66. Microservices for Greenfield projects An example of a Fitness Function (1) “Unit Test Coverage > 0.9; Execute on each CI Build; Fail when below target coverage” • Breadth of feedback: Atomic • Execution Trigger: Triggered • Execution Location: CI • Metric Type: a speci fi c value (90%) • Quality attribute requirement: maintainability • Static or dynamic: static
  • 67. Microservices for Greenfield projects An example of a Fitness Function (2) “Deploy the new release to our production system (at night, 01:00 AM). While the release is rolled out, constantly perform the regression test set containing the 5 main end user use cases (login, put item to cart, remove item from cart, view cart, checkout). The system performs all actions and responds within 100ms. Fail when test case fails; Fail when system doesn’t perform actions and respond < 100ms” • Breadth of feedback: Holistic • Execution Trigger and location: Triggered, production environment • Metric Type: discrete (performance), true/false (system is deployed or not) • Quality attribute requirement: performance, reliability • Static or dynamic: static
  • 68. Practical Microservice Architecture Agenda • Section 1: Introduction • Section 2: Microservices for Greenfield projects ➡ Section 3: Microservices for Brownfield projects
  • 69. Microservices for Brownfield projects What is a Brown fi eld project? • A brown fi eld project is one that carries constraints related to the current state of the site. • In other words, the site might be contaminated or have existing structures that architects have to tear down or modify in some way before the project can move forward. • Brown fi eld software development refers to the development and deployment of a new software system in the presence of existing or legacy software systems. • Brown fi eld development usually happens when you want to develop or improve upon an existing application, and compels you to work with previously created code.
  • 70. Microservices for Brownfield projects Microservices Adoption Strategies Is the project a Monolith? Refactor or rewrite existing project to a modular design No Yes Is the the team and organization ready? Yes No Migrate to Microservices 1 We will talk about this
  • 71. Are bounded contexts well de fi ned? Merge the services No Yes 1 Using Microservices Are you succeeding with Microservices? No Yes Continue using Microservices Refactor or improve based on the problem We will talk about this We will talk about this
  • 73. Microservices for Brownfield projects Microservices Adoption Strategies Is the project a Monolith? Refactor or rewrite existing project to a modular design No Yes Is the the team and organization ready? Yes No Migrate to Microservices 1
  • 74. Migrating to Microservices Migration Approaches 1. Big Bang Approach: Creating a new application from scratch 2. Incremental Approach: Gradually migrate to Microservice Architecture Big Bang Approach Gradual Approach
  • 75. Migrating to Microservices Incremental Approach • Monolithic functionalities can be extracted gradually to be implemented in Microservices by splitting the monolithic application based on business capabilities, teams, or sub-domain (DDD). • Such Microservices include business functionalities exposed as API calls. They can also access the monolithic database or have their own autonomous database. • Many patterns exist for splitting monolithic application. One of the most useful and commonly used techniques is the Strangler Fig Application.
  • 76. Migrating to Microservices Strangler Fig Application Pattern • The idea of Strangler Fig Application Pattern is to have the new system initially supported by the existing system. • The old and the new systems can coexist, giving the new system time to grow and potentially entirely replace the old system.
  • 77. Migrating to Microservices Bene fi ts of Incremental Approach and Strangler Fig • Allows new evolutions to be delivered during the migration phase. • The new system will always be up-to-date. • Zero Downtime Deployments (ZDD).
  • 78. Migrating to Microservices Stages of Strangler Fig Application Pattern 1. Identify: identify parts of the legacy application that will be migrated. DDD can be used to identify various bounded contexts 2. Transform: implement this functionality in a new Microservice 3. Co-exist: leave the existing module in the legacy application as is. Incrementally re-route calls from the monolith to the new micro service 4. Eliminate: once the tra ffi c is completely redirected to the micro service, eliminate the legacy module
  • 79. Migrating to Microservices What about the Databases? • You can start with a shared DB, • Then start decomposing the DB using a pattern, • Finally, you should end up with one DB per Microservice.
  • 81. Microservices gone wrong! How can you tell if you’re doing Microservices wrong? • There are no bounded contexts • You have a Microservice per resource (like REST APIs) • A single team is working on multiple services • There is high coupling between services • Your deployment strategy is Multi-service deployment • Deployments are hard • Operational costs are high with no real ROI • Not meeting organization goals (and not having measures to know that)
  • 83. Microservices for Brownfield projects Microservices Adoption Strategies Is the project a Monolith? Refactor or rewrite existing project to a modular design No Yes Is the the team and organization ready? Yes No Migrate to Microservices 1
  • 84. Are bounded contexts well de fi ned? Merge the services No Yes 1 Using Microservices Are you succeeding with Microservices? No Yes Continue using Microservices Refactor or improve based on the problem
  • 85. Merging the Services Microservice Architecture gone wrong When teams and their organizations implement Microservice architecture before they’re ready, two main anti-patterns occur: 1. Distributed Monolith 2. Nano-services: an SOA anti-pattern where services are too fi ne grained that their overhead (communications, maintenance etc.) out-weights their utility.
  • 86.
  • 87. Merging the Services Fixing Distributed Monoliths and Nano-services • These two anti-patterns can be solved by merging services so that: 1. It is back to a single service (a monolith that is either layered or modular) 2. Bounded contexts are properly identi fi ed and services are merged to represent these bounded contexts and be owned by small teams • Stranger Fig pattern can be used in merging nano-services
  • 88. Refactor or improve based on the problem
  • 89. Microservices for Brownfield projects Microservices Adoption Strategies Is the project a Monolith? Refactor or rewrite existing project to a modular design No Yes Is the the team and organization ready? Yes No Migrate to Microservices 1
  • 90. Are bounded contexts well de fi ned? Merge the services No Yes 1 Using Microservices Are you succeeding with Microservices? No Yes Continue using Microservices Refactor or improve based on the problem
  • 91. Refactor or improve based on the problem How does it work? • One technique that can be applied is the OODA Loop. • OODA Loop can be completed with other techniques like 5 Whys, Fishbone analysis, and Gap analysis.
  • 92. Refactor or improve based on the problem Common problems and possible solutions • Dependency between services: ‣ Monorepos ‣ Feature Toggles ‣ Release Trains ‣ DDD • Poor observability: Service Mesh • Failures on production: Microservice Test Strategies (Martin Fowler)
  • 97. My website Scan QR to access my website
  • 98. Book a free call to arrange a workshop • Microservice Architecture workshop • Serverless Architectures workshop • Service Mesh session • DevOps Maturity Assessment workshop • DevOps for Enterprises workshop • CI/CD workshop • Hands-on DevOps mentorship Scan to book a free call