SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Microservices Architecture
Fundamental and Practice
Fundamental
What is Microservices?
An approach to developing a single application as a suite of small services, each
running of its own process and communication with lightweight mechanism, often
HTTP resource API. ~ Martin Fowler
Start from Monolithic
Monolithic is opposite of microservices. It is a common system that nowdays used.
It is application built as single unit.
Applications are often built in three main parts: client-side, database, server-side.
Server side handle HTTP request, execute domain logic, retrieve & update DB,
select the view or respond to client.
This server side application is a monolith.
The limit of monolithic
Monolithic applications can be successful, but increasingly people are feeling
frustrations with them, especially more applications are being deployed to the
cloud.
Change cycles are tied together
Over time it's often hard to keep a good modular structure
Scaling requires scaling of the entire application
Monolithic Microservices
Characteristic of Microservices Architecture
Componentization via services
Organized around Business Capabilities
Products not Projects
Smart endpoints and dumb pipes
Decentralized Governance
Decentralized Data Management
Infrastructure Automation
Design for failure
Componentization via services
a component is a unit of software that is independently replaceable and
upgradeable.
One main reason for using services as components (rather than libraries) is that
services are independently deployable.
Organized around Business Capabilities
Any organization that designs a system (defined
broadly) will produce a design whose structure is a
copy of the organization's communication structure.
-- Melvyn Conway, 1967
The microservice approach to
division is different, splitting up into
services organized around business
capability.
Products not Projects
Microservice proponents tend to avoid this model, preferring instead the notion that
a team should own a product over its full lifetime.
The product mentality, ties in with the linkage to business capabilities.
The smaller granularity of services can make it easier to create the personal
relationships between service developers and their users.
“You build, You run it” - Werner Vogels - CTO of Amazon
Smart endpoints and dumb pipes
Applications built from microservices aim to be as decoupled and as cohesive as
possible.
The two protocols used most commonly are HTTP request-response with
resource API's and lightweight messaging.
By using simple RESTish protocols rather than complex protocols
By using messaging over a lightweight message bus. The infrastructure chosen is typically dumb. simple
implementations such as RabbitMQ or ZeroMQ don't do much more than provide a reliable
asynchronous fabric
Be of the web, not behind the web
-- Ian Robinson
Decentralized Governance
One of the consequences of centralised governance is the tendency to standardise
on single technology platforms.
Experience shows that this approach is constricting - not every problem is a nail
and not every solution a hammer.
In this case microservices could be like this:
You want to use Node.js to standup a simple reports page? Go for it. C++ for a particularly gnarly near-
real-time component? Fine. You want to swap in a different flavour of database that better suits the read
behaviour of one component? We have the technology to rebuild him.
Decentralized Data Management ( 1 )
At the most abstract level, it means that the conceptual model of the world will
differ between systems.
This issue is common between applications, but can also occur within applications,
particular when that application is divided into separate components. A useful way
of thinking about this is the Domain-Driven Design notion of Bounded Context.
As well as decentralizing decisions about conceptual models, microservices also
decentralize data storage decisions.
Decentralized Data Management (2)
Infrastructure Automation
Teams building software this way make extensive use of infrastructure automation
techniques.
as much confidence as possible that our software is working, so we run lots of
automated tests. Promotion of working software 'up' the pipeline means we
automate deployment to each new environment.
Design for failure
Any service call could fail due to unavailability of the supplier, the client has to
respond to this as gracefully as possible.
Since services can fail at any time, it's important to be able to detect the failures
quickly and, if possible, automatically restore service.
That’s why, microservices have a lot of monitoring process, real-time monitoring,
business relevant metrics, log and so on.
Evolutionary Design
Evolutionary Design is see service decomposition as a further tool to enable
application developers to control changes in their application without slowing down
change.
Whenever you try to break a software system into components, you're faced with
the decision of how to divide up the pieces. what are the principles?
The key property of a component is the notion of independent replacement and
upgradeability.
Pattern & Practice
The Pattern
Monolithic Architecture
Microservices Architecture
API Gateway
Client-side discovery
Server-side discovery
Service Registry
Self Registration
3rd party Registration
Multiple service instance per host
Single service instance per host
Service instance per VM
Service instance per Container
Database per service
Monolithic Architecture (1)
● Simple to develop
● Simple to deploy
● Simple to scale
However:
The large monolithic code base intimidates developers, especially ones who are new to the team. The
application can be difficult to understand and modify. As a result, development typically slows down.
Overloaded IDE
Overloaded web container
Monolithic Architecture (2)
However:
Continuous deployment is difficult - a large monolithic application is also an obstacle to frequent
deployments.
Scaling the application can be difficult - a monolithic architecture is that it can only scale in one
dimension.
Obstacle to scaling development - A monolithic application is also an obstacle to scaling development.
Requires a long-term commitment to a technology stack - a monolithic architecture forces you to be
married to the technology stack (and in some cases, to a particular version of that technology) you
chose at the start of development .
Microservices Architecture (1)
● Each microservice is relatively small
○ Easier for a developer to understand
○ The IDE is faster making developers more productive
○ The web container starts faster, which makes developers more productive, and speeds up
deployments
● Each service can be deployed independently of other services
● Easier to scale development. It enables you to organize the development effort around multiple
teams. Each (two pizza) team is responsible a single service.
● Improved fault isolation. For example, if there is a memory leak in one service then only that service
will be affected.
● Eliminates any long-term commitment to a technology stack
Microservices Architecture (2)
Another challenge is deciding how to partition the system into microservices. This
is very much an art, but there are a number of strategies that can help.
Partition services by verb or use case.
Partition the system by nouns or resources.
Related Pattern
API Gateway
Implement an API gateway that is the
single entry point for all clients. The API
gateway handles requests in one of two
ways.
The API Gateway must use either the
Client-side Discovery pattern or Server-
side Discovery Pattern to route requests
to available service instances.
Client-side Discovery (1)
Services typically need to call one another.
In a traditional distributed system deployment, services run at fixed, well known
locations (hosts and ports) and so can easily call one another using
HTTP/REST.
a modern microservice-based application typically runs in a virtualized or
containerized environments where the number of instances of a service and their
locations changes dynamically.
Client-side Discovery (2)
The Benefit is fewer moving parts
and network hops compared to
Server-side registry.
This pattern couples the client to
service registry.
Server-side Discovery
When making a request to a service,
the client makes a request via a router
(a.k.a load balancer) that runs at a well
known location. The router queries a
service registry.
More network hops are required
than when using Client-side
discovery
AWS provide this functionality, e.g.
AWS Elastic Load Balancer
Service Registry (1)
a database of services, their instances and their locations.
Service instances are registered with the service registry on startup and
deregistered on shutdown.
Examples of service registries (or technologies that are commonly used as service
registries) include:
Eureka
Apache Zookeeper
Consul
Etcd
Service Registry (2)
The Service Registry is a critical system component. Although clients should cache
data provided by the service registry, if the service registry fails that data will
eventually become out of date. Consequently, the service registry must be highly
available.
You need to decide how service instances are registered with the service registry. There are two options:
● Self registration pattern - service instances register themselves
● 3rd party registration pattern - a 3rd party register the service instances with the service registry
Note: Service registry instances must be deployed on fixed and well known IP addresses
Self Registration
A service instance is responsible for registering itself with the service registry.
On startup the service instance registers itself (host and IP address) with the service
registry and makes itself available for discovery.
Drawbacks:
You must implement service registration logic in each programming language/framework that you use to
write your services
A service instance that is running yet unable to handle requests will often lack the self-awareness to
unregister itself from the service registry
3rd Party Registration
A 3rd party registrar is responsible for registering and unregistering a service
instance with the service registry.
Examples: Netflix Prana, AWS Autoscaling Groups, Joyent's Container buddy,
Registrator, Clustering frameworks such as Kubernetes and Marathon (un)register
service instances with the built-in/implicit registry.
Drawback:
Unless the registar is part of the infrastructure it’s another component that must be
installed, configured and maintained. Also, since it’s a critical system component it
needs to be highly available.
Multiple Services per host
Run multiple instance of services on a host (Physical or Virtual machine).
There are various ways of deploying a service instance on a shared host including:
Deploy each service instance as a JVM process. For example, a Tomcat or Jetty
instances per service instance.
Deploy multiple service instances in the same JVM. For example, as web
applications or OSGI bundles.
Drawbacks:
Risk of conflicting resource requirements / dependency versions
Difficult to limit the resources consumed by a service instance
Difficult to monitor process
Single Service per host
Deploy each single service instance on it’s own host.
The benefits of this approach include:
Services instances are isolated from one another
There is no possibility of conflicting resource requirements or dependency
versions
A service instance can only consume at most the resources of a single host
Its straightforward to monitor, manage, and redeploy each service instance
Drawbacks:
Potentially less efficient resource utilization
Database per service (1)
Keep each microservice’s persistent data private to that service and accessible only
via its API. The following of example:
Database per service (2)
if you are using a relational database then the options are:
Private-tables-per-service – each service owns a set of tables that must only be
accessed by that service
Schema-per-service – each service has a database schema that’s private to that
service
Database-server-per-service – each service has it’s own database server.
Additional
The Scale Cube
X-axis scaling consists of running
multiple copies of an application
behind a load balancer.
Y-axis axis scaling splits the
application into multiple, different
services.
Z-axis splits are commonly used to
scale databases. Data is partitioned
(a.k.a. sharded) across a set of servers
based on an attribute of each record.
CAP Theorem(1)
Consistency (C), Availability (A), and Partition tolerance (P) across distributed
systems.
Simply put, the CAP theorem demonstrates that any distributed system cannot guaranty C, A,
and P simultaneously, rather, trade-offs must be made at a point-in-time to achieve the level
of performance and availability required for a specific task.
CAP Theorem (2)
Reference
http://martinfowler.com/articles/microservices.html
http://microservices.io/patterns/microservices.html
https://auth0.com/blog/2015/11/07/introduction-to-microservices-part-4-
dependencies/
http://microservices.io/articles/scalecube.html

