SlideShare une entreprise Scribd logo
1  sur  56
1CONFIDENTIAL
MICROSERVICES
ARCHITECTURE OVERVIEW
DZMITRY SKAREDAU, SOLUTION ARCHITECT
FEBRUARY 27, 2016
2CONFIDENTIAL
2
• Why do we need it
• Architecture patterns
AGENDA
• Microservice
• API Gateway
• Service Discovery
• Stateless/Shared-Nothing
• Configuration/Service Consumption
• Fault Tolerance
• Request Collapsing
• API Versioning
3CONFIDENTIAL
WHY DO WE NEED IT
4CONFIDENTIAL
4
WE DON’T EXPLICITLY
BUT IT DEPENDS
5CONFIDENTIAL
5
MICROSERVICES VS MONOLITH
Simple code base
Modularity with exact borders
Change circles decoupled
Efficient scaling
Newcomers adopting faster
Per service team responsibility
No technology lock
MONOLITH MICROSERVICES
Complex code base
Hard to maintain modularity
Change circles tightly coupled
Inefficient scaling
Scaring for newcomers
Hard to scale development team
Tied to chose technology
6CONFIDENTIAL
6
MICROSERVICES VALUES
• Heavily relies on Continues Delivery principles
• Fine-grained domain capability
• Team autonomy with responsibility
• Independent release process
• Independent scaling
• System resilience
• Technology variation
7CONFIDENTIAL
7
MICROSERVICES VALUES VS COMPLEXITY
Team autonomy
Time to market
Scaling
Componentization
Technology variation
Cross teams communication
Continues Deployment
Fault tolerance
Versioning
Maintenance
VALUES COMPLEXITY
8CONFIDENTIAL
ARCHITECTURE PATTERNS
9CONFIDENTIAL
9
ARCHITECTURE PATTERNS
• Microservice
• API Gateway
• Service Discovery
• Stateless/Shared-Nothing
• Configuration Management
• Fault Tolerance
• Request Collapsing
10CONFIDENTIAL
MICROSERVICE
11CONFIDENTIAL
11
BOUNDED CONTEXT
Bounded Context is a
central pattern in
Domain-Driven
Design. It is the
focus of DDD's
strategic design
section which is all
about dealing with
large models and
teams.
12CONFIDENTIAL
12
SIZE OF MICROSERVICE
2 pizza size team
Ideal Size 7 +/-2 persons
13CONFIDENTIAL
13
DECENTRALIZED DATA MANAGEMENT
Microservices prefer letting each service
manage its own database, either different
instances of the same database technology,
or entirely different database systems - an
approach called Polyglot Persistence.
You can use polyglot persistence in a
monolith, but it appears more frequently
with microservices.
14CONFIDENTIAL
14
DESIGN FOR FAILURE
Distributed systems are
much complex than
monolith.
When we have more
systems there is more
chances to fail.
If more places when you
can fails then more often
you can deal with failures.
15CONFIDENTIAL
15
KEY CONSIDERATION
Before you go into production with a microservices system, you need to ensure
that you have key prerequisites in place
• Rapid Provisioning
• Basic Monitoring
• Rapid Application Deployment
• DevOps Culture
16CONFIDENTIAL
16
MICROSERVICE VS SOA
Martin Fowler
Chief Scientist at ThoughtWorks
Subset of SOA
Zhamak Dehghani
Principal Consultant at ThoughtWorks
Style of SOA
Right picture
17CONFIDENTIAL
API GATEWAY
18CONFIDENTIAL
18
API GATEWAY
How many
microservices
could be involved
here?
19CONFIDENTIAL
19
API GATEWAY
9
at least
How many
microservices
could be involved
here?
20CONFIDENTIAL
20
API GATEWAY
21CONFIDENTIAL
21
API GATEWAY
23CONFIDENTIAL
23
API GATEWAY
24CONFIDENTIAL
SERVICE DISCOVERY
25CONFIDENTIAL
25
SERVICE DISCOVERY PROBLEM
26CONFIDENTIAL
26
SERVICE DISCOVERY PROBLEM
27CONFIDENTIAL
STATELESS/SHARED-NOTHING
28CONFIDENTIAL
28
STICKY SESSIONS
29CONFIDENTIAL
29
STICKY SESSIONS
30CONFIDENTIAL
30
STATELESS/SHARED-NOTHING
• Store state at the client
• Store state at database
• Distributed session
• Stateless services
31CONFIDENTIAL
CONFIGURATION MANAGEMENT
32CONFIDENTIAL
32
STORE CONFIG IN THE ENVIRONMENT
The twelve-factor app stores config in environment variables (often shortened to env vars or env). Env
vars are easy to change between deploys without changing any code; unlike config files, there is little
chance of them being checked into the code repo accidentally; and unlike custom config files, or other
config mechanisms such as Java System Properties, they are a language- and OS-agnostic standard.
http://12factor.net
http://12factor.net/config
33CONFIDENTIAL
33
SPRING CLOUD CONFIG SERVER
34CONFIDENTIAL
FAULT TOLERANCE
35CONFIDENTIAL
35
FAULT TOLERANCE
36CONFIDENTIAL
36
FAULT TOLERANCE
37CONFIDENTIAL
37
FAULT TOLERANCE
Availability % Downtime per year Downtime per month Downtime per week Downtime per day
90% ("one nine") 36.5 days 72 hours 16.8 hours 2.4 hours
95% 18.25 days 36 hours 8.4 hours 1.2 hours
97% 10.96 days 21.6 hours 5.04 hours 43.2 minutes
98% 7.30 days 14.4 hours 3.36 hours 28.8 minutes
99% ("two nines") 3.65 days 7.20 hours 1.68 hours 14.4 minutes
99.5% 1.83 days 3.60 hours 50.4 minutes 7.2 minutes
99.8% 17.52 hours 86.23 minutes 20.16 minutes 2.88 minutes
99.9% ("three nines") 8.76 hours 43.8 minutes 10.1 minutes 1.44 minutes
99.95% 4.38 hours 21.56 minutes 5.04 minutes 43.2 seconds
99.99% ("four nines") 52.56 minutes 4.38 minutes 1.01 minutes 8.66 seconds
99.995% 26.28 minutes 2.16 minutes 30.24 seconds 4.32 seconds
99.999% ("five nines") 5.26 minutes 25.9 seconds 6.05 seconds 864.3 milliseconds
99.9999% ("six nines") 31.5 seconds 2.59 seconds 604.8 milliseconds 86.4 milliseconds
99.99999% ("seven nines") 3.15 seconds 262.97 milliseconds 60.48 milliseconds 8.64 milliseconds
99.999999% ("eight nines") 315.569 milliseconds 26.297 milliseconds 6.048 milliseconds 0.864 milliseconds
99.9999999% ("nine nines") 31.5569 milliseconds 2.6297 milliseconds 0.6048 milliseconds 0.0864 milliseconds
Without taking steps to
ensure fault tolerance,
30 dependencies each
with 99.99% uptime
would result in 2+ hours
downtime/month
(99.99%30 ≈ 99.7%
uptime = 2+ hours in a
month)
http://techblog.netflix.com/2012/02/fault
-tolerance-in-high-volume.html
0.3% means that the one
million request will have
3000 failed
38CONFIDENTIAL
38
FAULT TOLERANCE
The basic idea behind the circuit breaker
is very simple. You wrap a protected
function call in a circuit breaker object,
which monitors for failures. Once the
failures reach a certain threshold, the
circuit breaker trips, and all further calls
to the circuit breaker return with an
error, without the protected call being
made at all. Usually you'll also want some
kind of monitor alert if the circuit
breaker trips.
CIRCUIT BREAKER
39CONFIDENTIAL
39
FAULT TOLERANCE: CIRCUIT BREAKER
40CONFIDENTIAL
40
FAULT TOLERANCE: CIRCUIT BREAKER
41CONFIDENTIAL
41
FAULT TOLERANCE: CIRCUIT BREAKER
42CONFIDENTIAL
42
FAULT TOLERANCE
Fallback logic scene involving
network access, such as cache
access.
FALLBACK DEGRADATION
43CONFIDENTIAL
REQUEST COLLAPSING
44CONFIDENTIAL
44
REQUEST COLLAPSING
In addition to the isolation
benefits and concurrent
execution of dependency
calls we have also leveraged
the separate threads to
enable request collapsing
(automatic batching) to
increase overall efficiency
and reduce user request
latencies.
Collapse multiple requests into a single execution
based on a time window and optionally a max batch
size.
This allows an object model to have multiple calls to
the command that execute/queue many times in a
short period (milliseconds) and have them all get
batched into a single backend call.
Typically the time window is something like 10ms
give or take.
45CONFIDENTIAL
45
COLLAPSER FLOW
In addition to the isolation
benefits and concurrent
execution of dependency
calls we have also leveraged
the separate threads to
enable request collapsing
(automatic batching) to
increase overall efficiency
and reduce user request
latencies.
Collapse multiple requests into a single execution
based on a time window and optionally a max batch
size.
This allows an object model to have multiple calls to
the command that execute/queue many times in a
short period (milliseconds) and have them all get
batched into a single backend call.
Typically the time window is something like 10ms
give or take.
46CONFIDENTIAL
API VERSIONING
47CONFIDENTIAL
47
API VERSIONING
• Adding authentication
• Adding authorization rules
• Removing a service
• API contract changes
REASONS SOLUTIONS
• URL Versioning
• Media Type Versioning
• Custom header
• Hostname
• Data parameter
48CONFIDENTIAL
48
API VERSIONING
One method for indicating versioning is via the URI, typically via a path prefix:
Twitter: http://api.twitter.com/1.1/
Last.fm: http://ws.audioscrobbler.com/2.0/
Etsy: http://openapi.etsy.com/v2
Some APIs will provide the version via a query string parameter:
Amazon Simple Queue Service: ?VERSION=2011-10-01
URL
49CONFIDENTIAL
49
API VERSIONING
Media type versioning provides the ability to use the same URI for multiple versions of an API, by specifying the version as part
of the Accept media type.
The Accept header can provide versioning in two different ways:
• As part of the media type name itself: application/vnd.status.v2+json. In this case, the segment v2 indicates the
request is for version 2. You can provide the version string however you desire.
• As a parameter to the media type: application/vnd.status+json; version=2. This option provides more
verbosity, but allows you to specify the same base media type for each version.
Many REST advocates prefer media type versioning as it solves the "one resource, one URI" problem cleanly, and allows
adding versioning support after-the-fact. The primary argument against it is the fact that the version is not visible when
looking at the URI.
MEDIA TYPE
50CONFIDENTIAL
50
API VERSIONING
The above two versioning types are the most common; however, other types exist:
• Custom header. As an example,
• X-API-Version: 2
• GData-Version: 2.0
• X-MS-Version: 2011-08-18
• etc.
• Hostname. Facebook, when migrating from the first API version, switched from the host http://api.facebook.com to
http://graph.facebook.com.
• Data parameter. This could be a query string parameter for GET requests, as noted above, but a content body parameter for
other request methods.
OTHER METHODOLOGIES
51CONFIDENTIAL
51
API VERSIONING
• Typical approach. Include API version. Backwards compatible.
• Some folks use custom content type allowing each resource to have a version.
• Netflix: strive to be version-less from client perspective
• Netflix: try to be version-less even if not wholly possible
• Adding new data types or new URIs don’t require new version
• Structural changes to large unknown developers better to incomplete than inaccurate. Hold onto ideas before pushing it out.
• Netflix assumes 7-10 year life of a TV
• Netflix can generally move partners from version to version as needed
NETFLIX APPROACH
52CONFIDENTIAL
52
API VERSIONING
It seems that there are a number of people recommending using Content-Negotiation (the HTTP
“Accept:” header) for API versioning.
However, none of the big public REST APIs I have looked at seem to be using this approach. They almost
exclusively put the API version number in the URI.
53CONFIDENTIAL
53
API VERSIONING
Twitter URI
Atlassian URI
Google Search URI
Github API URI/Media Type in v3
Intention is to remove versioning in favour of
hypermedia – current
application/vnd.github.v3
Azure Custom Header x-ms-version: 2011-08-18
Facebook URI/optional versioning graph.facebook.com/v1.0/me
Bing Maps URI
Netflix URI parameter
http://api.netflix.com/catalog/titles/series/
70023522?v=1.5
54CONFIDENTIAL
54
API VERSIONING
Google data API (youtube/spreadsheets/others)
URI parameter or custom
header “GData-Version: X.0” or “v=X.0”
Flickr No versioning?
Digg URI http://services.digg.com/2.0/comment.bury
Delicious URI https://api.del.icio.us/v1/posts/update
Last FM URI http://ws.audioscrobbler.com/2.0/
LinkedIn URI
http://api.linkedin.com/v1/people/~/connec
tions
Foursquare URI
https://api.foursquare.com/v2/venues/40a55
d80f964a52020f31ee3?oauth_token=XXX&v=YY
YYMMDD
55CONFIDENTIAL
55
API VERSIONING
paypal parameter &VERSION=XX.0
Twitpic URI http://api.twitpic.com/2/upload.format
Etsy URI http://openapi.etsy.com/v2
Tropo URI https://api.tropo.com/1.0/sessions
Tumblr URI api.tumblr.com/v2/user/
openstreetmap URI and response body http://server/api/0.6/changeset/create
Ebay URI (I think)
http://open.api.ebay.com/shopping?version=
713
56CONFIDENTIAL
56
API VERSIONING
Wikipedia no versioning I think?
Bitly URI https://api-ssl.bitly.com/v3/shorten
Disqus URI
https://disqus.com/api/3.0/posts/remove.js
on
Yammer URI /api/v1
Drop Box URI
https://api.dropbox.com/1/oauth/request_to
ken
Amazon Simple Queue Service (Soap) URI Parameter and WSDL URI &Version=2011-10-01
57CONFIDENTIAL
QUESTIONS?

