@crichardson
There is no such thing as a
microservice!
Chris Richardson
Founder of Eventuate.io
Founder of the original CloudFoundry.com
Author of POJOs in Action
@crichardson
noemail@chrisrichardson.net
http://microservices.io
http://eventuate.io
http://plainoldobjects.com
Copyright © 2017. Chris Richardson Consulting, Inc. All rights reserved
@crichardson
Presentation goal
Define the Microservice Architecture as an
architectural style
Describe how it enables the continuous delivery of
complex applications
Show how the microservices pattern language helps
use the Microservice Architecture effectively
@crichardson
About Chris
@crichardson
About Chris
Consultant and trainer focusing on
modern application architectures
including microservices
(http://www.chrisrichardson.net/)
@crichardson
About Chris
Founder of a startup that is creating
an open-source/SaaS platform
that simplifies the development of
transactional microservices
(http://eventuate.io)
@crichardson
About Chris
http://learnmicroservices.io
@crichardson
Agenda
A brief refresher on software architecture
From monolith to microservices
Microservices != silver bullet pattern language
About software architecture
“The software architecture of a computing system is the
set of structures needed to reason about the system,
which comprise software elements, relations among
them, and properties of both.”
Documenting Software Architectures, Bass et al
@crichardson
Architecture
=
(elements, relations, properties)
@crichardson
Architecture
=
Boxes and lines 😄
@crichardson
Architecture is multi-dimensional
e.g. Structural, electrical, plumbing,
mechanical
Described by multiple views
View = (elements, relations, properties)
4+1 view model
Logical
View
Process
View
Deployment
View
Implementation
View
Scenarios
Philippe Kruchten 1995
4+1 Logical view
Logical
View
Process
View
Deployment
View
Implementation
View
Scenarios
Elements: classes and packages
Relations: inheritance, associations, …
4+1 Implementation view
Logical
View
Process
View
Deployment
View
Implementation
View
Scenarios
Elements: modules and components
Relations: dependencies
4+1 Process view
Logical
View
Process
View
Deployment
View
Implementation
View
Scenarios
Elements: processes
Relations: IPC
4+1 Deployment view
Logical
View
Process
View
Deployment
View
Implementation
View
Scenarios
Elements: “machines”
Relations: networking
4+1 Scenarios
Logical
View
Process
View
Deployment
View
Implementation
View
Scenarios
Derived from use cases/stories
Animate the views
@crichardson
""… An architectural style determines
the vocabulary of components and
connectors that can be used in instances
of that style, together with a set of
constraints on how they can be
combined….. ””
David Garlan and Mary Shaw, An Introduction to Software
Architecture
@crichardson
Layered architectural style
Layer N
Layer N - 1
Layer N - 2
Well defined
responsibilities
Constrained
dependencies
Uses Uses
UsesUses
The role of architecture
Requirements
=
Functional requirements
+
Non-functional requirements (-ilities)
Domain
knowledge
Architecture
Important -ilities
Maintainability
Testability
Deployability
Evolvability
Scalability
Security
Reliability
…
https://en.wikipedia.org/wiki/Non-functional_requirement
Development
velocity
@crichardson
Businesses must innovate
faster
Build better software faster
@crichardson
Reducing lead time
Increasing deployment frequency
@crichardson
Modern software development
Architecture:
Process:
Small, autonomous
teams
???
Continuous delivery/deployment
Organization:
Agenda
A brief refresher on software architecture
From monolith to microservices
Microservices != silver bullet pattern language
@crichardson
Tomcat/App. Server
Traditional: Monolithic
architecture
Browser/
Client
WAR/EAR
MySQL
Database
Review Module
Catalog
Module
Recommendation
Module
StoreFrontUI
Order Module
HTML
REST/JSON
Logical view
Implementation view
@crichardson
The monolithic architecture
is an architectural style
that structures the application
as a single executable
component
Implementation view
-ilities of small monoliths
Maintainability
Testability
Deployability
…
https://en.wikipedia.org/wiki/Non-functional_requirement
😄
@crichardson
But successful applications
keep growing….
Development
Team
Application
@crichardson
… and growing
Development
Team A
ApplicationDevelopment
Team B
Development
Team C
@crichardson
Eventually:
agile
development
and deployment
becomes
impossible
=
monolithic hell
@crichardson
Technology stack becomes
increasingly obsolete
BUT
A rewrite is not feasible
-ilities of large monoliths
Maintainability
Testability
Deployability
…
https://en.wikipedia.org/wiki/Non-functional_requirement
😭
The microservice architecture
is an architectural style
that structures an
application as a
set of loosely coupled,
services organized around
business capabilities
@crichardson
Application
Service = business capability
Acme, Inc
Order
Taking
Inventory
management
Delivery
management
Business Capability = something a business does to deliver value
…
Order
Service
Inventory
Management
Service
Delivery
Management
Service …
Service
Service size is secondary
microservice architecture
Service:
Meaningful business functionality
Developed by a small team
Minimal lead time/high deployment
frequency
Microservices
=
Microservice architecture
=
Application architecture
No such thing as a microservice
@crichardson
Browser
Mobile
Device
Content
Router
API
Gateway
Catalog
Service
Review
Service
Order
Service
…
Service
Catalog
Database
Review
Database
Order
Database
…
Database
HTTP
/HTML
REST
REST
Browse &
Search WebApp
Product Detail
WebApp
….
Supplier
Inbound
Gateway
Catalog update
messages
Supplier
System
-ilities of a microservice
architecture
Maintainability
Testability
Deployability
…
https://en.wikipedia.org/wiki/Non-functional_requirement
😄
@crichardson
Microservices
continuous delivery/deployment
of large/complex applications
@crichardson
Process:
Continuous delivery/deployment
Organization:
Small, agile, autonomous,
cross functional teams
Architecture:
Microservice architecture
Enables
Enables
Enables
Successful
Software
Development
Services improve
testability
and
deployability
Services enable autonomous teams
@crichardson
Modern software development: moving
fast and not breaking things!
46x
440x
24x
5x lower
Amazon: ~0.001%
Netflix: 16 minutes
@crichardson
Microservices evolve the
technology stack
Pick a new technology when
Writing a new service
Making major changes to an existing service
Let’s you experiment and fail safely
@crichardson
Agenda
A brief refresher on software architecture
From monolith to microservices
Microservices != silver bullet pattern language
@crichardson
No silver bullets
http://en.wikipedia.org/wiki/Fred_Brooks
@crichardson
Drawbacks of microservices
Complexity
Development: IPC, partial failure, distributed data
Testing: Integration, end to end, …
Deployment
…
@crichardson
Are microservices a good fit
for my application?
@crichardson
Do I have the pre-requisites in place:
automated testing
automated provisioning
…..
?
@crichardson
When using microservices:
How to decompose an application into services?
How to deploy an application’s services?
How to handle cross cutting concerns?
Which communication mechanisms to use?
How do external clients communicate with the services?
How does a client discover the network location of a service instance?
How to prevent a network or service failure from cascading to other services?
How to maintain data consistency and implement queries?
How to make testing easier?
How to understand the behavior of an application and troubleshoot problems?
How to implement a UI screen or page that displays data from multiple services?
@crichardson
It depends!
@crichardson
Microservice pattern language
=
collection of patterns
that solve these
architecture, design, development and
operational problems
Better decisions
@crichardson
What’s a pattern?
Reusable solution
to a problem
occurring
in a particular context
@crichardson
The structure of a pattern
encourages objectivity
Resulting context
The situationName
Context
Problem
Related patterns
The issues that
must be addressed
Forces
Solution Benefits
Drawbacks
Issues
Patterns that are alternative
solutions
Patterns that address
the issues
@crichardsonMicroservice patterns
Communication patterns
Core
Cross-cutting concerns Security
Deployment
Maintaining data consistency
Database architecture
External API
Reliability
Discovery
Communication style
Testing
Observability
UI
Decomposition
API gateway
Client-side discovery
Server-side
discovery
Service registry
Self registration
3rd party registration
Multiple Services
per host
Single Service per
Host
Service-per-
Container
Service-per-VM
Messaging
Remote Procedure
Invocation
Database per
Service
Event-driven
architectureShared
database
Microservice
Chassis
Backend for front end
Event
sourcing
Transaction
log tailing
Database
triggers
Application
events
Monolithic
architecture
Microservice
architecture
CQRS
Motivating
Pattern
Solution
Pattern
Solution A Solution B
General Specific
Serverless
deployment
Circuit BreakerAccess Token
Domain-specific
Externalized
configuration
Service Integration
Contract Test
Service
Component Test
Exception
tracking
Distributed
tracing
Audit logging
Application
metrics
Log
aggregation
Health check
API
Service deployment
platform
Server-side page
fragment
composition
Client-side UI
composition
Decompose by
business capability
Decompose by
subdomain
Application patterns
Infrastructure patterns
Application Infrastructure patterns
Microservices pattern language: http://microservices.io
@crichardson
The rest are generic technical
architecture patterns
=
Undifferentiated heavy lifting!
@crichardsonMicroservice patterns
Communication patterns
Core
Cross-cutting concerns Security
Deployment
Maintaining data consistency
Database architecture
External API
Reliability
Discovery
Communication style
Testing
Observability
UI
Decomposition
API gateway
Client-side discovery
Server-side
discovery
Service registry
Self registration
3rd party registration
Multiple Services
per host
Single Service per
Host
Service-per-
Container
Service-per-VM
Messaging
Remote Procedure
Invocation
Database per
Service
Event-driven
architectureShared
database
Microservice
Chassis
Backend for front end
Event
sourcing
Transaction
log tailing
Database
triggers
Application
events
Monolithic
architecture
Microservice
architecture
CQRS
Motivating
Pattern
Solution
Pattern
Solution A Solution B
General Specific
Serverless
deployment
Circuit BreakerAccess Token
Domain-specific
Externalized
configuration
Service Integration
Contract Test
Service
Component Test
Exception
tracking
Distributed
tracing
Audit logging
Application
metrics
Log
aggregation
Health check
API
Service deployment
platform
Server-side page
fragment
composition
Client-side UI
composition
Decompose by
business capability
Decompose by
subdomain
Application patterns
Infrastructure patterns
Application Infrastructure patterns
Microservices pattern language: http://microservices.io
@crichardson
Summary
The goal of architecture is to satisfy non-functional
requirements
For continuous delivery/deployment use the appropriate
architectural style
Small applications Monolithic architecture
Complex applications Microservice architecture
Use the pattern language to guide your decision making
@crichardson
@crichardson chris@chrisrichardson.net
http://learnmicroservices.io
Thank you!

Oracle Code Sydney - There is no such thing as a microservice!