Weitere ähnliche Inhalte

Was ist angesagt?

Microservices in Practice
Microservices in PracticeMicroservices in Practice
Microservices in PracticeKasun Indrasiri
 
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUESARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUESSOAT
 
Containers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatContainers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatAmazon Web Services
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanAraf Karsh Hamid
 
Cloud Native Application
Cloud Native ApplicationCloud Native Application
Cloud Native ApplicationVMUG IT
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice ArchitectureNguyen Tung
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesMahmoudZidan41
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To MicroservicesLalit Kale
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices Bozhidar Bozhanov
 
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.Richard Langlois P. Eng.
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices ArchitectureIzzet Mustafaiev
 
Integration Microservices
Integration MicroservicesIntegration Microservices
Integration MicroservicesKasun Indrasiri
 
Cloud native principles
Cloud native principlesCloud native principles
Cloud native principlesDiego Pacheco
 
Microservices
MicroservicesMicroservices
MicroservicesSmartBear
 

Was ist angesagt? (20)

Microservices in Practice
Microservices in PracticeMicroservices in Practice
Microservices in Practice
 
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUESARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
ARCHITECTURE MICROSERVICE : TOUR D’HORIZON DU CONCEPT ET BONNES PRATIQUES
 
Containers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatContainers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red Hat
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
 