Contenu connexe

Tendances

Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architectureThe Software House
 
Emerging Trends in Hybrid-Cloud & Multi-Cloud Strategies
Emerging Trends in Hybrid-Cloud & Multi-Cloud StrategiesEmerging Trends in Hybrid-Cloud & Multi-Cloud Strategies
Emerging Trends in Hybrid-Cloud & Multi-Cloud StrategiesChaitanya Atreya
 
Principles of microservices XP Days Ukraine
Principles of microservices   XP Days UkrainePrinciples of microservices   XP Days Ukraine
Principles of microservices XP Days UkraineSam Newman
 
Microservices
MicroservicesMicroservices
MicroservicesSmartBear
 
Azure Container Apps
Azure Container AppsAzure Container Apps
Azure Container AppsKen Sykora
 
Azure API Management
Azure API ManagementAzure API Management
Azure API ManagementDaniel Toomey
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices Amazon Web Services
 
Introduction to AWS Secrets Manager
Introduction to AWS Secrets ManagerIntroduction to AWS Secrets Manager
Introduction to AWS Secrets ManagerAmazon Web Services
 
Efficient Schemas in Motion with Kafka and Schema Registry
Efficient Schemas in Motion with Kafka and Schema RegistryEfficient Schemas in Motion with Kafka and Schema Registry
Efficient Schemas in Motion with Kafka and Schema RegistryPat Patterson
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
 
