SlideShare a Scribd company logo
Reactive Microservices
Auxenta Tech Talk ­ February 2019
Crishantha Nanayakkara
(@crishantha)
Source: microservcies.io
Evolution of the Enterprise
Evolution of the Enterprise
●
Today’s applications are deployed to 
everything from mobile devices to cloud based 
clusters running thousands multi­core 
processes. 
●
Users expect milliseconds response times and 
close to 100 percent uptime. 
●
Traditional architectures simply won’t cut 
anymore. 
Platform 1.0Platform 1.0Platform 1.0Platform 1.0
Platform 2.0Platform 2.0Platform 2.0Platform 2.0
Platform 3.0Platform 3.0Platform 3.0Platform 3.0
(1980s to 1990s)
(2000 ­ 2010)
(2010 onwards)
Reference: Microservices: The resurgence of SOA principles and an alternative to the monolith (PWC)
Monolithic / SOA / Microservices
A Recap – March 2017
A Recap – [Patterns Covered]
Aggregation
Chaining
Branching
Platform 1.0Platform 1.0
(Monolithic)(Monolithic)
Platform 1.0Platform 1.0
(Monolithic)(Monolithic)
Platform 2.0Platform 2.0
(SOA)(SOA)
Platform 2.0Platform 2.0
(SOA)(SOA)
Platform 3.0Platform 3.0
(Microservices)(Microservices)
Platform 3.0Platform 3.0
(Microservices)(Microservices)
(1980s to 1990s)
(2000 ­ 2010)
(2010 onwards)
Platform 4.0Platform 4.0
(Fast Data)(Fast Data)
Platform 4.0Platform 4.0
(Fast Data)(Fast Data)
(The Future)
Moving Towards Fast Data
Key Features Microservices
Isolation
●
Isolation is the most important feature in MSA
●
Involves independent and the complete control 
of the resource.
●
Bounded Context – Domain Driven Design
Autonomy
●
Takes the full responsibility of the service.
●
The services can be changed with no or 
minimal impact to other services.
● Isolation is a prerequisite for Autonomy
●
The maximum autonomy happens with event­
based inter service communications.
Single Responsibility Principle (SRP)
●
The scope of the service responsibility has only 
one reason to change
●
“Lets do one thing and do it well” (The Unix 
philosophy)
●
“micro” = scope of responsibility 
State
State
● Microservices need to own their state 
exclusively
●
The data is strongly consistent within the 
microservice
●
The data is eventually consistent between 
microservices
Mobility
● Mobility is the possibility of moving services 
around at runtime while they are being used.
●
The container technologies are basically 
making this a possibility
Source: Reactive Microsystems [1] [Book]
Source: Reactive Microsystems [1] [Book]
Source: Reactive Microsystems [1] [Book]
Source: Reactive Microsystems [1] [Book]
The Reactive Manifesto
Reactive?
Why Reactive Manifesto?
The  application  requirements  have  changed 
dramatically over the years. 
Only  a  few  years  ago  a  large  application  had  tens  of 
servers,  seconds  of  response  time,  hours  of  off­line 
maintenance and gigabytes of data. 
Today  applications  are  deployed  on  everything  from 
mobile  devices  to  cloud­based  clusters  running 
thousands of multi­core processors. 
Users  expect  millisecond  response  times  and  100% 
uptime.  Data  is  measured  in  Petabytes.  Today's 
demands  are  simply  not  met  by  yesterday’s  software 
architectures
The Reactive Manifesto
The Reactive Manifesto
Responsive: 
Responsive  systems  focus  on  providing  rapid  and 
consistent  response  times,  establishing  reliable  upper 
bounds so they deliver a consistent quality of service.
Resilient:
The  system  stays  responsive  in  the  face  of  failure. 
Failures  are  contained  within  each  component, 
isolating  components  from  each  other  and  thereby 
ensuring that parts of the system can fail and recover 
without compromising the system as a whole.
The Reactive Manifesto
Elastic:
The  system  stays  responsive  under  varying  workload. 
Reactive Systems can react to changes in the input rate 
by increasing or decreasing the resources allocated to 
service  these  inputs.  the  ability  to  shard  or  replicate 
components and distribute inputs among them
The Reactive Manifesto
Message Driven:
Reactive  Systems  rely  on  asynchronous  message­
passing  to  establish  a  boundary  between  components 
that  ensures  loose  coupling,  isolation  and  location 
transparency.
SOA vs Microservices
What makes Microservices interesting is that this architecture has 
learned  from  the  failures  and  successes  of  SOA,  kept  the  good 
ideas, and rearchitected them from the ground up using Reactive 
principles and modern infrastructure. 
So.. What is a Microservice?
In  summary,  we  have  characterized  Microservices  as  a  set  of 
isolated  services,  each  one  with  a  single  area  of  responsibility. 
This forms the basis for being able to treat each service as a single 
unit  that  lives  and  dies  in  isolation  a  prerequisite  for  resilience 
and can be moved around in isolation a prerequisite for elasticity.
Inter Service Communication
Communication between microservices needs to be based on 
Asynchronous Message Passing / Non Blocking I/O.
Inter Service Communication
Blocking I/O Non Blocking I/O
REST for inter service communication?
It is unfortunate that REST is widely considered as the default 
inter­service microservice communication protocol.
REST might be a reasonable option when there will only ever be a 
handful of services, or in situations between specific tightly 
coupled services.
But use it sparingly, outside the regular request/response 
cycle, knowing that it is always at the expense of decoupling, 
system evolution, scale and availability.
Sharding
Source: https://microservices.io/articles/scalecube.html
Polygot Persistence
Source: https://martinfowler.com/bliki/PolyglotPersistence.html
Microservices applications often use a mixture of Relational and 
NOSQL databases. 
Distributed Database Management
The Challenges:
1.  Implementing  business  transactions  that  maintain  consistency 
across multiple services.
2.  How  to  implement  queries  that  retrieve  data  from  multiple 
services with multiple data sources (polygot persistence)
The Solution? 
Event Driven Architecture (Event Logging/ Event Sourcing)
Event Logs / Event Sourcing
Event Logs / Event Sourcing
(Fast Data Frameworks/ Platforms)
Event Logs / Event Sourcing
Back Pressure
Source: Lightbend
The back­pressure may cascade all the way up to the user, at 
which point responsiveness may degrade, but this mechanism 
will  ensure  that  the  system  is  resilient  under  load,  and  will 
provide information that may allow the system itself to apply 
other resources to help distribute the load. (i.e elasticity).
Circuit Breaker Pattern
A circuit breaker is used to provide stability and prevent cascading 
failures in distributed systems.
These  should  be  used  in  conjunction  with  timeouts  at  the  interfaces 
between  remote  systems  to  prevent  the  failure  of  a  single  component 
from bringing down all components.
Introducing  circuit  breakers  on  the  web  service  call  would  cause  the 
requests  to  begin  to  fail­fast,  letting  the  user  know  that  something  is 
wrong and that they need not refresh their request.
Saga Pattern
The  distributed  Saga  Pattern  is  a  pattern  for  managing  failures, 
where each action has a compensating action for rollback
References
Reactive  Microservices  Architecture:  Design  Principles  for 
Distributed Systems, Jonas Bonér, Orielly 
Reactive Manifesto : https://www.reactivemanifesto.org/
The  art  of  scalability  (2nd
  edition),  Martin  L.  Abbott  and 