Cloud Native Application
Cloud Native ApplicationCloud Native Application
Cloud Native Application
 
Why to Cloud Native
Why to Cloud NativeWhy to Cloud Native
Why to Cloud Native
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Cloud Native Application Development
Cloud Native Application DevelopmentCloud Native Application Development
Cloud Native Application Development
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To Microservices
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices
 
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.
 
Cloud Native In-Depth
Cloud Native In-DepthCloud Native In-Depth
Cloud Native In-Depth
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Integration Microservices
Integration MicroservicesIntegration Microservices
Integration Microservices
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Cloud native principles
Cloud native principlesCloud native principles
Cloud native principles
 
Microservices
MicroservicesMicroservices
Microservices
 

Andere mochten auch

Service Discovery and Registration in a Microservices Architecture
Service Discovery and Registration in a Microservices ArchitectureService Discovery and Registration in a Microservices Architecture
Service Discovery and Registration in a Microservices ArchitecturePLUMgrid
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService ArchitectureFred George
 
Principles of microservices velocity
Principles of microservices   velocityPrinciples of microservices   velocity
Principles of microservices velocitySam Newman
 
Testing microservice-architecture-qe
Testing microservice-architecture-qeTesting microservice-architecture-qe
Testing microservice-architecture-qeŁukasz Rosłonek
 