Microservices Tutorial for Beginners | Microservices Architecture | Microserv...
Microservices Tutorial for Beginners | Microservices Architecture | Microserv...Microservices Tutorial for Beginners | Microservices Architecture | Microserv...
Microservices Tutorial for Beginners | Microservices Architecture | Microserv...Edureka!
 
Microservices Design Patterns | Edureka
Microservices Design Patterns | EdurekaMicroservices Design Patterns | Edureka
Microservices Design Patterns | EdurekaEdureka!
 
Dockercon State of the Art in Microservices
Dockercon State of the Art in MicroservicesDockercon State of the Art in Microservices
Dockercon State of the Art in MicroservicesAdrian Cockcroft
 

Tendances (20)

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
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Emerging Trends in Hybrid-Cloud & Multi-Cloud Strategies
Emerging Trends in Hybrid-Cloud & Multi-Cloud StrategiesEmerging Trends in Hybrid-Cloud & Multi-Cloud Strategies
Emerging Trends in Hybrid-Cloud & Multi-Cloud Strategies
 
Principles of microservices XP Days Ukraine
Principles of microservices   XP Days UkrainePrinciples of microservices   XP Days Ukraine
Principles of microservices XP Days Ukraine
 
Microservices
MicroservicesMicroservices
Microservices
 
Azure Container Apps
Azure Container AppsAzure Container Apps
Azure Container Apps
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
Azure API Management
Azure API ManagementAzure API Management
Azure API Management
 
Multi tenant architecture
Multi tenant architectureMulti tenant architecture
Multi tenant architecture
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices
 