Michael T. Fisher
Event  driven  data  management  for  Microservices: 
https://www.nginx.com/blog/event­driven­data­management
­microservices/
Event  Sourcing  with  Kafka: 
https://dzone.com/articles/event­sourcing­with­kafka 
Thank YouThank You
Crishantha NanayakkaraCrishantha Nanayakkara
Twitter: @crishanthaTwitter: @crishantha
Web Site: Web Site: www.crishantha.comwww.crishantha.com
LinkedIn: http://linkedin.com/in/crishanthaLinkedIn: http://linkedin.com/in/crishantha

More Related Content

KEY
Event Driven Architecture
PDF
Introduction to Event-Driven Architecture
PPTX
Microservice vs. Monolithic Architecture
PDF
Event Driven Architecture
KEY
Event Driven Architecture
PDF
Event Driven-Architecture from a Scalability perspective
PPTX
Microservices Part 3 Service Mesh and Kafka
PDF
Why Microservice
Event Driven Architecture
Introduction to Event-Driven Architecture
Microservice vs. Monolithic Architecture
Event Driven Architecture
Event Driven Architecture
Event Driven-Architecture from a Scalability perspective
Microservices Part 3 Service Mesh and Kafka
Why Microservice

What's hot (20)

PDF
Microservices in Practice
PPTX
Microservice's in detailed
PPTX
Multi Tenancy In The Cloud
PPTX
Introduction to microservices
PDF
MSMQ - Microsoft Message Queueing
PPTX
Intro to Azure Service Bus
PDF
Kinh nghiệm triển khai Microservices tại Sapo.vn
PPTX
Microsoft azure
PPTX
Cloud Reference Architecture - Part 1 Foundation
PPTX
Cloud Based Disaster Recovery (DRaaS)
PDF
Virtual meetup - Exploring the Runtime Fabric deployment model
PDF
8 - OpenShift - A look at a container platform: what's in the box
PPTX
Load balancing in cloud computing.pptx
PDF
Microservice Architecture
PPTX
Microservice architecture design principles
PDF
Microsoft Azure - Introduction to microsoft's public cloud
PPTX
Introduction to Microservices
PDF
Microservice Architecture Patterns, by Richard Langlois P. Eng.
PPTX
Introduction to microservices
PDF
Resource replication in cloud computing.
Microservices in Practice
Microservice's in detailed
Multi Tenancy In The Cloud
Introduction to microservices
MSMQ - Microsoft Message Queueing
Intro to Azure Service Bus
Kinh nghiệm triển khai Microservices tại Sapo.vn
Microsoft azure
Cloud Reference Architecture - Part 1 Foundation
Cloud Based Disaster Recovery (DRaaS)
Virtual meetup - Exploring the Runtime Fabric deployment model
8 - OpenShift - A look at a container platform: what's in the box
Load balancing in cloud computing.pptx
Microservice Architecture
Microservice architecture design principles
Microsoft Azure - Introduction to microsoft's public cloud
Introduction to Microservices
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Introduction to microservices
Resource replication in cloud computing.
Ad