Microservices Minus The Hype
Microservices Minus The HypeMicroservices Minus The Hype
Microservices Minus The HypeMark Heckler
 
Microservices - Peixe Urbano Tech Talks
Microservices - Peixe Urbano Tech TalksMicroservices - Peixe Urbano Tech Talks
Microservices - Peixe Urbano Tech TalksPedro Mendes
 
Java Play Restful JPA
Java Play Restful JPAJava Play Restful JPA
Java Play Restful JPAFaren faren
 
Auckland API & Microservices Meetup 1: API led design
Auckland API & Microservices Meetup 1: API led designAuckland API & Microservices Meetup 1: API led design
Auckland API & Microservices Meetup 1: API led designDamian Harvey
 
Spring 4.0 - Evolution or Revolution
Spring 4.0 - Evolution or RevolutionSpring 4.0 - Evolution or Revolution
Spring 4.0 - Evolution or RevolutionRaffael Schmid
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureAbdelghani Azri
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice ArchitectureEngin Yoeyen
 
Microservices 101: opportunities, dilemmas and problems
Microservices 101: opportunities, dilemmas and problemsMicroservices 101: opportunities, dilemmas and problems
Microservices 101: opportunities, dilemmas and problemsŁukasz Sowa
 
Microservices 101 - The Big Why?
Microservices 101 - The Big Why?Microservices 101 - The Big Why?
Microservices 101 - The Big Why?Yamen Sader
 
Microservices the Good Bad and the Ugly
Microservices the Good Bad and the UglyMicroservices the Good Bad and the Ugly
Microservices the Good Bad and the UglyAdrian Cockcroft
 
Systems Monitoring with Prometheus (Devops Ireland April 2015)
Systems Monitoring with Prometheus (Devops Ireland April 2015)Systems Monitoring with Prometheus (Devops Ireland April 2015)
Systems Monitoring with Prometheus (Devops Ireland April 2015)Brian Brazil
 
Microservice Architecture on AWS using AWS Lambda and Docker Containers
Microservice Architecture on AWS using AWS Lambda and Docker ContainersMicroservice Architecture on AWS using AWS Lambda and Docker Containers
Microservice Architecture on AWS using AWS Lambda and Docker ContainersDanilo Poccia
 

Andere mochten auch (20)

Service Discovery and Registration in a Microservices Architecture
Service Discovery and Registration in a Microservices ArchitectureService Discovery and Registration in a Microservices Architecture
Service Discovery and Registration in a Microservices Architecture
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService Architecture
 
Principles of microservices velocity
Principles of microservices   velocityPrinciples of microservices   velocity
Principles of microservices velocity
 
Testing microservice-architecture-qe
Testing microservice-architecture-qeTesting microservice-architecture-qe
Testing microservice-architecture-qe
 
Microservices Minus The Hype
Microservices Minus The HypeMicroservices Minus The Hype
Microservices Minus The Hype
 
