journey from monolith to microservices: adopting a service ...refactoring a monolith is an activity...

40
Journey from Monolith to Microservices: Adopting a Service Mesh Approach Harry Bagdi, Kong

Upload: others

Post on 25-May-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Journey from Monolith to Microservices: Adopting a Service Mesh Approach

Harry Bagdi, Kong

Page 2: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

INSERT AN IMAGE FOR ALL THE AREA

Transforming our orgs into a multicellular organism

DECOUPLED, DISTRIBUTED, SELF-HEALING

Page 3: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Monolith Services Microservices/

Service Mesh

Journey to a Modern Enterprise

Emerging

Patterns Serverless/FaaS

+

N-S N-S N-S N-S

E-W

N-S

Page 4: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

1 What does it mean?

Page 5: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Refactoring a monolith is an activity that unlocks team productivity and

business scalability

Page 6: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Refactoring a monolith is an activity that unlocks team productivity and

business scalability

Page 7: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

2 Should we do it?

Page 8: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

O(1) to O(n)

Page 9: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith
Page 10: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

3 Let’s do it!

Page 11: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

v

Nuclear Strategy

v v

3 Strategies

Ice Cream Scoop Lego Strategy

Page 12: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

v

Nuclear Strategy

v v

3 Strategies

Ice Cream Scoop Lego Strategy

Page 13: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

INSERT AN IMAGE FOR ALL THE AREA

Class

Class

Class

Class

Class

Class

Class Class Class

Class Class Class

Database

Object-Oriented Monolith Lots of function calls across different objects

Page 14: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

INSERT AN IMAGE FOR ALL THE AREA

Hypothetical Marketplace Like Amazon.com

Users

Search

Orders

Inventory

Invoices

Billing

Items Reviews Payouts

Points Offers Partners

Database

Page 15: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

INSERT AN IMAGE FOR ALL THE AREA

Users

Search

Orders

Inventory

Invoices

Billing

Items Reviews Payouts

Points Offers Partners

Database

Team 1

Team 2

Team 3

Page 16: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Team 2 starts making frequent changes

TEAM FRICTION

Page 17: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Users Orders Invoices

Billing

Payouts Points

Offers Partners

Database

Team 1

Team 2

Team 3

Search Inventory

Items Reviews

Database

Page 18: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Users Orders Invoices

Billing

Payouts Points

Offers Partners

Database

Team 1

Team 2

Team 3

Search

Inventory

Items Reviews

Database

Database

Page 19: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Clear understanding of what the monolith does and does not

Understanding of clients that are consuming the monolith

Tests, tests, tests

Approaching the Transition

Page 20: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Updating clients and routing requests to different services

CLIENTS

Page 21: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Frontend

Load Balancer

N-S Traffic

N-S Traffic

Users

Search

Orders

Inventory

Invoices

Billing

Items Reviews Payouts

Points Offers Partners

Monolith

Page 22: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Frontend

API Gateway

N-S Traffic

N-S Traffic

Users

Search

Orders

Inventory

Invoices

Billing

Items Reviews Payouts

Points Offers Partners

Monolith

API gateways are also load balancers

Page 23: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Frontend

API Gateway

Users Search Orders Inventory Invoices

Billing Items Reviews

Payouts Points

Offers Partners

E-W Traffic

Routing

Page 24: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Frontend

API Gateway

Users Search Orders Inventory Invoices

Billing Items Reviews

Payouts Points

Offers Partners

E-W Traffic

Canary Release (i.e., 10% traffic)

Search Inventory

Items Reviews

v1.0 v1.1

Page 25: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

4 Sizing the services

Page 26: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Service

Service

Service

Service

Service

Service

Service Service Service

Service Service Service Database

Database

Database

Database

Ideal World

Page 27: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Service

Service

Service

Service

Service

Service

Service Service

Service

Service

Database

Database

Database

Database

Reality

Page 28: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

5 Network

Page 29: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

In monoliths, we have objects , interfaces and function calls.

In microservices, we have services , interfaces and network calls.

Page 30: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Service

Service

Service

Service

Service

Service

Service Service Service

Service Service Service Database

Database

Database

Database

Microservices

Lots of network calls across different services

Network

Page 31: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Service

Service

Service

Service

Service

Service

Service Service Service

Service Service Service Database

Database

Database

Database

Typical network problems: latency, security, routing, error handling, observability

Microservices

Lots of network calls across different services

Page 32: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Service

Service

Service

Service

Service

Service

Service Service Service

Service Service Service Database

Database

Database

Database D

P

D

P

D

P

D

P

D

P

D

P

D

P

D

P

D

P

D

P

D

P

D

P

D

P

D

P

D

P

D

P

Service Mesh

Lots of network calls across different services through a decentralized proxy

Page 33: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

The biggest assumption is that the network latency between the service and the local proxy is negligible

Service Service

Success Rate: 100% Network Latency: 0ms

Success Rate: 100% Network Latency: 0ms

Proxy Proxy

Page 34: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

One instance of proxy for each instance of the service

Service Service

Proxy Proxy

Service Service Service Service

Proxy Proxy

Page 35: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Service

Service

Service

Service

Service

Service

Service Service Service

Service Service Service Database

Database

Database

Database DP

DP

DP

DP

DP

DP

DP

DP

DP

DP

DP

DP

Control Plane (CP)

Push dynamic configuration Collect metrics from sidecars

DP

DP

DP

DP

Page 36: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Service

Service

Service

Service

Service

Service

Service Service Service

Service Service Service Database

Database

Database

Database DP

DP

DP

DP

DP

DP

DP

DP

DP

DP

DP

DP

Control Plane (CP)

API Gateway DP

External Clients

DP

DP

DP

DP

Page 37: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

N E R V O U S S Y S T E M

Control Planes For configuration and metrics

Open Source Data Planes Lightweight and Decentralized

Data Planes

Page 38: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

N E R V O U S S Y S T E M O F T H E C L O U D

Service Control Platform

MONOLITH SERVICES MESH SERVERLESS

Page 39: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

Thank You!

Page 40: Journey from Monolith to Microservices: Adopting a Service ...Refactoring a monolith is an activity that unlocks team productivity and business scalability . Refactoring a monolith

1 Business

Transformation

2 Pragmatic Strategy

3 Gradual Change