SlideShare a Scribd company logo
DOSE: Deployment and Operations
for Software Engineers
Microservice Architecture
© Len Bass 2019 2
Overview
• Definition
• Microservices and DevOps
• Quality attributes
© Len Bass 2019 3
Definition
• A microservice architecture is
• A collection of independently deployable
processes
• Packaged as services
• Communicating only via messages
© Len Bass 2019 4
~2002 Amazon instituted the
following design rules - 1
• All teams will henceforth expose their data and
functionality through service interfaces.
• Teams must communicate with each other
through these interfaces.
• There will be no other form of inter-process
communication allowed: no direct linking, no
direct reads of another team’s data store, no
shared-memory model, no back-doors
whatsoever. The only communication allowed
is via service interface calls over the network.
© Len Bass 2019 5
Amazon design rules - 2
• It doesn’t matter what technology they[services] use.
• All service interfaces, without exception, must be
designed from the ground up to be externalizable.
• Amazon is providing the specifications for the
“Microservice Architecture”.
© Len Bass 2019 6
In Addition
• Amazon has a “two pizza” rule.
• No team should be larger than can be fed with two
pizzas (~7 members).
• Each (micro) service is the responsibility
of one team
• This means that microservices are
small and intra team bandwidth
is high
• Large systems are made up of many microservices.
• There may be as many as 140 in a typical Amazon page.
© Len Bass 2019 7
Services can have multiple instances
• The elasticity of the cloud will adjust the number of
instances of each service to reflect the workload.
• Requests are routed through a load balancer for
each service
• This leads to
• Lots of load balancers
• Overhead for each request.
© Len Bass 2019 8
Digression into Service
Oriented Architecture (SOA)
• The definition of microservice architecture sounds
a lot like SOA.
• What is the difference?
• Amazon did not use the term “microservice
architecture” when they introduced their rules.
They said “this is SOA done right”
© Len Bass 2019 9
SOA typically has but microservice
architecture does not
• Enterprise service bus
• Elaborate protocols for sending messages to
services (WDSL*)
• Each service may be under the control of different
organization
• Brokers
• etc
© Len Bass 2019 10
Micro service architecture
Service
• Each user request is satisfied by
some sequence of services.
• Most services are not externally
available.
• Each service communicates with
other services through service
interfaces.
• Service depth may
– Shallow (large fan out)
– Deep (small fan out, more
dependent services)
© Len Bass 2019 11
Microservice architecture
supports DevOps processes
• Reduces need for coordination
• Reduces pipeline errors
• Supports continuous deployment
© Len Bass 2019 12
How does microservice architecture
reduce requirements for coordination?
• Coordination decisions can be made
• incrementally as system evolves or
• be built into the architecture.
• Microservice architecture builds most coordination
decisions into architecture
• Consequently they only need to be made once for a
system, not once per release.
© Len Bass 2019 13
Seven Decision Categories
• Architectures can be categorized by means of seven
categories
1. Allocation of functionality
2. Coordination model
3. Data model
4. Management of resources
5. Mapping among architectural elements
6. Binding time decisions
7. Technology choices
© Len Bass 2019 14
Design decisions with
microservicess
• Microservice architecture either specifies or
delegates to the development team five out of the
seven categories of design decisions.
1. Allocation of responsibilities.
2. Coordination model.
3. Data model.
4. Management of resources.
5. Mapping among architectural elements.
6. Binding time decisions.
7. Choice of technology
© Len Bass 2019 15
How do microservices reduce
pipeline errors?
• Many integration errors are caused by
incompatibilities.
• Each team makes its own technology choices for
their services. This reduces errors during integration
• No problems with inconsistent versions of
dependent software
• No problems with language choices
© Len Bass 2019 16
How do microservices support
continuous deployment?
• Each team can deploy their service when it is ready
without consultation with other teams.
• Since services are small, this can happen frequently
• New feature implementation in one service can be
deployed without waiting for that feature to be
implemented in other services.
• Requires architectural support – discussed in
lectures on deployment
© Len Bass 2019 17
Quality attributes
• Availability
• Modifiability
• Performance
• Reusability
• Scalability
© Len Bass 2019 18
Availability
• Availability is achieved using
• Multiple instances
• Timeouts to recognize failure
• Stateless instances
• If instances are stateless, when an
instance failure occurs a new instance
can be created and placed into service
© Len Bass 2019 19
Modifiability
• Modifiability depends on the design of the
various microservices.
• Low coupling and high cohesion are design
principles to achieve modifiability.
• Also, a catalog of microservices must be
maintained since there will be many
microservices and developers must be able
to understand how functionality is distributed
among them.
© Len Bass 2019 20
Performance
• Microservices are based on message passing.
• Network communication takes time.
• Important to measure and monitor
microservices to determine where time is spent
so that performance objectives can be met.
• Pods are means for improving performance
© Len Bass 2019 21
Reusability
Service
• Each user request is satisfied by
some sequence of services.
• Most services are not externally
available.
• Each service communicates with
other services through service
interfaces.
• Service depth may
– Shallow (large fan out)
– Deep (small fan out, more
dependent services)
© Len Bass 2019 22
Distinguish between coarse
grain and fine grain reuse
• Large microservices (coarse grained)
are built into architecture and reuse is
achieved by using these microservices
• Small microservices (fine grained) can
be designed for reuse (deep service
hierarchy) or reuse can be ignored at
this level (shallow service hierarchy)
© Len Bass 2019 23
Scalability
• Scaling out can be done by cloud
infrastructure
• Stateless microservices are easily
scaled since new instances can
automatically be placed into service.
© Len Bass 2019 24
Trade off
• Shallow hierarchy
• higher performance since fewer
messages,
• low reuse since each service is developed
by independent team with little coordination
• Deep hierarchy
• Lower performance since more messages
• Higher reuse since services can be
designed for multiple different clients.
© Len Bass 2019 25
Summary
• Microservice architecture consists of collection of
independently deployable services
• Microservices supports devops processes by
reducing need for communication among teams and
making technology choices independent
• Microservice architecture favors modifiability over
performance.
• Reuse can be achieved, if desired, by having deep
service hierarchy.
© Len Bass 2019 26
Overview
• Discovery
• Making requests in a distributed system
• Microservices and Containers
© Len Bass 2019 27
Discovery
• Discovery is the process of finding an IP
address of an instance of a microservice.
• Isn’t that what DNS and load balancers are
for?
• Yes, but …
© Len Bass 2019 28
Why not DNS + Load Balancer
• DNS assumes static IP addresses. So IP addresses
of load balancer is used
• Load balancer does not know the name of the
microservice it manages
• DNS + Load Balancer adds overhead.
• Recall that microservices inherently have overhead
from messages.
• Combining DNS and Load Balancer functions in
one place will reduce overhead.
© Len Bass 2019 29
Mid tier discovery service
• A mid tier discovery service is accessed with
a microservice name and returns an IP
address of an instance of that microservice
• The discovery service can be made version
aware to support deployment options
(discussed later)
© Len Bass 2019 30
Overview
• Discovery
• Making requests in a distributed system
• Microservices and Containers
© Len Bass 2019 31
Communication between two
microservices
• RPC (Remote Procedure Request).
• REST (REpresentational State
Transfer)
© Len Bass 2019 32
RPC
• RPC is a remote analog to traditional procedure calls.
• One procedure calls another with a set of typed
arguments, control is transferred to called
procedure, and called procedure may respond by
returning control
• Synchronous although multiple threads allow for
multiple simultaneous RPCs
• Assumes calling procedure knows address of called
procedure (no discovery)
© Len Bass 2019 33
gRPC
• gRPC is a binary version of RPC
• Used in conjunction with protocol
buffers (discussed shortly)
• Builds on HTTP 2.0
• Typically asynchronous
© Len Bass 2019 34
REST
• Can be used between arbitrary services
on the internet
• Designed for web services
© Len Bass 2019 35
REST Characteristics
• The requests are stateless. Every request
must contain all the information necessary to
act on that operation,
• The information exchanged is textual –
services and methods are accessed by
name.
• REST restricts methods to PUT, GET, POST,
and DELETE.
© Len Bass 2019 36
Structuring Data
• XML
• JSON
• Protocol Buffers
© Len Bass 2019 37
XML (Extensible Markup Language)
• XML = textual document + schema
• The schema provides tags to describe
how to interpret the document
• Tags are used to enclose fields just as
in HTML.
© Len Bass 2019 38
JSON (JavaScript Object Notation)
• Textual
• Each data item is designated by a
name and a value. E.g.
"addressCountry": "United States",
© Len Bass 2019 39
Protocol Buffers - 1
• Schema defines data types
• Binary format
• A protocol buffer specification is used to specify an
interface
• Language specific compilers used for each side of an
interface
• Allows different languages to communicate across a
message based interface
© Len Bass 2019 40
Protocol Buffers – 2
• Service A written in Java calls Service B written in C
• Interface specification written as .proto file
• Java protocol buffer compiler producers Java
procedure interface for Service A
• C protocol buffer compiler produces procedure
interface for Service B
• Service A code calls Java procedure interface which
sends binary data received by Service B procedure
(written in C)
© Len Bass 2019 41
Overview
• Discovery
• Making requests in a distributed system
• Microservices and Containers
© Len Bass 2019 42
Microservices and Containers
• Although microservices and containers were
developed independently, they are a natural fit and
are evolving together.
• A microservice will use a number of dependent
services. Common ones are:
• Metrics
• Logging
• Tracing
• Messaging
• gRPC
• Protocol buffers
• Discovery
• Registration
• Configuration
management
• Dashboards
• Alerts
© Len Bass 2019 43
Packaging microservices
• Each dependent service will be packaged in
its own containers.
• Containers can be grouped in pods
• Also called service mesh
• Allows for deploying and scaling together
© Len Bass 2019 44
Designing for Deployment
• It is possible that different versions of a single
microservice may simultaneously be in service
• It is possible that new features may be supported in
some microservices but not in others.
© Len Bass 2019 45
Forward and Backward Compatibility
• Microservices must be forward and backward
compatible to support interoperability
• Forward compatibility means that unknown
calls are treated gracefully since one service
may be assuming dependent services have
features that have not yet been deployed.
© Len Bass 2019 46
Achieving Backwards Compatibility
• APIs can be extended but must always be backward
compatible.
• Leads to a translation layer
External APIs (unchanging but with ability to
extend or add new ones)
Translation to internal APIs
Client Client
Internal APIs (changes require changes to
translation layer but do not propagate further)
© Len Bass 2019 47
Summary
• Mid tier discovery services combine functions of DNS and load
balancer
• RPC variants and REST are two methods for communicating
between services
• XML, JSON, Protocol Buffers are different ways of managing data
sent between two services.
• Microservices have a standard set of dependent services and pods
allow packing these services together for deployment and scaling.
• Deployment options introduce requirements to design
microservices for deployment