Lean at Yahoo in 2008
Lean at Yahoo in 2008Lean at Yahoo in 2008
Lean at Yahoo in 2008
 
Microservices - Peixe Urbano Tech Talks
Microservices - Peixe Urbano Tech TalksMicroservices - Peixe Urbano Tech Talks
Microservices - Peixe Urbano Tech Talks
 
Java Play Restful JPA
Java Play Restful JPAJava Play Restful JPA
Java Play Restful JPA
 
Auckland API & Microservices Meetup 1: API led design
Auckland API & Microservices Meetup 1: API led designAuckland API & Microservices Meetup 1: API led design
Auckland API & Microservices Meetup 1: API led design
 
Spring 4.0 - Evolution or Revolution
Spring 4.0 - Evolution or RevolutionSpring 4.0 - Evolution or Revolution
Spring 4.0 - Evolution or Revolution
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Microservices 101: opportunities, dilemmas and problems
Microservices 101: opportunities, dilemmas and problemsMicroservices 101: opportunities, dilemmas and problems
Microservices 101: opportunities, dilemmas and problems
 
Microservices 101 - The Big Why?
Microservices 101 - The Big Why?Microservices 101 - The Big Why?
Microservices 101 - The Big Why?
 
Revitalizing Aging Architectures with Microservices
Revitalizing Aging Architectures with MicroservicesRevitalizing Aging Architectures with Microservices
Revitalizing Aging Architectures with Microservices
 
Microservices the Good Bad and the Ugly
Microservices the Good Bad and the UglyMicroservices the Good Bad and the Ugly
Microservices the Good Bad and the Ugly
 
Systems Monitoring with Prometheus (Devops Ireland April 2015)
Systems Monitoring with Prometheus (Devops Ireland April 2015)Systems Monitoring with Prometheus (Devops Ireland April 2015)
Systems Monitoring with Prometheus (Devops Ireland April 2015)
 
BDD-Driven Microservices
BDD-Driven MicroservicesBDD-Driven Microservices
BDD-Driven Microservices
 
Microservice Architecture on AWS using AWS Lambda and Docker Containers
Microservice Architecture on AWS using AWS Lambda and Docker ContainersMicroservice Architecture on AWS using AWS Lambda and Docker Containers
Microservice Architecture on AWS using AWS Lambda and Docker Containers
 
From SOA to MSA
From SOA to MSAFrom SOA to MSA
From SOA to MSA
 

Ähnlich wie Microservices architecture

Microsoft Microservices
Microsoft MicroservicesMicrosoft Microservices
Microsoft MicroservicesChase Aucoin
 
Do You Need A Service Mesh?
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?NGINX, Inc.
 
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY IJwest
 
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHYSELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHYdannyijwest
 
Agile integration: Decomposing the monolith
Agile integration: Decomposing the monolith Agile integration: Decomposing the monolith
Agile integration: Decomposing the monolith Judy Breedlove
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitectureABDEL RAHMAN KARIM
 
Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015Nenad Pecanac
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
 
Microservice Pattern Launguage
Microservice Pattern LaunguageMicroservice Pattern Launguage
Microservice Pattern LaunguageInho Kang
 
Microservice final final
Microservice final finalMicroservice final final
Microservice final finalgaurav shukla
 
The elegant way of implementing microservices with istio
The elegant way of implementing microservices with istioThe elegant way of implementing microservices with istio
The elegant way of implementing microservices with istioInho Kang
 
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클Oracle Korea
 
MuCon 2015 - Microservices in Integration Architecture
MuCon 2015 - Microservices in Integration ArchitectureMuCon 2015 - Microservices in Integration Architecture
MuCon 2015 - Microservices in Integration ArchitectureKim Clark
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumRick Hightower
 
Software Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesSoftware Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesAngelos Kapsimanis
 
Do I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptxDo I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptxPINGXIONG3
 