Similar to Reactive Microservices (20)

PDF
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
PDF
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
PPTX
05 microservices microdeck
PDF
Building a High-Performance Reactive Microservices Architecture
PDF
1BT_Designing_Microservices
PDF
What are the Advantages and Disadvantages of Microservices?
PDF
Microservices vs. Monolithic Architecture.pdf
PDF
Microservices in the Enterprise: A Research Study and Reference Architecture
PDF
[WSO2 API Day Dallas 2019] Extending Service Mesh with API Management
PDF
Whitepaper : Microservices In or Out
PDF
PDF
microservices interview and questions by scholarhat.pdf
PDF
Tech Talk on Microservices at Squareboat
PDF
Basics of Java Microservices: Frameworks, Examples & Use Cases
PDF
Microservices Design Principles.pdf
PDF
A Guide on What Are Microservices: Pros, Cons, Use Cases, and More
PPTX
Microservices: A Step Towards Modernizing Healthcare Applications
PDF
Oracle Code Sydney - There is no such thing as a microservice!
PPTX
Building cloud-ready Microservices
PPTX
Microservices architecture
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
05 microservices microdeck
Building a High-Performance Reactive Microservices Architecture
1BT_Designing_Microservices
What are the Advantages and Disadvantages of Microservices?
Microservices vs. Monolithic Architecture.pdf
Microservices in the Enterprise: A Research Study and Reference Architecture
[WSO2 API Day Dallas 2019] Extending Service Mesh with API Management
Whitepaper : Microservices In or Out
microservices interview and questions by scholarhat.pdf
Tech Talk on Microservices at Squareboat
Basics of Java Microservices: Frameworks, Examples & Use Cases
Microservices Design Principles.pdf
A Guide on What Are Microservices: Pros, Cons, Use Cases, and More
Microservices: A Step Towards Modernizing Healthcare Applications
Oracle Code Sydney - There is no such thing as a microservice!
Building cloud-ready Microservices
Microservices architecture
Ad