More Related Content

What's hot

Evolution of unix environments and the road to faster deployments
Evolution of unix environments and the road to faster deploymentsEvolution of unix environments and the road to faster deployments
Evolution of unix environments and the road to faster deployments
Rakuten Group, Inc.
 
DevCon13 System Administration Basics
DevCon13 System Administration BasicsDevCon13 System Administration Basics
DevCon13 System Administration Basicssysnickm
 
Developing Enterprise Applications for the Cloud, from Monolith to Microservice
Developing Enterprise Applications for the Cloud, from Monolith to MicroserviceDeveloping Enterprise Applications for the Cloud, from Monolith to Microservice
Developing Enterprise Applications for the Cloud, from Monolith to Microservice
Jack-Junjie Cai
 
[WSO2Con EU 2017] Jump to the Next Curve with DevOps
[WSO2Con EU 2017] Jump to the Next Curve with DevOps[WSO2Con EU 2017] Jump to the Next Curve with DevOps
[WSO2Con EU 2017] Jump to the Next Curve with DevOps
WSO2
 
SDN in the Public Cloud: Windows Azure
SDN in the Public Cloud: Windows AzureSDN in the Public Cloud: Windows Azure
SDN in the Public Cloud: Windows Azure
Open Networking Summits
 
Introductio to Docker and usage in HPC applications
Introductio to Docker and usage in HPC applicationsIntroductio to Docker and usage in HPC applications
Introductio to Docker and usage in HPC applications
Richie Varghese
 