Ähnlich wie Microservices architecture (20)

Microservices-101
Microservices-101Microservices-101
Microservices-101
 
Microservices
MicroservicesMicroservices
Microservices
 
Microsoft Microservices
Microsoft MicroservicesMicrosoft Microservices
Microsoft Microservices
 
Do You Need A Service Mesh?
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?
 
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
 
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHYSELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
 
Agile integration: Decomposing the monolith
Agile integration: Decomposing the monolith Agile integration: Decomposing the monolith
Agile integration: Decomposing the monolith
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitecture
 
Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Microservice Pattern Launguage
Microservice Pattern LaunguageMicroservice Pattern Launguage
Microservice Pattern Launguage
 
Microservice final final
Microservice final finalMicroservice final final
Microservice final final
 
The elegant way of implementing microservices with istio
The elegant way of implementing microservices with istioThe elegant way of implementing microservices with istio
The elegant way of implementing microservices with istio
 
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
 
Microservices.pptx
Microservices.pptxMicroservices.pptx
Microservices.pptx
 
MuCon 2015 - Microservices in Integration Architecture
MuCon 2015 - Microservices in Integration ArchitectureMuCon 2015 - Microservices in Integration Architecture
MuCon 2015 - Microservices in Integration Architecture
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO Forum
 
Software Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesSoftware Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based Architectures
 
Do I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptxDo I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptx
 
Microservices
MicroservicesMicroservices
Microservices
 

Kürzlich hochgeladen

Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 

Kürzlich hochgeladen (20)

Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 