Introduction to AWS Secrets Manager
Introduction to AWS Secrets ManagerIntroduction to AWS Secrets Manager
Introduction to AWS Secrets Manager
 
Efficient Schemas in Motion with Kafka and Schema Registry
Efficient Schemas in Motion with Kafka and Schema RegistryEfficient Schemas in Motion with Kafka and Schema Registry
Efficient Schemas in Motion with Kafka and Schema Registry
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Microservices
MicroservicesMicroservices
Microservices
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Microservices Tutorial for Beginners | Microservices Architecture | Microserv...
Microservices Tutorial for Beginners | Microservices Architecture | Microserv...Microservices Tutorial for Beginners | Microservices Architecture | Microserv...
Microservices Tutorial for Beginners | Microservices Architecture | Microserv...
 
Microservices Design Patterns | Edureka
Microservices Design Patterns | EdurekaMicroservices Design Patterns | Edureka
Microservices Design Patterns | Edureka
 
Dockercon State of the Art in Microservices
Dockercon State of the Art in MicroservicesDockercon State of the Art in Microservices
Dockercon State of the Art in Microservices
 

En vedette

Lessons Learned from Building Enterprise APIs (Gustaf Nyman)
Lessons Learned from Building Enterprise APIs (Gustaf Nyman)Lessons Learned from Building Enterprise APIs (Gustaf Nyman)
Lessons Learned from Building Enterprise APIs (Gustaf Nyman)Nordic APIs
 
TDD for APIs in a Microservice World (Michael Kuehne Schlinkert)
TDD for APIs in a Microservice World (Michael Kuehne Schlinkert)TDD for APIs in a Microservice World (Michael Kuehne Schlinkert)
TDD for APIs in a Microservice World (Michael Kuehne Schlinkert)Nordic APIs
 
Introduction to The 6 Insights of API Practice (Bill Doerrfeld)
Introduction to The 6 Insights of API Practice (Bill Doerrfeld)Introduction to The 6 Insights of API Practice (Bill Doerrfeld)
Introduction to The 6 Insights of API Practice (Bill Doerrfeld)Nordic APIs
 
APIs as The Source of Truth (Zane Claes)
APIs as The Source of Truth (Zane Claes)APIs as The Source of Truth (Zane Claes)
APIs as The Source of Truth (Zane Claes)Nordic APIs
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsStormpath
 
HTTP and Your Angry Dog
HTTP and Your Angry DogHTTP and Your Angry Dog
HTTP and Your Angry DogRoss Tuck
 
HTTP Services & REST API Security
HTTP Services & REST API SecurityHTTP Services & REST API Security
HTTP Services & REST API SecurityTaiseer Joudeh
 
Top 5 Ways To Increase API Adoption
Top 5 Ways To Increase API AdoptionTop 5 Ways To Increase API Adoption
Top 5 Ways To Increase API AdoptionProgrammableWeb
 
Integrated social solutions, the power and pitfalls of mashups
Integrated social solutions, the power and pitfalls of mashupsIntegrated social solutions, the power and pitfalls of mashups
Integrated social solutions, the power and pitfalls of mashupsNordic APIs
 
Rapid Api Prototyping
Rapid Api PrototypingRapid Api Prototyping
Rapid Api PrototypingKong Inc.
 
The Dark Side of Microservices
The Dark Side of MicroservicesThe Dark Side of Microservices
The Dark Side of MicroservicesNicolas Fränkel
 
State of APIs: API trends from Nordic APIs Copenhagen & Sundsvall
State of APIs: API trends from Nordic APIs Copenhagen & SundsvallState of APIs: API trends from Nordic APIs Copenhagen & Sundsvall
State of APIs: API trends from Nordic APIs Copenhagen & SundsvallAndreas Krohn
 
Running an API 24/365
Running an API 24/365Running an API 24/365
Running an API 24/365Nordic APIs
 
Pie for Sale: Timeless Lessons in API Advocacy (Adam DuVander)
Pie for Sale: Timeless Lessons in API Advocacy (Adam DuVander)Pie for Sale: Timeless Lessons in API Advocacy (Adam DuVander)
Pie for Sale: Timeless Lessons in API Advocacy (Adam DuVander)Nordic APIs
 
Authorization The Missing Piece of the Puzzle
Authorization The Missing Piece of the PuzzleAuthorization The Missing Piece of the Puzzle
Authorization The Missing Piece of the PuzzleNordic APIs
 
Public Transport APIs – How we are using and creating long lasting APIs at No...
Public Transport APIs – How we are using and creating long lasting APIs at No...Public Transport APIs – How we are using and creating long lasting APIs at No...
Public Transport APIs – How we are using and creating long lasting APIs at No...Nordic APIs
 
Apinf Open Api Management
Apinf Open Api Management Apinf Open Api Management
Apinf Open Api Management Taija Björklund
 
Platform Security that will Last for Decades (Travis Spencer)
Platform Security that will Last for Decades (Travis Spencer)Platform Security that will Last for Decades (Travis Spencer)
Platform Security that will Last for Decades (Travis Spencer)Nordic APIs
 
API Creation to Iteration without the Frustration
API Creation to Iteration without the FrustrationAPI Creation to Iteration without the Frustration
API Creation to Iteration without the FrustrationNordic APIs
 
Lean and Mean – Authorization for kick-ass APIs (Jonas Markström)
Lean and Mean – Authorization for kick-ass APIs (Jonas Markström)Lean and Mean – Authorization for kick-ass APIs (Jonas Markström)
Lean and Mean – Authorization for kick-ass APIs (Jonas Markström)Nordic APIs
 

En vedette (20)

