APIdays Singapore 2019 - Blowing Up the Monolith: Adopting a Modern API Strategy for Hybrid, Multi-Cloud Architectures, Marco Palladino, Co-Founder & CTO, Kong
Similar to APIdays Singapore 2019 - Blowing Up the Monolith: Adopting a Modern API Strategy for Hybrid, Multi-Cloud Architectures, Marco Palladino, Co-Founder & CTO, Kong
Considerations for Abstracting Complexities of a Real-Time ML Platform, Zhenz...HostedbyConfluent
Similar to APIdays Singapore 2019 - Blowing Up the Monolith: Adopting a Modern API Strategy for Hybrid, Multi-Cloud Architectures, Marco Palladino, Co-Founder & CTO, Kong (20)
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
APIdays Singapore 2019 - Blowing Up the Monolith: Adopting a Modern API Strategy for Hybrid, Multi-Cloud Architectures, Marco Palladino, Co-Founder & CTO, Kong
5. konghq.comBlowing up the monolith! @thekonginc
Growing codebase = Growing pain
Team 1 Team 2 Team 3
Team 4
6. konghq.comBlowing up the monolith! @thekonginc
Making a change?
Team 4
● The entire system needs to be re-deployed
● They need coordination with other teams
● Higher chances of failure
● Not scalable as the codebase and the team grows
7. konghq.comBlowing up the monolith! @thekonginc
Monolith vs Microservices
https://martinfowler.com/articles/microservices.html
11. konghq.comBlowing up the monolith! @thekonginc
A monolith uses primarily function calls.
Order.class
Function createOrder() {
..
// Create Invoice
}
Invoice.class
Function createInvoice() {
..
}
Incoming Request
Api.class
Function request() {
checkAuthentication()
checkRateLimit()
checkParameters()
createOrder()
return result
}
API
Orders Invoice
Monolith
... ...North-South Traffic
“East-West” function call
“East-West” function call
Nobody really calls them this way, but I will
use this terminology to help my narrative
Monolith
12. konghq.comBlowing up the monolith! @thekonginc
Order.class
Function request() {
checkAuthentication()
checkRateLimit()
checkParameters()
doCreateOrder()
createInvoice()
Return result
}
Invoice.class
Function request() {
checkAuthentication()
checkRateLimit()
checkParameters()
doCreateInvoice()
Return result
}
Network Request
HTTP, gRPC, etc
East-West Traffic
Orders InvoiceIncoming Request
North-South Traffic
Microservices
14. konghq.comBlowing up the monolith!
Microservices are harder, not easier.
Moving to Microservices is slow, not fast.
15. konghq.comBlowing up the monolith! @thekonginc
Approaching the transition
Clear understanding of
what the Monolith does
and does not
Understanding of
clients that are
consuming the
monolith
Tests, Tests, Tests.
16. konghq.comBlowing up the monolith! @thekonginc
Strategies
Ice Cream Scoop Lego Strategy Nuclear Strategy
17. konghq.comBlowing up the monolith! @thekonginc
Build an API and move clients outside
For example: decouple the
frontend from the monolith
18. konghq.comBlowing up the monolith! @thekonginc
Identify and extract boundaries
How do we handle routing? How do we handle storage and state propagation?
20. konghq.comBlowing up the monolith! @thekonginc
Synchronous vs Asynchronous
Microservices and clients
directly consume and invoke
other microservices.
Microservices and clients
push event into an event
collector that’s being
consumed by other
microservices.
Ideal for clients that require an
immediate response or need
to aggregate multiple services
together.
Ideal for
microservice-to-microservice
communication for changing
state without requiring an
immediate response.
Done via HTTP, TCP/UDP,
gRPC,etc.
Done via Kafka, RabbitMQ,
AWS SQS, etc.
Example: Making a request to
retrieve an immediate
response of some sort (ie,
retrieve list of users).
Example: Making a request
that doesn’t require an
immediate response (ie,
“orderCreated” event that
triggers an invoice creation by
another microservice).
Synchronous Asynchronous
21. konghq.comBlowing up the monolith! @thekonginc
Routing and Versioning
For North-South traffic: For East-West traffic:
23. konghq.comBlowing up the monolith! @thekonginc
At scale, many moving parts
Orders
Invoice
Orders
Orders
Orders
Orders
Orders
Orders
Orders
Orders
Orders
Invoice
Invoice
Invoice
Invoice
East-West Traffic
Invoice
Invoice
Invoice
Invoice
Service X
Invoice
Invoice
Invoice
Invoice
Service Y
Invoice
Invoice
Invoice
Invoice
Service X
Invoice
Invoice
Invoice
Invoice
Service X
24. konghq.comBlowing up the monolith! @thekonginc
Service Mesh
Orders
Proxy
Invoices
The speed of each one of these requests
becomes very important in east-west traffic.
Reverse Proxy
The assumption is that the
request Microservice <>
Proxy are basically
instantaneous. Why?
Because they are on
localhost (because sidecar
proxy)
25. konghq.comBlowing up the monolith!
Observability, routing and error handling are features
shared
by both traditional API Gateways and sidecar proxies
26. konghq.comBlowing up the monolith! @thekonginc
Common Feature Set
■ Advanced Routing
■ Circuit Breaking and Health-Checks
■ Monitoring and Observability
■ Extensibility
Proxy
Microservice
Proxy
Microservice
Sidecar
Proxy
Client
Proxy
API
Sidecar
ProxyClient Proxy
API
Sidecar
Monolithic
API
In Service Mesh the client is
another microservice inside
the organization.
SERVICE MESH
API GATEWAY / INGRESS
In API GW / Ingress the
client is a third-party entity.
API Request
API Request
API Request
ORG or DEPT EDGE