Windows Azure: Scaling SDN in the Public Cloud
Windows Azure: Scaling SDN in the Public CloudWindows Azure: Scaling SDN in the Public Cloud
Windows Azure: Scaling SDN in the Public Cloud
Open Networking Summits
 
Multi-Cloud Global Server Load Balancing (GSLB)
Multi-Cloud Global Server Load Balancing (GSLB)Multi-Cloud Global Server Load Balancing (GSLB)
Multi-Cloud Global Server Load Balancing (GSLB)
Avi Networks
 
Chapter09
Chapter09Chapter09
Chapter09
Muhammad Ahad
 
Micro service architecture
Micro service architecture  Micro service architecture
Micro service architecture
Ayyappan Paramesh
 
itft_system admin
itft_system adminitft_system admin
itft_system admin
Swati Aggarwal
 
Cloud computing aws -key services
Cloud computing  aws -key servicesCloud computing  aws -key services
Cloud computing aws -key services
Selvaraj Kesavan
 
IBM MQ High Availabillity and Disaster Recovery (2017 version)
IBM MQ High Availabillity and Disaster Recovery (2017 version)IBM MQ High Availabillity and Disaster Recovery (2017 version)
IBM MQ High Availabillity and Disaster Recovery (2017 version)
MarkTaylorIBM
 
Latency - The King of the Mobile Experience
Latency - The King of the Mobile Experience Latency - The King of the Mobile Experience
Latency - The King of the Mobile Experience
WardTechTalent
 
Piyush Kumar Gupta
Piyush Kumar GuptaPiyush Kumar Gupta
Piyush Kumar GuptaPiyush Gupta
 
VMworld 2013: Successfully Virtualize Microsoft Exchange Server
VMworld 2013: Successfully Virtualize Microsoft Exchange Server VMworld 2013: Successfully Virtualize Microsoft Exchange Server
VMworld 2013: Successfully Virtualize Microsoft Exchange Server
VMworld
 
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
The Linux Foundation
 