Lessons Learned from Building Enterprise APIs (Gustaf Nyman)
Lessons Learned from Building Enterprise APIs (Gustaf Nyman)Lessons Learned from Building Enterprise APIs (Gustaf Nyman)
Lessons Learned from Building Enterprise APIs (Gustaf Nyman)
 
TDD for APIs in a Microservice World (Michael Kuehne Schlinkert)
TDD for APIs in a Microservice World (Michael Kuehne Schlinkert)TDD for APIs in a Microservice World (Michael Kuehne Schlinkert)
TDD for APIs in a Microservice World (Michael Kuehne Schlinkert)
 
Introduction to The 6 Insights of API Practice (Bill Doerrfeld)
Introduction to The 6 Insights of API Practice (Bill Doerrfeld)Introduction to The 6 Insights of API Practice (Bill Doerrfeld)
Introduction to The 6 Insights of API Practice (Bill Doerrfeld)
 
APIs as The Source of Truth (Zane Claes)
APIs as The Source of Truth (Zane Claes)APIs as The Source of Truth (Zane Claes)
APIs as The Source of Truth (Zane Claes)
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 
HTTP and Your Angry Dog
HTTP and Your Angry DogHTTP and Your Angry Dog
HTTP and Your Angry Dog
 
HTTP Services & REST API Security
HTTP Services & REST API SecurityHTTP Services & REST API Security
HTTP Services & REST API Security
 
Top 5 Ways To Increase API Adoption
Top 5 Ways To Increase API AdoptionTop 5 Ways To Increase API Adoption
Top 5 Ways To Increase API Adoption
 
Integrated social solutions, the power and pitfalls of mashups
Integrated social solutions, the power and pitfalls of mashupsIntegrated social solutions, the power and pitfalls of mashups
Integrated social solutions, the power and pitfalls of mashups
 
Rapid Api Prototyping
Rapid Api PrototypingRapid Api Prototyping
Rapid Api Prototyping
 
The Dark Side of Microservices
The Dark Side of MicroservicesThe Dark Side of Microservices
The Dark Side of Microservices
 
State of APIs: API trends from Nordic APIs Copenhagen & Sundsvall
State of APIs: API trends from Nordic APIs Copenhagen & SundsvallState of APIs: API trends from Nordic APIs Copenhagen & Sundsvall
State of APIs: API trends from Nordic APIs Copenhagen & Sundsvall
 
Running an API 24/365
Running an API 24/365Running an API 24/365
Running an API 24/365
 
Pie for Sale: Timeless Lessons in API Advocacy (Adam DuVander)
Pie for Sale: Timeless Lessons in API Advocacy (Adam DuVander)Pie for Sale: Timeless Lessons in API Advocacy (Adam DuVander)
Pie for Sale: Timeless Lessons in API Advocacy (Adam DuVander)
 
Authorization The Missing Piece of the Puzzle
Authorization The Missing Piece of the PuzzleAuthorization The Missing Piece of the Puzzle
Authorization The Missing Piece of the Puzzle
 
Public Transport APIs – How we are using and creating long lasting APIs at No...
Public Transport APIs – How we are using and creating long lasting APIs at No...Public Transport APIs – How we are using and creating long lasting APIs at No...
Public Transport APIs – How we are using and creating long lasting APIs at No...
 
Apinf Open Api Management
Apinf Open Api Management Apinf Open Api Management
Apinf Open Api Management
 
Platform Security that will Last for Decades (Travis Spencer)
Platform Security that will Last for Decades (Travis Spencer)Platform Security that will Last for Decades (Travis Spencer)
Platform Security that will Last for Decades (Travis Spencer)
 
API Creation to Iteration without the Frustration
API Creation to Iteration without the FrustrationAPI Creation to Iteration without the Frustration
API Creation to Iteration without the Frustration
 
Lean and Mean – Authorization for kick-ass APIs (Jonas Markström)
Lean and Mean – Authorization for kick-ass APIs (Jonas Markström)Lean and Mean – Authorization for kick-ass APIs (Jonas Markström)
Lean and Mean – Authorization for kick-ass APIs (Jonas Markström)
 

Similaire à Microservices architecture overview v2

Microservices architecture overview v3
Microservices architecture overview v3Microservices architecture overview v3
Microservices architecture overview v3Dmitry Skaredov
 
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 2015Ken Owens
 
Running microservices successfully | Bastian Hofmann | CODEiD
Running microservices successfully | Bastian Hofmann | CODEiDRunning microservices successfully | Bastian Hofmann | CODEiD
Running microservices successfully | Bastian Hofmann | CODEiDCODEiD PHP Community
 
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)Ahmed Misbah
 
DCSF19 Adding a Modern API Layer to ‘Dockerized’ Legacy Apps
DCSF19 Adding a Modern API Layer to ‘Dockerized’ Legacy Apps  DCSF19 Adding a Modern API Layer to ‘Dockerized’ Legacy Apps
DCSF19 Adding a Modern API Layer to ‘Dockerized’ Legacy Apps Docker, Inc.
 
Integration in the Cloud, by Rob Davies
Integration in the Cloud, by Rob DaviesIntegration in the Cloud, by Rob Davies
Integration in the Cloud, by Rob DaviesJudy Breedlove
 
Basics of Microservice Architecture
Basics of Microservice ArchitectureBasics of Microservice Architecture
Basics of Microservice ArchitectureSouvikGhosh139
 
Microservices and docker
Microservices and dockerMicroservices and docker
Microservices and dockerAlex Ivy
 
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...Mike Villiger
 
Microservices, Spring Cloud & Cloud Foundry
Microservices, Spring Cloud & Cloud FoundryMicroservices, Spring Cloud & Cloud Foundry
Microservices, Spring Cloud & Cloud FoundryEmilio Garcia
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumRick Hightower
 