Microservices architecture

  • 3. What is Microservices? An approach to developing a single application as a suite of small services, each running of its own process and communication with lightweight mechanism, often HTTP resource API. ~ Martin Fowler
  • 4. Start from Monolithic Monolithic is opposite of microservices. It is a common system that nowdays used. It is application built as single unit. Applications are often built in three main parts: client-side, database, server-side. Server side handle HTTP request, execute domain logic, retrieve & update DB, select the view or respond to client. This server side application is a monolith.
  • 5. The limit of monolithic Monolithic applications can be successful, but increasingly people are feeling frustrations with them, especially more applications are being deployed to the cloud. Change cycles are tied together Over time it's often hard to keep a good modular structure Scaling requires scaling of the entire application
  • 7. Characteristic of Microservices Architecture Componentization via services Organized around Business Capabilities Products not Projects Smart endpoints and dumb pipes Decentralized Governance Decentralized Data Management Infrastructure Automation Design for failure
  • 8. Componentization via services a component is a unit of software that is independently replaceable and upgradeable. One main reason for using services as components (rather than libraries) is that services are independently deployable.
  • 9. Organized around Business Capabilities Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure. -- Melvyn Conway, 1967 The microservice approach to division is different, splitting up into services organized around business capability.
  • 10. Products not Projects Microservice proponents tend to avoid this model, preferring instead the notion that a team should own a product over its full lifetime. The product mentality, ties in with the linkage to business capabilities. The smaller granularity of services can make it easier to create the personal relationships between service developers and their users. “You build, You run it” - Werner Vogels - CTO of Amazon
  • 11. Smart endpoints and dumb pipes Applications built from microservices aim to be as decoupled and as cohesive as possible. The two protocols used most commonly are HTTP request-response with resource API's and lightweight messaging. By using simple RESTish protocols rather than complex protocols By using messaging over a lightweight message bus. The infrastructure chosen is typically dumb. simple implementations such as RabbitMQ or ZeroMQ don't do much more than provide a reliable asynchronous fabric Be of the web, not behind the web -- Ian Robinson
  • 12. Decentralized Governance One of the consequences of centralised governance is the tendency to standardise on single technology platforms. Experience shows that this approach is constricting - not every problem is a nail and not every solution a hammer. In this case microservices could be like this: You want to use Node.js to standup a simple reports page? Go for it. C++ for a particularly gnarly near- real-time component? Fine. You want to swap in a different flavour of database that better suits the read behaviour of one component? We have the technology to rebuild him.
  • 13. Decentralized Data Management ( 1 ) At the most abstract level, it means that the conceptual model of the world will differ between systems. This issue is common between applications, but can also occur within applications, particular when that application is divided into separate components. A useful way of thinking about this is the Domain-Driven Design notion of Bounded Context. As well as decentralizing decisions about conceptual models, microservices also decentralize data storage decisions.
  • 15. Infrastructure Automation Teams building software this way make extensive use of infrastructure automation techniques. as much confidence as possible that our software is working, so we run lots of automated tests. Promotion of working software 'up' the pipeline means we automate deployment to each new environment.
  • 16. Design for failure Any service call could fail due to unavailability of the supplier, the client has to respond to this as gracefully as possible. Since services can fail at any time, it's important to be able to detect the failures quickly and, if possible, automatically restore service. That’s why, microservices have a lot of monitoring process, real-time monitoring, business relevant metrics, log and so on.
  • 17. Evolutionary Design Evolutionary Design is see service decomposition as a further tool to enable application developers to control changes in their application without slowing down change. Whenever you try to break a software system into components, you're faced with the decision of how to divide up the pieces. what are the principles? The key property of a component is the notion of independent replacement and upgradeability.
  • 19. The Pattern Monolithic Architecture Microservices Architecture API Gateway Client-side discovery Server-side discovery Service Registry Self Registration 3rd party Registration Multiple service instance per host Single service instance per host Service instance per VM Service instance per Container Database per service
  • 20. Monolithic Architecture (1) ● Simple to develop ● Simple to deploy ● Simple to scale However: The large monolithic code base intimidates developers, especially ones who are new to the team. The application can be difficult to understand and modify. As a result, development typically slows down. Overloaded IDE Overloaded web container
  • 21. Monolithic Architecture (2) However: Continuous deployment is difficult - a large monolithic application is also an obstacle to frequent deployments. Scaling the application can be difficult - a monolithic architecture is that it can only scale in one dimension. Obstacle to scaling development - A monolithic application is also an obstacle to scaling development. Requires a long-term commitment to a technology stack - a monolithic architecture forces you to be married to the technology stack (and in some cases, to a particular version of that technology) you chose at the start of development .
  • 22. Microservices Architecture (1) ● Each microservice is relatively small ○ Easier for a developer to understand ○ The IDE is faster making developers more productive ○ The web container starts faster, which makes developers more productive, and speeds up deployments ● Each service can be deployed independently of other services ● Easier to scale development. It enables you to organize the development effort around multiple teams. Each (two pizza) team is responsible a single service. ● Improved fault isolation. For example, if there is a memory leak in one service then only that service will be affected. ● Eliminates any long-term commitment to a technology stack
  • 23. Microservices Architecture (2) Another challenge is deciding how to partition the system into microservices. This is very much an art, but there are a number of strategies that can help. Partition services by verb or use case. Partition the system by nouns or resources.
  • 25. API Gateway Implement an API gateway that is the single entry point for all clients. The API gateway handles requests in one of two ways. The API Gateway must use either the Client-side Discovery pattern or Server- side Discovery Pattern to route requests to available service instances.
  • 26. Client-side Discovery (1) Services typically need to call one another. In a traditional distributed system deployment, services run at fixed, well known locations (hosts and ports) and so can easily call one another using HTTP/REST. a modern microservice-based application typically runs in a virtualized or containerized environments where the number of instances of a service and their locations changes dynamically.
  • 27. Client-side Discovery (2) The Benefit is fewer moving parts and network hops compared to Server-side registry. This pattern couples the client to service registry.
  • 28. Server-side Discovery When making a request to a service, the client makes a request via a router (a.k.a load balancer) that runs at a well known location. The router queries a service registry. More network hops are required than when using Client-side discovery AWS provide this functionality, e.g. AWS Elastic Load Balancer
  • 29. Service Registry (1) a database of services, their instances and their locations. Service instances are registered with the service registry on startup and deregistered on shutdown. Examples of service registries (or technologies that are commonly used as service registries) include: Eureka Apache Zookeeper Consul Etcd
  • 30. Service Registry (2) The Service Registry is a critical system component. Although clients should cache data provided by the service registry, if the service registry fails that data will eventually become out of date. Consequently, the service registry must be highly available. You need to decide how service instances are registered with the service registry. There are two options: ● Self registration pattern - service instances register themselves ● 3rd party registration pattern - a 3rd party register the service instances with the service registry Note: Service registry instances must be deployed on fixed and well known IP addresses
  • 31. Self Registration A service instance is responsible for registering itself with the service registry. On startup the service instance registers itself (host and IP address) with the service registry and makes itself available for discovery. Drawbacks: You must implement service registration logic in each programming language/framework that you use to write your services A service instance that is running yet unable to handle requests will often lack the self-awareness to unregister itself from the service registry
  • 32. 3rd Party Registration A 3rd party registrar is responsible for registering and unregistering a service instance with the service registry. Examples: Netflix Prana, AWS Autoscaling Groups, Joyent's Container buddy, Registrator, Clustering frameworks such as Kubernetes and Marathon (un)register service instances with the built-in/implicit registry. Drawback: Unless the registar is part of the infrastructure it’s another component that must be installed, configured and maintained. Also, since it’s a critical system component it needs to be highly available.
  • 33. Multiple Services per host Run multiple instance of services on a host (Physical or Virtual machine). There are various ways of deploying a service instance on a shared host including: Deploy each service instance as a JVM process. For example, a Tomcat or Jetty instances per service instance. Deploy multiple service instances in the same JVM. For example, as web applications or OSGI bundles. Drawbacks: Risk of conflicting resource requirements / dependency versions Difficult to limit the resources consumed by a service instance Difficult to monitor process
  • 34. Single Service per host Deploy each single service instance on it’s own host. The benefits of this approach include: Services instances are isolated from one another There is no possibility of conflicting resource requirements or dependency versions A service instance can only consume at most the resources of a single host Its straightforward to monitor, manage, and redeploy each service instance Drawbacks: Potentially less efficient resource utilization
  • 35. Database per service (1) Keep each microservice’s persistent data private to that service and accessible only via its API. The following of example:
  • 36. Database per service (2) if you are using a relational database then the options are: Private-tables-per-service – each service owns a set of tables that must only be accessed by that service Schema-per-service – each service has a database schema that’s private to that service Database-server-per-service – each service has it’s own database server.
  • 38. The Scale Cube X-axis scaling consists of running multiple copies of an application behind a load balancer. Y-axis axis scaling splits the application into multiple, different services. Z-axis splits are commonly used to scale databases. Data is partitioned (a.k.a. sharded) across a set of servers based on an attribute of each record.
  • 39. CAP Theorem(1) Consistency (C), Availability (A), and Partition tolerance (P) across distributed systems. Simply put, the CAP theorem demonstrates that any distributed system cannot guaranty C, A, and P simultaneously, rather, trade-offs must be made at a point-in-time to achieve the level of performance and availability required for a specific task.

Hinweis der Redaktion

  1. A common inspiration for this is Amazon's notion of "you build, you run it" where a development team takes full responsibility for the software in production.
  2. Netflix's Simian Army induces failures of services and even datacenters during the working day to test both the application's resilience and monitoring.
  3. The Guardian website is a good example of an application that was designed and built as a monolith, but has been evolving in a microservice direction. The monolith still is the core of the website, but they prefer to add new features by building microservices that use the monolith's API. This approach is particularly handy for features that are inherently temporary, such as specialized pages to handle a sporting event. Such a part of the website can quickly be put together using rapid development languages, and removed once the event is over. We've seen similar approaches at a financial institution where new services are added for a market opportunity and discarded after a few months or even weeks.