Cloud stack for_beginners
Cloud stack for_beginnersCloud stack for_beginners
Cloud stack for_beginners
Radhika Puthiyetath
 
V mware thin app 4.5 what_s new presentation
V mware thin app 4.5 what_s new presentationV mware thin app 4.5 what_s new presentation
V mware thin app 4.5 what_s new presentation
solarisyourep
 

What's hot (20)

Evolution of unix environments and the road to faster deployments
Evolution of unix environments and the road to faster deploymentsEvolution of unix environments and the road to faster deployments
Evolution of unix environments and the road to faster deployments
 
Bluetube
BluetubeBluetube
Bluetube
 
DevCon13 System Administration Basics
DevCon13 System Administration BasicsDevCon13 System Administration Basics
DevCon13 System Administration Basics
 
Developing Enterprise Applications for the Cloud, from Monolith to Microservice
Developing Enterprise Applications for the Cloud, from Monolith to MicroserviceDeveloping Enterprise Applications for the Cloud, from Monolith to Microservice
Developing Enterprise Applications for the Cloud, from Monolith to Microservice
 
[WSO2Con EU 2017] Jump to the Next Curve with DevOps
[WSO2Con EU 2017] Jump to the Next Curve with DevOps[WSO2Con EU 2017] Jump to the Next Curve with DevOps
[WSO2Con EU 2017] Jump to the Next Curve with DevOps
 
SDN in the Public Cloud: Windows Azure
SDN in the Public Cloud: Windows AzureSDN in the Public Cloud: Windows Azure
SDN in the Public Cloud: Windows Azure
 
Introductio to Docker and usage in HPC applications
Introductio to Docker and usage in HPC applicationsIntroductio to Docker and usage in HPC applications
Introductio to Docker and usage in HPC applications
 
Windows Azure: Scaling SDN in the Public Cloud
Windows Azure: Scaling SDN in the Public CloudWindows Azure: Scaling SDN in the Public Cloud
Windows Azure: Scaling SDN in the Public Cloud
 
Multi-Cloud Global Server Load Balancing (GSLB)
Multi-Cloud Global Server Load Balancing (GSLB)Multi-Cloud Global Server Load Balancing (GSLB)
Multi-Cloud Global Server Load Balancing (GSLB)
 
Chapter09
Chapter09Chapter09
Chapter09
 
Micro service architecture
Micro service architecture  Micro service architecture
Micro service architecture
 
itft_system admin
itft_system adminitft_system admin
itft_system admin
 
Cloud computing aws -key services
Cloud computing  aws -key servicesCloud computing  aws -key services
Cloud computing aws -key services
 
IBM MQ High Availabillity and Disaster Recovery (2017 version)
IBM MQ High Availabillity and Disaster Recovery (2017 version)IBM MQ High Availabillity and Disaster Recovery (2017 version)
IBM MQ High Availabillity and Disaster Recovery (2017 version)
 
Latency - The King of the Mobile Experience
Latency - The King of the Mobile Experience Latency - The King of the Mobile Experience
Latency - The King of the Mobile Experience
 
Piyush Kumar Gupta
Piyush Kumar GuptaPiyush Kumar Gupta
Piyush Kumar Gupta
 
VMworld 2013: Successfully Virtualize Microsoft Exchange Server
VMworld 2013: Successfully Virtualize Microsoft Exchange Server VMworld 2013: Successfully Virtualize Microsoft Exchange Server
VMworld 2013: Successfully Virtualize Microsoft Exchange Server
 
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
 
Cloud stack for_beginners
Cloud stack for_beginnersCloud stack for_beginners
Cloud stack for_beginners
 
V mware thin app 4.5 what_s new presentation
V mware thin app 4.5 what_s new presentationV mware thin app 4.5 what_s new presentation
V mware thin app 4.5 what_s new presentation
 

Similar to 6 microservice architecture

Microservice's in detailed
Microservice's in detailedMicroservice's in detailed
Microservice's in detailed
Mohammed Fazuluddin
 
6. Microservices architecture.pptx
6. Microservices architecture.pptx6. Microservices architecture.pptx
6. Microservices architecture.pptx
datapro2
 
Developing Enterprise Applications for the Cloud, from Monolith to Microservices
Developing Enterprise Applications for the Cloud,from Monolith to MicroservicesDeveloping Enterprise Applications for the Cloud,from Monolith to Microservices
Developing Enterprise Applications for the Cloud, from Monolith to Microservices
David Currie
 
MICROSERVICES ARCHITECTURE unit -2.pptx
MICROSERVICES ARCHITECTURE unit -2.pptxMICROSERVICES ARCHITECTURE unit -2.pptx
MICROSERVICES ARCHITECTURE unit -2.pptx
MohammedShahid562503
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
MahmoudZidan41
 
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
PINGXIONG3
 