20141210 - Microservice Container
20141210 - Microservice Container20141210 - Microservice Container
20141210 - Microservice ContainerJamie (Taka) Wang
 
AWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWSAWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWSAmazon Web Services
 
Microservices: Living Large in Your Castle Made of Sand
Microservices: Living Large in Your Castle Made of SandMicroservices: Living Large in Your Castle Made of Sand
Microservices: Living Large in Your Castle Made of SandMongoDB
 
Think Small To Go Big - Introduction To Microservices
Think Small To Go Big - Introduction To MicroservicesThink Small To Go Big - Introduction To Microservices
Think Small To Go Big - Introduction To MicroservicesRyan Baxter
 
API’s and Micro Services 0.5
API’s and Micro Services 0.5API’s and Micro Services 0.5
API’s and Micro Services 0.5Richard Hudson
 
TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6Sravanthi N
 

Similaire à Microservices architecture overview v2 (20)

Microservices architecture overview v3
Microservices architecture overview v3Microservices architecture overview v3
Microservices architecture overview v3
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Webinar : Microservices and Containerization
Webinar : Microservices and ContainerizationWebinar : Microservices and Containerization
Webinar : Microservices and Containerization
 
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
 
Running microservices successfully | Bastian Hofmann | CODEiD
Running microservices successfully | Bastian Hofmann | CODEiDRunning microservices successfully | Bastian Hofmann | CODEiD
Running microservices successfully | Bastian Hofmann | CODEiD
 
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)
 
DCSF19 Adding a Modern API Layer to ‘Dockerized’ Legacy Apps
DCSF19 Adding a Modern API Layer to ‘Dockerized’ Legacy Apps  DCSF19 Adding a Modern API Layer to ‘Dockerized’ Legacy Apps
DCSF19 Adding a Modern API Layer to ‘Dockerized’ Legacy Apps
 
Integration in the Cloud, by Rob Davies
Integration in the Cloud, by Rob DaviesIntegration in the Cloud, by Rob Davies
Integration in the Cloud, by Rob Davies
 
Basics of Microservice Architecture
Basics of Microservice ArchitectureBasics of Microservice Architecture
Basics of Microservice Architecture
 
Microservices and docker
Microservices and dockerMicroservices and docker
Microservices and docker
 
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
 
Microservices, Spring Cloud & Cloud Foundry
Microservices, Spring Cloud & Cloud FoundryMicroservices, Spring Cloud & Cloud Foundry
Microservices, Spring Cloud & Cloud Foundry
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO Forum
 
20141210 - Microservice Container
20141210 - Microservice Container20141210 - Microservice Container
20141210 - Microservice Container
 
AWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWSAWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWS
 
Microservices: Living Large in Your Castle Made of Sand
Microservices: Living Large in Your Castle Made of SandMicroservices: Living Large in Your Castle Made of Sand
Microservices: Living Large in Your Castle Made of Sand
 
Microservices.pdf
Microservices.pdfMicroservices.pdf
Microservices.pdf
 
Think Small To Go Big - Introduction To Microservices
Think Small To Go Big - Introduction To MicroservicesThink Small To Go Big - Introduction To Microservices
Think Small To Go Big - Introduction To Microservices
 
API’s and Micro Services 0.5
API’s and Micro Services 0.5API’s and Micro Services 0.5
API’s and Micro Services 0.5
 
TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6
 