More from Crishantha Nanayakkara (20)

PDF
Sri Lanka Government Enterprise Architecture
PDF
Application Deployement Strategies
PDF
Azure for AWS Developers
PDF
Enterprise Integration in Cloud Native Microservices Architectures
PDF
AWS Systems Manager
PDF
AWS Big Data Landscape
PDF
1BT_Tech_Talk_AWS_Cross_Account_Access
PDF
AWS Security Hub
PDF
Resiilient Architectures on AWS
PDF
Expectaions in IT industry
PDF
Towards Cloud Enabled Data Intensive Digital Transformation
PDF
Container Architecture
PDF
Domain Driven Design and Hexagonal Architecture
PDF
Microservices
PDF
Enterprise architecture in the current e-Government context in Sri Lanka
PDF
Modern Trends in IT
PDF
ICTA Meetup 12 - Message Brokers
PDF
ICTA Meetup 11 - Big Data
PDF
Lanka Gate Core Components - Government CIO Workshop Dec 2013
PDF
ICTA Technology Meetup 06 - Enterprise Application Design Patterns
Sri Lanka Government Enterprise Architecture
Application Deployement Strategies
Azure for AWS Developers
Enterprise Integration in Cloud Native Microservices Architectures
AWS Systems Manager
AWS Big Data Landscape
1BT_Tech_Talk_AWS_Cross_Account_Access
AWS Security Hub
Resiilient Architectures on AWS
Expectaions in IT industry
Towards Cloud Enabled Data Intensive Digital Transformation
Container Architecture
Domain Driven Design and Hexagonal Architecture
Microservices
Enterprise architecture in the current e-Government context in Sri Lanka
Modern Trends in IT
ICTA Meetup 12 - Message Brokers
ICTA Meetup 11 - Big Data
Lanka Gate Core Components - Government CIO Workshop Dec 2013
ICTA Technology Meetup 06 - Enterprise Application Design Patterns

Recently uploaded (20)

PPTX
OOP with Java - Java Introduction (Basics)
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
web development for engineering and engineering
PPTX
additive manufacturing of ss316l using mig welding
PDF
Well-logging-methods_new................
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Digital Logic Computer Design lecture notes
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
DOCX
573137875-Attendance-Management-System-original
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
composite construction of structures.pdf
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPT
Mechanical Engineering MATERIALS Selection
PPTX
UNIT 4 Total Quality Management .pptx
OOP with Java - Java Introduction (Basics)
Structs to JSON How Go Powers REST APIs.pdf
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
web development for engineering and engineering
additive manufacturing of ss316l using mig welding
Well-logging-methods_new................
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Digital Logic Computer Design lecture notes
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
573137875-Attendance-Management-System-original
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Lesson 3_Tessellation.pptx finite Mathematics
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
composite construction of structures.pdf
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Model Code of Practice - Construction Work - 21102022 .pdf
Mechanical Engineering MATERIALS Selection
UNIT 4 Total Quality Management .pptx

Reactive Microservices