Microservices in Action
Microservices in ActionMicroservices in Action
Microservices in Action
Bhagwat Kumar
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO Forum
Rick Hightower
 
SOA
SOASOA
The Overview of Microservices Architecture
The Overview of Microservices ArchitectureThe Overview of Microservices Architecture
The Overview of Microservices Architecture
Paria Heidari
 
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
VMware Tanzu
 
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.
 
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.
 
Microservices: The Right Way
Microservices: The Right WayMicroservices: The Right Way
Microservices: The Right Way
Daniel Woods
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service Architecture
Linjith Kunnon
 
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
 
Chapter 1 & 2 - Introduction-to-Cloud-Computing.pptx
Chapter 1 & 2 - Introduction-to-Cloud-Computing.pptxChapter 1 & 2 - Introduction-to-Cloud-Computing.pptx
Chapter 1 & 2 - Introduction-to-Cloud-Computing.pptx
haileysuszelalem
 
Microservice intro
Microservice introMicroservice intro
Microservice intro
ramesh_sharma
 
Microservices
MicroservicesMicroservices
Microservices
Prasanna Venkatesan
 
Serverless microservices
Serverless microservicesServerless microservices
Serverless microservices
Lalit Kale
 

Similar to 6 microservice architecture (20)

Microservice's in detailed
Microservice's in detailedMicroservice's in detailed
Microservice's in detailed
 
6. Microservices architecture.pptx
6. Microservices architecture.pptx6. Microservices architecture.pptx
6. Microservices architecture.pptx
 
Developing Enterprise Applications for the Cloud, from Monolith to Microservices
Developing Enterprise Applications for the Cloud,from Monolith to MicroservicesDeveloping Enterprise Applications for the Cloud,from Monolith to Microservices
Developing Enterprise Applications for the Cloud, from Monolith to Microservices
 
MICROSERVICES ARCHITECTURE unit -2.pptx
MICROSERVICES ARCHITECTURE unit -2.pptxMICROSERVICES ARCHITECTURE unit -2.pptx
MICROSERVICES ARCHITECTURE unit -2.pptx
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
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 in Action
Microservices in ActionMicroservices in Action
Microservices in Action
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO Forum
 
SOA
SOASOA
SOA
 
The Overview of Microservices Architecture
The Overview of Microservices ArchitectureThe Overview of Microservices Architecture
The Overview of Microservices Architecture
 
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
 
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.
 
Do You Need A Service Mesh?
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?
 
Microservices: The Right Way
Microservices: The Right WayMicroservices: The Right Way
Microservices: The Right Way
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service Architecture
 
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
 
Chapter 1 & 2 - Introduction-to-Cloud-Computing.pptx
Chapter 1 & 2 - Introduction-to-Cloud-Computing.pptxChapter 1 & 2 - Introduction-to-Cloud-Computing.pptx
Chapter 1 & 2 - Introduction-to-Cloud-Computing.pptx
 
Microservice intro
Microservice introMicroservice intro
Microservice intro
 
Microservices
MicroservicesMicroservices
Microservices
 
Serverless microservices
Serverless microservicesServerless microservices
Serverless microservices
 

More from Len Bass

Devops syllabus
Devops syllabusDevops syllabus
Devops syllabus
Len Bass
 
DevOps Syllabus summer 2020
DevOps Syllabus summer 2020DevOps Syllabus summer 2020
DevOps Syllabus summer 2020
Len Bass
 
10 disaster recovery
10 disaster recovery  10 disaster recovery
10 disaster recovery
Len Bass
 
8 pipeline
8 pipeline 8 pipeline
8 pipeline
Len Bass
 
Quantum talk
Quantum talkQuantum talk
Quantum talk
Len Bass
 
Icsa2018 blockchain tutorial
Icsa2018 blockchain tutorialIcsa2018 blockchain tutorial
Icsa2018 blockchain tutorial
Len Bass
 
Experience in teaching devops
Experience in teaching devopsExperience in teaching devops
Experience in teaching devops
Len Bass
 
Understanding blockchains
Understanding blockchainsUnderstanding blockchains
Understanding blockchains
Len Bass
 
What is a blockchain
What is a blockchainWhat is a blockchain
What is a blockchain
Len Bass
 
Dev ops and safety critical systems
Dev ops and safety critical systemsDev ops and safety critical systems
Dev ops and safety critical systems
Len Bass
 
My first deployment pipeline
My first deployment pipelineMy first deployment pipeline
My first deployment pipeline
Len Bass
 
Packaging tool options
Packaging tool optionsPackaging tool options
Packaging tool options
Len Bass
 
Introduction to dev ops
Introduction to dev opsIntroduction to dev ops
Introduction to dev opsLen Bass
 