Dernier

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Microservices architecture overview v2

  • 2. 2CONFIDENTIAL 2 • Why do we need it • Architecture patterns AGENDA • Microservice • API Gateway • Service Discovery • Stateless/Shared-Nothing • Configuration/Service Consumption • Fault Tolerance • Request Collapsing • API Versioning
  • 5. 5CONFIDENTIAL 5 MICROSERVICES VS MONOLITH Simple code base Modularity with exact borders Change circles decoupled Efficient scaling Newcomers adopting faster Per service team responsibility No technology lock MONOLITH MICROSERVICES Complex code base Hard to maintain modularity Change circles tightly coupled Inefficient scaling Scaring for newcomers Hard to scale development team Tied to chose technology
  • 6. 6CONFIDENTIAL 6 MICROSERVICES VALUES • Heavily relies on Continues Delivery principles • Fine-grained domain capability • Team autonomy with responsibility • Independent release process • Independent scaling • System resilience • Technology variation
  • 7. 7CONFIDENTIAL 7 MICROSERVICES VALUES VS COMPLEXITY Team autonomy Time to market Scaling Componentization Technology variation Cross teams communication Continues Deployment Fault tolerance Versioning Maintenance VALUES COMPLEXITY
  • 9. 9CONFIDENTIAL 9 ARCHITECTURE PATTERNS • Microservice • API Gateway • Service Discovery • Stateless/Shared-Nothing • Configuration Management • Fault Tolerance • Request Collapsing
  • 11. 11CONFIDENTIAL 11 BOUNDED CONTEXT Bounded Context is a central pattern in Domain-Driven Design. It is the focus of DDD's strategic design section which is all about dealing with large models and teams.
  • 12. 12CONFIDENTIAL 12 SIZE OF MICROSERVICE 2 pizza size team Ideal Size 7 +/-2 persons
  • 13. 13CONFIDENTIAL 13 DECENTRALIZED DATA MANAGEMENT Microservices prefer letting each service manage its own database, either different instances of the same database technology, or entirely different database systems - an approach called Polyglot Persistence. You can use polyglot persistence in a monolith, but it appears more frequently with microservices.
  • 14. 14CONFIDENTIAL 14 DESIGN FOR FAILURE Distributed systems are much complex than monolith. When we have more systems there is more chances to fail. If more places when you can fails then more often you can deal with failures.
  • 15. 15CONFIDENTIAL 15 KEY CONSIDERATION Before you go into production with a microservices system, you need to ensure that you have key prerequisites in place • Rapid Provisioning • Basic Monitoring • Rapid Application Deployment • DevOps Culture
  • 16. 16CONFIDENTIAL 16 MICROSERVICE VS SOA Martin Fowler Chief Scientist at ThoughtWorks Subset of SOA Zhamak Dehghani Principal Consultant at ThoughtWorks Style of SOA Right picture
  • 19. 19CONFIDENTIAL 19 API GATEWAY 9 at least How many microservices could be involved here?
  • 29. 30CONFIDENTIAL 30 STATELESS/SHARED-NOTHING • Store state at the client • Store state at database • Distributed session • Stateless services
  • 31. 32CONFIDENTIAL 32 STORE CONFIG IN THE ENVIRONMENT The twelve-factor app stores config in environment variables (often shortened to env vars or env). Env vars are easy to change between deploys without changing any code; unlike config files, there is little chance of them being checked into the code repo accidentally; and unlike custom config files, or other config mechanisms such as Java System Properties, they are a language- and OS-agnostic standard. http://12factor.net http://12factor.net/config
  • 36. 37CONFIDENTIAL 37 FAULT TOLERANCE Availability % Downtime per year Downtime per month Downtime per week Downtime per day 90% ("one nine") 36.5 days 72 hours 16.8 hours 2.4 hours 95% 18.25 days 36 hours 8.4 hours 1.2 hours 97% 10.96 days 21.6 hours 5.04 hours 43.2 minutes 98% 7.30 days 14.4 hours 3.36 hours 28.8 minutes 99% ("two nines") 3.65 days 7.20 hours 1.68 hours 14.4 minutes 99.5% 1.83 days 3.60 hours 50.4 minutes 7.2 minutes 99.8% 17.52 hours 86.23 minutes 20.16 minutes 2.88 minutes 99.9% ("three nines") 8.76 hours 43.8 minutes 10.1 minutes 1.44 minutes 99.95% 4.38 hours 21.56 minutes 5.04 minutes 43.2 seconds 99.99% ("four nines") 52.56 minutes 4.38 minutes 1.01 minutes 8.66 seconds 99.995% 26.28 minutes 2.16 minutes 30.24 seconds 4.32 seconds 99.999% ("five nines") 5.26 minutes 25.9 seconds 6.05 seconds 864.3 milliseconds 99.9999% ("six nines") 31.5 seconds 2.59 seconds 604.8 milliseconds 86.4 milliseconds 99.99999% ("seven nines") 3.15 seconds 262.97 milliseconds 60.48 milliseconds 8.64 milliseconds 99.999999% ("eight nines") 315.569 milliseconds 26.297 milliseconds 6.048 milliseconds 0.864 milliseconds 99.9999999% ("nine nines") 31.5569 milliseconds 2.6297 milliseconds 0.6048 milliseconds 0.0864 milliseconds Without taking steps to ensure fault tolerance, 30 dependencies each with 99.99% uptime would result in 2+ hours downtime/month (99.99%30 ≈ 99.7% uptime = 2+ hours in a month) http://techblog.netflix.com/2012/02/fault -tolerance-in-high-volume.html 0.3% means that the one million request will have 3000 failed
  • 37. 38CONFIDENTIAL 38 FAULT TOLERANCE The basic idea behind the circuit breaker is very simple. You wrap a protected function call in a circuit breaker object, which monitors for failures. Once the failures reach a certain threshold, the circuit breaker trips, and all further calls to the circuit breaker return with an error, without the protected call being made at all. Usually you'll also want some kind of monitor alert if the circuit breaker trips. CIRCUIT BREAKER
  • 41. 42CONFIDENTIAL 42 FAULT TOLERANCE Fallback logic scene involving network access, such as cache access. FALLBACK DEGRADATION
  • 43. 44CONFIDENTIAL 44 REQUEST COLLAPSING In addition to the isolation benefits and concurrent execution of dependency calls we have also leveraged the separate threads to enable request collapsing (automatic batching) to increase overall efficiency and reduce user request latencies. Collapse multiple requests into a single execution based on a time window and optionally a max batch size. This allows an object model to have multiple calls to the command that execute/queue many times in a short period (milliseconds) and have them all get batched into a single backend call. Typically the time window is something like 10ms give or take.
  • 44. 45CONFIDENTIAL 45 COLLAPSER FLOW In addition to the isolation benefits and concurrent execution of dependency calls we have also leveraged the separate threads to enable request collapsing (automatic batching) to increase overall efficiency and reduce user request latencies. Collapse multiple requests into a single execution based on a time window and optionally a max batch size. This allows an object model to have multiple calls to the command that execute/queue many times in a short period (milliseconds) and have them all get batched into a single backend call. Typically the time window is something like 10ms give or take.
  • 46. 47CONFIDENTIAL 47 API VERSIONING • Adding authentication • Adding authorization rules • Removing a service • API contract changes REASONS SOLUTIONS • URL Versioning • Media Type Versioning • Custom header • Hostname • Data parameter
  • 47. 48CONFIDENTIAL 48 API VERSIONING One method for indicating versioning is via the URI, typically via a path prefix: Twitter: http://api.twitter.com/1.1/ Last.fm: http://ws.audioscrobbler.com/2.0/ Etsy: http://openapi.etsy.com/v2 Some APIs will provide the version via a query string parameter: Amazon Simple Queue Service: ?VERSION=2011-10-01 URL
  • 48. 49CONFIDENTIAL 49 API VERSIONING Media type versioning provides the ability to use the same URI for multiple versions of an API, by specifying the version as part of the Accept media type. The Accept header can provide versioning in two different ways: • As part of the media type name itself: application/vnd.status.v2+json. In this case, the segment v2 indicates the request is for version 2. You can provide the version string however you desire. • As a parameter to the media type: application/vnd.status+json; version=2. This option provides more verbosity, but allows you to specify the same base media type for each version. Many REST advocates prefer media type versioning as it solves the "one resource, one URI" problem cleanly, and allows adding versioning support after-the-fact. The primary argument against it is the fact that the version is not visible when looking at the URI. MEDIA TYPE
  • 49. 50CONFIDENTIAL 50 API VERSIONING The above two versioning types are the most common; however, other types exist: • Custom header. As an example, • X-API-Version: 2 • GData-Version: 2.0 • X-MS-Version: 2011-08-18 • etc. • Hostname. Facebook, when migrating from the first API version, switched from the host http://api.facebook.com to http://graph.facebook.com. • Data parameter. This could be a query string parameter for GET requests, as noted above, but a content body parameter for other request methods. OTHER METHODOLOGIES
  • 50. 51CONFIDENTIAL 51 API VERSIONING • Typical approach. Include API version. Backwards compatible. • Some folks use custom content type allowing each resource to have a version. • Netflix: strive to be version-less from client perspective • Netflix: try to be version-less even if not wholly possible • Adding new data types or new URIs don’t require new version • Structural changes to large unknown developers better to incomplete than inaccurate. Hold onto ideas before pushing it out. • Netflix assumes 7-10 year life of a TV • Netflix can generally move partners from version to version as needed NETFLIX APPROACH
  • 51. 52CONFIDENTIAL 52 API VERSIONING It seems that there are a number of people recommending using Content-Negotiation (the HTTP “Accept:” header) for API versioning. However, none of the big public REST APIs I have looked at seem to be using this approach. They almost exclusively put the API version number in the URI.
  • 52. 53CONFIDENTIAL 53 API VERSIONING Twitter URI Atlassian URI Google Search URI Github API URI/Media Type in v3 Intention is to remove versioning in favour of hypermedia – current application/vnd.github.v3 Azure Custom Header x-ms-version: 2011-08-18 Facebook URI/optional versioning graph.facebook.com/v1.0/me Bing Maps URI Netflix URI parameter http://api.netflix.com/catalog/titles/series/ 70023522?v=1.5
  • 53. 54CONFIDENTIAL 54 API VERSIONING Google data API (youtube/spreadsheets/others) URI parameter or custom header “GData-Version: X.0” or “v=X.0” Flickr No versioning? Digg URI http://services.digg.com/2.0/comment.bury Delicious URI https://api.del.icio.us/v1/posts/update Last FM URI http://ws.audioscrobbler.com/2.0/ LinkedIn URI http://api.linkedin.com/v1/people/~/connec tions Foursquare URI https://api.foursquare.com/v2/venues/40a55 d80f964a52020f31ee3?oauth_token=XXX&v=YY YYMMDD
  • 54. 55CONFIDENTIAL 55 API VERSIONING paypal parameter &VERSION=XX.0 Twitpic URI http://api.twitpic.com/2/upload.format Etsy URI http://openapi.etsy.com/v2 Tropo URI https://api.tropo.com/1.0/sessions Tumblr URI api.tumblr.com/v2/user/ openstreetmap URI and response body http://server/api/0.6/changeset/create Ebay URI (I think) http://open.api.ebay.com/shopping?version= 713
  • 55. 56CONFIDENTIAL 56 API VERSIONING Wikipedia no versioning I think? Bitly URI https://api-ssl.bitly.com/v3/shorten Disqus URI https://disqus.com/api/3.0/posts/remove.js on Yammer URI /api/v1 Drop Box URI https://api.dropbox.com/1/oauth/request_to ken Amazon Simple Queue Service (Soap) URI Parameter and WSDL URI &Version=2011-10-01

