empowering digital transformation with microservices€¦ · what are microservices monolith vs...

Post on 07-Jun-2020

32 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

EMPOWERING DIGITAL TRANSFORMATION WITH MICROSERVICES

AGENDA

Intro

What is Digital transformation

Why Digital transformation

What are Microservices

Monolith vs Microservices

Use Case Microservices solution & Best practices

Q & A

Dave Chen

Principal Software Engineer

CASA MILÀ

LA SAGRADA FAMÍLIA • Under Construction

for Over a Century

• Antoni Gaudí

• Passion

• Dedication

• Hard work

• Construction is now

accelerated by 3-D

Printing Technology

WHAT IS DIGITAL TRANFORMATION

Digital Transformation (DT or DX) is the use of new, fast and

frequently changing digital technology to solve problems

often utilizing cloud computing, reducing reliance on user

owned hardware but increasing reliance on subscription

based cloud services. Some of these digital solutions enhance

capabilities of traditional software products (e.g. Microsoft

Office compared to Office 365) whilst others are entirely

cloud based (e.g. Google Docs).

Source: https://en.wikipedia.org/wiki/Digital_transformation

VISION ORGANIZATION CUSTOMER INSIGHT TECHNOLOGY

DIGITAL TRANSFORMATION

DIGITAL TRANSFORMATION PLAYERS:

Reset customer experience and disrupted industries.

WHY DIGITAL TRANSFORMATION

SO WHAT IS THE LESSON HERE:

IT’S ABOUT FAILURE TO CHANGE

WE NEED SOMETHING TO HELP WITH THE CHANGE SPEED & AGILITY DRIVE INNOVATION AND GROWTH

Continuous delivery through Agile development

Seamless workload portability based on need at any point of the time

Collaborative innovations on top of enterprise system

Secure interaction across on premise IT, hybrid & public clouds

MICROSERVICES CAN HELP ON THESE THINGS

MONOLITH VS MICROSERVICES

Monolithic

Microservices

• API driven, simple purpose component built around

business capabilities.

• Short development cycle & CI/CD support

• Runs on containers & deployed to multiple nodes

• Single unit of application support

multipurpose

• Development is long and inflexible cycle

• Deployed to a single node

MICROSERVICES CHARACTERS

A suite of small services

Automation

with CI/CD

Build around

business

capabilities

Running in

its own

process Communicating

with lightweight

mechanisms

Independently

deployable

Service

Decentralize

all the things

LET’S LOOK AT A USE CASE

Cloud based IoT solution

PROBLEM WITH THIS SOLUTION

• Unable to scale

• Everything is tightly coupled

• If a service crashed, it brings the whole

system down

• Hard to troubleshooting problems

• Communication between services is overly

complicated and slow

• Not independently deployable

• Difficult to maintain the system

• New features take months to get deployed

How can we fix this?

#1 ISOLATE ALL THE THINGS

• Define service boundary

• Single Responsibility Principle

(Do one thing, and Do It really well)

Bounded Context

Notification

Service

Notification

Service

Notification

Service

Notification

Service

Business Capability

Bounded Context

Scheduler

Service

Scheduler

Service

Scheduler

Service

Scheduler

Service

Business Capability

#2 EMBRACE ASYNCHRONOUS PROCESSING

• Asynchronous HTTP Request Processing

• Message/Event Driven

• RabbitMQ

• Apache Kafka

Device

Registration

Device

provisioning

Certificate

Management

Certificate

Authority

HTTP SYNC

REQUEST HTTP SYNC

REQUEST

HTTP SYNC

REQUEST HTTP SYNC

REQUEST

Device

Registration Device

provisioning

Certificate

Management

Certificate

Authority

HTTP SYNC

REQUEST

Kafka

#3 USING PROTOCOL BUFFERS FOR LARGE DATA SERIALIZATION

• Fast serialization /deserialization

• more compact messages

• have a schema of the data

• backward compatibility support

#4 DESIGN FOR FAILURES

• Use HTTP timeout

• Automatically retry failed requests

• Use circuit breaker pattern

• Netflix hystrix

• Akka circuit breaker

• Concurrency control

HTTP TIMEOUT

RETRY FAILED REQUESTS

CIRCUIT BREAKER PATTERN

CIRCUIT BREAKER PATTERN

Source: https://github.com/Netflix/Hystrix/wiki/How-it-Works#isolation

Tenant B Tenant A

CONCURRENCY CONTROL IN DISTRIBUTED ENVIRONMENT

• Two types of concurrency control

• Pessimistic and Optimistic

• HTTP Etag and Optimistic locking

#5 API GATEWAY

• Security improvement

• Use industrial security standard

• OAuth2

• OpenID

• Reduces the number of requests/roundtrips

Device

Registration

Command

Delivery

Notification

Service

Event

Searching

API G

ate

wa

y

Authorization

Server

Access

Token

Access

Token

JWT

Token

JWT

Token

#6 EMBRACE DEVOPS PRACTICES

• Continuous integration (CI)

• Continuous delivery (CD)

• Automated testing

• Blue-green deployment

Plan

Develop

Test Commit

Create

Build

Package

Release Monitor

Config

Dev Ops

#7 MONITORING & LOGGING

• Monitor tools

• Splunk

• Zipkin (distributed tracing system)

• Logstash

• Kibana

• Elasticsearch

• Newrelic

A NEW SYSTEM

Device

Registration

Device

Provisioning

Certificate

Management Batch

Processing

Event Searching

Command

Delivery

Software

Delivery

Schedule

Service

User

Management

Rule Processing

Management Advanced

Learning

Notification

Service

Event Bus

(Pub/Sub channel)

API G

ate

way

RESULTS OF THE NEW SYSTEM

SCALABILITY SECURITY AGILITY RESILIENCY MAINTAINABILITY

SUMMARIES

• Digital transformation is essential to every business

• Digital Transformation can happen very quickly, and if

you miss it, it can be very unforgiving

• Microservices can help digital transformation

• Enable business to adopt changes quickly

• Efficient scalability

• Increase security

• Increased system resiliency

• Service Agility

• Team Agility

• Better Maintainability

QUESTIONS?

top related