Securing deployment pipeline
Securing deployment pipelineSecuring deployment pipeline
Securing deployment pipelineLen Bass
 
Deployability
DeployabilityDeployability
Deployability
Len Bass
 
Architecture for the cloud deployment case study future
Architecture for the cloud deployment case study futureArchitecture for the cloud deployment case study future
Architecture for the cloud deployment case study future
Len Bass
 
Architecting for the cloud cloud providers
Architecting for the cloud cloud providersArchitecting for the cloud cloud providers
Architecting for the cloud cloud providers
Len Bass
 
Architecting for the cloud storage build test
Architecting for the cloud storage build testArchitecting for the cloud storage build test
Architecting for the cloud storage build test
Len Bass
 
Architecting for the cloud map reduce creating
Architecting for the cloud   map reduce creatingArchitecting for the cloud   map reduce creating
Architecting for the cloud map reduce creating
Len Bass
 
Architecting for the cloud storage misc topics
Architecting for the cloud storage misc topicsArchitecting for the cloud storage misc topics
Architecting for the cloud storage misc topics
Len Bass
 

More from Len Bass (20)

Devops syllabus
Devops syllabusDevops syllabus
Devops syllabus
 
DevOps Syllabus summer 2020
DevOps Syllabus summer 2020DevOps Syllabus summer 2020
DevOps Syllabus summer 2020
 
10 disaster recovery
10 disaster recovery  10 disaster recovery
10 disaster recovery
 
8 pipeline
8 pipeline 8 pipeline
8 pipeline
 
Quantum talk
Quantum talkQuantum talk
Quantum talk
 
Icsa2018 blockchain tutorial
Icsa2018 blockchain tutorialIcsa2018 blockchain tutorial
Icsa2018 blockchain tutorial
 
Experience in teaching devops
Experience in teaching devopsExperience in teaching devops
Experience in teaching devops
 
Understanding blockchains
Understanding blockchainsUnderstanding blockchains
Understanding blockchains
 
What is a blockchain
What is a blockchainWhat is a blockchain
What is a blockchain
 
Dev ops and safety critical systems
Dev ops and safety critical systemsDev ops and safety critical systems
Dev ops and safety critical systems
 
My first deployment pipeline
My first deployment pipelineMy first deployment pipeline
My first deployment pipeline
 
Packaging tool options
Packaging tool optionsPackaging tool options
Packaging tool options
 
Introduction to dev ops
Introduction to dev opsIntroduction to dev ops
Introduction to dev ops
 
Securing deployment pipeline
Securing deployment pipelineSecuring deployment pipeline
Securing deployment pipeline
 
Deployability
DeployabilityDeployability
Deployability
 
Architecture for the cloud deployment case study future
Architecture for the cloud deployment case study futureArchitecture for the cloud deployment case study future
Architecture for the cloud deployment case study future
 
Architecting for the cloud cloud providers
Architecting for the cloud cloud providersArchitecting for the cloud cloud providers
Architecting for the cloud cloud providers
 
Architecting for the cloud storage build test
Architecting for the cloud storage build testArchitecting for the cloud storage build test
Architecting for the cloud storage build test
 
Architecting for the cloud map reduce creating
Architecting for the cloud   map reduce creatingArchitecting for the cloud   map reduce creating
Architecting for the cloud map reduce creating
 
Architecting for the cloud storage misc topics
Architecting for the cloud storage misc topicsArchitecting for the cloud storage misc topics
Architecting for the cloud storage misc topics
 

Recently uploaded

How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 

Recently uploaded (20)

How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 