Notes de l'éditeur

  1. MONOLITH Complex code base Hard to maintain modularity – cyclic dependencies, code duplication, broken layers, broken SOLID principle Single responsibility principle Open/closed principle Liskov substitution principle Interface segregation principle Dependency inversion principle Change circles tightly coupled – any team which a delivered functionality faster than others tied by other teams due to common release circle, need to wait stable code, common regression, etc Inefficient scaling Scaring for newcomers Hard to scale development team – hard to move people between teams – hard to deep dive into new code base Long term commitment for a chose technology – can’t try to use any new technology just because it’s too risky MICROSERVICE Simple code base – but challenging in cross communication setup Modularity with exact borders – no cross dependencies between different code base, just over defined API Change circles decoupled – you can release when your team is ready and you can release faster Efficient scaling – in case we are heavy in writing – we can separate this functionality to separate service and scale it independently Newcomers adopting faster Per service team responsibility No technology lock – easy to experiment without applying any risk to all functionality
  2. Subset of SAO Martin Fowler, chief scientist at ThoughtWorks https://youtu.be/wgdBVIX9ifA?t=854 Style of SAO Zhamak Dehghani, principal consultant at ThoughtWorks https://youtu.be/1aaw7iYS_VM?t=173
  3. Configuration – if it does change then it is configuration, if it does not change then it is code.
  4. Configuration – if it does change then it is configuration, if it does not change then it is code.
  5. 503 Service Unavailable 504 Gateway Timeout connectionTimeout The number of milliseconds this Connector will wait, after accepting a connection, for the request URI line to be presented. Use a value of -1 to indicate no (i.e. infinite) timeout. The default value is 60000 (i.e. 60 seconds)
  6. maxThreads(int) The max number of active threads in this pool, default is 200
  7. Callback pipeline