6 microservice architecture

  • 1. DOSE: Deployment and Operations for Software Engineers Microservice Architecture
  • 2. © Len Bass 2019 2 Overview • Definition • Microservices and DevOps • Quality attributes
  • 3. © Len Bass 2019 3 Definition • A microservice architecture is • A collection of independently deployable processes • Packaged as services • Communicating only via messages
  • 4. © Len Bass 2019 4 ~2002 Amazon instituted the following design rules - 1 • All teams will henceforth expose their data and functionality through service interfaces. • Teams must communicate with each other through these interfaces. • There will be no other form of inter-process communication allowed: no direct linking, no direct reads of another team’s data store, no shared-memory model, no back-doors whatsoever. The only communication allowed is via service interface calls over the network.
  • 5. © Len Bass 2019 5 Amazon design rules - 2 • It doesn’t matter what technology they[services] use. • All service interfaces, without exception, must be designed from the ground up to be externalizable. • Amazon is providing the specifications for the “Microservice Architecture”.
  • 6. © Len Bass 2019 6 In Addition • Amazon has a “two pizza” rule. • No team should be larger than can be fed with two pizzas (~7 members). • Each (micro) service is the responsibility of one team • This means that microservices are small and intra team bandwidth is high • Large systems are made up of many microservices. • There may be as many as 140 in a typical Amazon page.
  • 7. © Len Bass 2019 7 Services can have multiple instances • The elasticity of the cloud will adjust the number of instances of each service to reflect the workload. • Requests are routed through a load balancer for each service • This leads to • Lots of load balancers • Overhead for each request.
  • 8. © Len Bass 2019 8 Digression into Service Oriented Architecture (SOA) • The definition of microservice architecture sounds a lot like SOA. • What is the difference? • Amazon did not use the term “microservice architecture” when they introduced their rules. They said “this is SOA done right”
  • 9. © Len Bass 2019 9 SOA typically has but microservice architecture does not • Enterprise service bus • Elaborate protocols for sending messages to services (WDSL*) • Each service may be under the control of different organization • Brokers • etc
  • 10. © Len Bass 2019 10 Micro service architecture Service • Each user request is satisfied by some sequence of services. • Most services are not externally available. • Each service communicates with other services through service interfaces. • Service depth may – Shallow (large fan out) – Deep (small fan out, more dependent services)
  • 11. © Len Bass 2019 11 Microservice architecture supports DevOps processes • Reduces need for coordination • Reduces pipeline errors • Supports continuous deployment
  • 12. © Len Bass 2019 12 How does microservice architecture reduce requirements for coordination? • Coordination decisions can be made • incrementally as system evolves or • be built into the architecture. • Microservice architecture builds most coordination decisions into architecture • Consequently they only need to be made once for a system, not once per release.
  • 13. © Len Bass 2019 13 Seven Decision Categories • Architectures can be categorized by means of seven categories 1. Allocation of functionality 2. Coordination model 3. Data model 4. Management of resources 5. Mapping among architectural elements 6. Binding time decisions 7. Technology choices
  • 14. © Len Bass 2019 14 Design decisions with microservicess • Microservice architecture either specifies or delegates to the development team five out of the seven categories of design decisions. 1. Allocation of responsibilities. 2. Coordination model. 3. Data model. 4. Management of resources. 5. Mapping among architectural elements. 6. Binding time decisions. 7. Choice of technology
  • 15. © Len Bass 2019 15 How do microservices reduce pipeline errors? • Many integration errors are caused by incompatibilities. • Each team makes its own technology choices for their services. This reduces errors during integration • No problems with inconsistent versions of dependent software • No problems with language choices
  • 16. © Len Bass 2019 16 How do microservices support continuous deployment? • Each team can deploy their service when it is ready without consultation with other teams. • Since services are small, this can happen frequently • New feature implementation in one service can be deployed without waiting for that feature to be implemented in other services. • Requires architectural support – discussed in lectures on deployment
  • 17. © Len Bass 2019 17 Quality attributes • Availability • Modifiability • Performance • Reusability • Scalability
  • 18. © Len Bass 2019 18 Availability • Availability is achieved using • Multiple instances • Timeouts to recognize failure • Stateless instances • If instances are stateless, when an instance failure occurs a new instance can be created and placed into service
  • 19. © Len Bass 2019 19 Modifiability • Modifiability depends on the design of the various microservices. • Low coupling and high cohesion are design principles to achieve modifiability. • Also, a catalog of microservices must be maintained since there will be many microservices and developers must be able to understand how functionality is distributed among them.
  • 20. © Len Bass 2019 20 Performance • Microservices are based on message passing. • Network communication takes time. • Important to measure and monitor microservices to determine where time is spent so that performance objectives can be met. • Pods are means for improving performance
  • 21. © Len Bass 2019 21 Reusability Service • Each user request is satisfied by some sequence of services. • Most services are not externally available. • Each service communicates with other services through service interfaces. • Service depth may – Shallow (large fan out) – Deep (small fan out, more dependent services)
  • 22. © Len Bass 2019 22 Distinguish between coarse grain and fine grain reuse • Large microservices (coarse grained) are built into architecture and reuse is achieved by using these microservices • Small microservices (fine grained) can be designed for reuse (deep service hierarchy) or reuse can be ignored at this level (shallow service hierarchy)
  • 23. © Len Bass 2019 23 Scalability • Scaling out can be done by cloud infrastructure • Stateless microservices are easily scaled since new instances can automatically be placed into service.
  • 24. © Len Bass 2019 24 Trade off • Shallow hierarchy • higher performance since fewer messages, • low reuse since each service is developed by independent team with little coordination • Deep hierarchy • Lower performance since more messages • Higher reuse since services can be designed for multiple different clients.
  • 25. © Len Bass 2019 25 Summary • Microservice architecture consists of collection of independently deployable services • Microservices supports devops processes by reducing need for communication among teams and making technology choices independent • Microservice architecture favors modifiability over performance. • Reuse can be achieved, if desired, by having deep service hierarchy.
  • 26. © Len Bass 2019 26 Overview • Discovery • Making requests in a distributed system • Microservices and Containers
  • 27. © Len Bass 2019 27 Discovery • Discovery is the process of finding an IP address of an instance of a microservice. • Isn’t that what DNS and load balancers are for? • Yes, but …
  • 28. © Len Bass 2019 28 Why not DNS + Load Balancer • DNS assumes static IP addresses. So IP addresses of load balancer is used • Load balancer does not know the name of the microservice it manages • DNS + Load Balancer adds overhead. • Recall that microservices inherently have overhead from messages. • Combining DNS and Load Balancer functions in one place will reduce overhead.
  • 29. © Len Bass 2019 29 Mid tier discovery service • A mid tier discovery service is accessed with a microservice name and returns an IP address of an instance of that microservice • The discovery service can be made version aware to support deployment options (discussed later)
  • 30. © Len Bass 2019 30 Overview • Discovery • Making requests in a distributed system • Microservices and Containers
  • 31. © Len Bass 2019 31 Communication between two microservices • RPC (Remote Procedure Request). • REST (REpresentational State Transfer)
  • 32. © Len Bass 2019 32 RPC • RPC is a remote analog to traditional procedure calls. • One procedure calls another with a set of typed arguments, control is transferred to called procedure, and called procedure may respond by returning control • Synchronous although multiple threads allow for multiple simultaneous RPCs • Assumes calling procedure knows address of called procedure (no discovery)
  • 33. © Len Bass 2019 33 gRPC • gRPC is a binary version of RPC • Used in conjunction with protocol buffers (discussed shortly) • Builds on HTTP 2.0 • Typically asynchronous
  • 34. © Len Bass 2019 34 REST • Can be used between arbitrary services on the internet • Designed for web services
  • 35. © Len Bass 2019 35 REST Characteristics • The requests are stateless. Every request must contain all the information necessary to act on that operation, • The information exchanged is textual – services and methods are accessed by name. • REST restricts methods to PUT, GET, POST, and DELETE.
  • 36. © Len Bass 2019 36 Structuring Data • XML • JSON • Protocol Buffers
  • 37. © Len Bass 2019 37 XML (Extensible Markup Language) • XML = textual document + schema • The schema provides tags to describe how to interpret the document • Tags are used to enclose fields just as in HTML.
  • 38. © Len Bass 2019 38 JSON (JavaScript Object Notation) • Textual • Each data item is designated by a name and a value. E.g. "addressCountry": "United States",
  • 39. © Len Bass 2019 39 Protocol Buffers - 1 • Schema defines data types • Binary format • A protocol buffer specification is used to specify an interface • Language specific compilers used for each side of an interface • Allows different languages to communicate across a message based interface
  • 40. © Len Bass 2019 40 Protocol Buffers – 2 • Service A written in Java calls Service B written in C • Interface specification written as .proto file • Java protocol buffer compiler producers Java procedure interface for Service A • C protocol buffer compiler produces procedure interface for Service B • Service A code calls Java procedure interface which sends binary data received by Service B procedure (written in C)
  • 41. © Len Bass 2019 41 Overview • Discovery • Making requests in a distributed system • Microservices and Containers
  • 42. © Len Bass 2019 42 Microservices and Containers • Although microservices and containers were developed independently, they are a natural fit and are evolving together. • A microservice will use a number of dependent services. Common ones are: • Metrics • Logging • Tracing • Messaging • gRPC • Protocol buffers • Discovery • Registration • Configuration management • Dashboards • Alerts
  • 43. © Len Bass 2019 43 Packaging microservices • Each dependent service will be packaged in its own containers. • Containers can be grouped in pods • Also called service mesh • Allows for deploying and scaling together
  • 44. © Len Bass 2019 44 Designing for Deployment • It is possible that different versions of a single microservice may simultaneously be in service • It is possible that new features may be supported in some microservices but not in others.
  • 45. © Len Bass 2019 45 Forward and Backward Compatibility • Microservices must be forward and backward compatible to support interoperability • Forward compatibility means that unknown calls are treated gracefully since one service may be assuming dependent services have features that have not yet been deployed.
  • 46. © Len Bass 2019 46 Achieving Backwards Compatibility • APIs can be extended but must always be backward compatible. • Leads to a translation layer External APIs (unchanging but with ability to extend or add new ones) Translation to internal APIs Client Client Internal APIs (changes require changes to translation layer but do not propagate further)
  • 47. © Len Bass 2019 47 Summary • Mid tier discovery services combine functions of DNS and load balancer • RPC variants and REST are two methods for communicating between services • XML, JSON, Protocol Buffers are different ways of managing data sent between two services. • Microservices have a standard set of dependent services and pods allow packing these services together for deployment and scaling. • Deployment options introduce requirements to design microservices for deployment