SlideShare a Scribd company logo
Migrating to microservices
An open-source API proxy for logging and controlling
traffic between microservices
1
Agenda
2
1) Challenges with microservices
2) Existing solutions
3) Apex design and architecture
4) Apex implementation and deployment
1) Challenges with microservices
3
Challenges with microservices
4
1. Diagnosing network faults
2. Managing fault-handling logic
Microservices rely on
the network
5
Monolith
6
With subsystems all
running on same server…
Subsystem
communication in
monolith
● …calls between
subsystems happen
in-process
● …and are reliable
and fast
7
Microservices
8
Now subsystems are
‘services’ running on
different servers…
Subsystem
communication
between microservices
9
● …calls between
services are HTTP
requests/responses
● …and are prone to
latency and failure
Network latency
● Network hops
measured in 10s or
100s of milliseconds
10
Network
unreliability
11
● Requests or
responses can be
dropped
● Even if service code
is bug-free
Challenge #1
Diagnosing network
faults
12
Multi-service workflows
are difficult to diagnose
13
● E.g. placing order triggers
multiple hops between
services
● Fault can occur at any step
Multi-service workflows
are difficult to diagnose
14
● Each service outputs its logs
in different place
Multi-service workflows
are difficult to diagnose
15
● Developer must trace
request through multiple
sets of logs
● Need all the logs in one
place!
Challenge #2
Managing
fault-handling logic
16
Sometimes, should just
retry failed requests
17
● Network faults can
be random
● Retrying a request
may be enough
Defining fault-handling
logic requires care
18
● Retry too soon / too
often → overwhelm
responding service
Different services can
follow different rules
19
● orders →
shipping
○ Wait 3s
○ Retry 5 times
● By default
○ Wait 5s
○ Retry 2 times
All this logic has to be
defined somewhere
20
Fault-handling logic in
HTTP client libraries
● Client libraries
imported into
service code
● E.g. Ruby Gem, or
Node Package
21
Other network
concerns in HTTP
client libraries
● Libraries also
handle other
network concerns
● E.g. rate-limiting,
authentication,
caching etc.
22
A new library for every
language
● shipping’s owner
writes a library for
every language
23
Client libraries can
become hard to
manage
● Every new language
requires a new library
from every service it
needs to call
24
Updating global
rules becomes
slower
● Changing traffic rules
requires updating many
libraries in many
services
● E.g. “Rate-limit all
services to 10,000
requests per minute”
25
Summary
26
Challenges with microservices
27
1. Diagnosing network faults
○ Esp. when workflows span multiple services, and logs are distributed
2. Managing fault-handling logic
○ Client libraries can be difficult to manage with many services
2) Existing solutions
28
Solutions for
challenges with
microservices
29
1. API gateway
2. Service mesh
Solutions for
challenges with
microservices
30
1. API gateway
2. Service mesh
Both are built upon
proxy servers
Solutions for
challenges with
microservices
31
1. API gateway
2. Service mesh
Both are built upon
proxy servers
Solution #1
32
API gateway
Microservices
with API gateway
● Proxy server
● Intercepts all
incoming requests
into system
33
API gateway
provides stable
API for clients
● Provides stable API
for clients
● Can change internal
architecture, without
updating clients
34
API gateway also provides one place to handle
more networking concerns
35
Reminder: challenges with microservices
36
1. Diagnosing network faults
2. Managing fault-handling logic
Could we deploy an API gateway internally
between services?
37
Theoretically yes,
but existing API
gateway solutions
are not optimal
● Many features specific
to handling
client-server traffic
● Unnecessarily complex
and poor fit for
service-to-service
traffic*
38* According to NGINX, maker of the popular open-source NGINX load balancer and web server
Still a useful
pattern!
● Source of inspiration
for Apex’s architecture
39
Solution #2
40
Service mesh
Service mesh has two main components
1) Sidecar proxies (data plane)
2) Configuration server (control plane)
41
1st component
Sidecar proxies
(data plane)
42
Services and
sidecar proxies
● Services talk through
sidecar proxies
● Sidecar proxies
manage retries, routing,
caching etc.
43
Services and
sidecar proxies
● Services code can
focus on its core
business logic
● Networking concerns
outsourced to sidecar
proxies
44
2nd component
Configuration server
(control plane)
45
● One configuration
server with source
of truth for config
data
● Retries, rate limits,
routing, access roles
etc.
46
Service mesh and
configuration server
● Updates are made
in one place, in the
config server
● Sidecar proxies then
update their cached
copies
47
Service mesh and
configuration server
Reminder: challenges with microservices
48
1. Diagnosing network faults
2. Managing fault-handling logic
● Config server: one place to
define and update
fault-handling logic
● Sidecar proxies: execute
fault-handling logic + log all
requests and responses
49
Service mesh provides a
strong solution
● No single point of failure or
traffic bottleneck →
scalable and resilient to
faults
50
Service mesh provides a
strong solution
Service mesh
trade-off -
complexity
● Double # of
components
● Istio, Linkerd 1 can
be complex
● Few easy options if
not containerised, or
not on Kubernetes
51
Summary
API gateways
vs
service meshes
52
API gateway vs
service mesh
53
● API gateways are
simpler to deploy and
operate…
● …but not optimized for
service-to-service
traffic
API gateway vs
service mesh
54
● Service meshes
provide scalable and
resilient solution…
● …but could require
redeploying with
containers and K8s
● …or be complex to
deploy and operate
3) Apex design and architecture
55
Apex is designed for teams migrating a monolith
to microservices
● First few microservices (1 - 10 services)
● Deployed without containers and/or K8s, or
deployed on PaaS solutions e.g. Heroku
56
Problem addressed
by Apex
● Manage
service-to-service
traffic
● Aggregate logs and
manage traffic rules
in one place
57
Apex trade-offs (1)
● Simple to deploy
and operate
● Preserve existing
deployment
patterns
58
Apex trade-offs (2)
Willing to sacrifice:
● Rich built-in
features
● High availability
● High scalability
59
Apex architecture -
high-level overview
60
Microservices
architecture with Apex
61
● Apex mediates
traffic between all
services
● Akin to ‘internal API
gateway’
Apex architecture
62
Apex architecture with middleware
63
Apex as solution to
microservices challenges
64
Reminder: microservices challenge #1
65
1. Diagnosing network faults
○ Esp. when workflows span multiple services, and logs are distributed
2. Managing fault-handling logic
○ Client libraries can be difficult to manage with many services
All requests and
responses sent to
apex-logs-db
66
● No client libraries
needed
● Similar functionality
to log aggregators
Apex traces requests and responses belonging
to same cycle
67
Apex can trace traffic across services in
multi-service workflows
68
Logs can be queried on apex-admin-ui
69
Demo - querying logs
70
● Send request from
Postman
● Copy
correlation_id
from response
● Query
apex-logs-db by
correlation_id
Reminder: microservices challenge #2
71
1. Diagnosing network faults
○ Esp. when workflows span multiple services, and logs are distributed
2. Managing fault-handling logic
○ Client libraries can be difficult to manage with many services
apex-config-store
stores credentials and
retry logic in one place
72
● Similar to config
server in a service
mesh
● ‘Service mesh lite’
architecture
apex-config-store
stores credentials and
retry logic in one place
73
● Service credentials for
authentication
● Service host names for
routing
apex-config-store
stores credentials and
retry logic in one place
74
● Global defaults:
○ default-default
● Service-specific overrides
○ orders-shipping
○ shipping-inventory
apex-proxy queries
apex-config-store
for every request
75
● Authenticate service
● Route request to
correct service
● Retrieve retry logic
apex-config-store
provides one place to
update config
● Updates can be
made on
apex-admin-ui
76
From Apex to
service mesh
77
Apex vs service
mesh
78
● Apex trades off
availability and
scalability…
● …for ease of
deployment and
operation -
especially without
containers / K8s
Apex: a transitional architecture in adopting
service mesh
79
“Internal API gateway” 1
“Service mesh lite” 2
“Router mesh” 3
1. https://konghq.com/blog/kong-service-mesh/
2. https://developer-docs.citrix.com/projects/citrix-k8s-ingress-controller/en/latest/deploy/service-mesh-lite/
3. https://www.nginx.com/blog/microservices-reference-architecture-nginx-router-mesh-model/
NGINX’s ‘Router
Mesh’ model
“
80
As the intermediate
model… The Router
Mesh Model is
relatively easy to
implement, powerful,
efficient, and fast. 1
1. https://www.nginx.com/blog/microservices-reference-architecture-nginx-router-mesh-model/
NGINX’s ‘Router
Mesh’ model
“
81
[The Router Mesh
model] covers the
needs of a great many
microservices apps. 1
1. https://www.nginx.com/blog/microservices-reference-architecture-nginx-router-mesh-model/
4) Apex implementation and
deployment
82
Apex architecture with technologies
83
apex-proxy:
Node.js and
Express.js
● Node.js: handle
huge number of
simultaneous
connections with
high throughput
● Express.js: easily
extensible with
middleware
84
apex-logs-db:
TimescaleDB
● Time-series
database: logs are
time-series in nature 1
● TimescaleDB: fast
ingest rates (100,000+
rows per second,
even with billions of
rows)
85
1. https://blog.timescale.com/blog/what-the-heck-is-time-series-data-and-why-do-i-need-a-time-series-datab
ase-dcf3b1b18563/
apex-config-store:
Redis
● Redis: high read rate
(72,000 requests per
second)
86
Minimising latency
● Fast components
○ Node.js and Express.js
○ Redis
○ TimescaleDB
● Load-testing:
○ <1 second added latency per request-response cycle
87
Deploying with
Docker Compose
● Docker & Docker
Compose: easy to
deploy
● AWS ECS
88
Deploying to VPC
89
● Deploy to same VPC
as services to
minimise latency
Thanks!
90
Kelvin Wong
Full-stack software engineer based in London
kelvinjhwong.com
kjhwong@gmail.com 91

More Related Content

PPTX
#NET5488 - Troubleshooting Methodology for VMware NSX - VMworld 2015
PDF
OpenStack Networking
PPTX
Modular Layer 2 In OpenStack Neutron
PPTX
How to write a Neutron Plugin - if you really need to
PPTX
OpenStack and the Transformation of the Data Center - Lew Tucker
PDF
VMworld 2013: Deploying VMware NSX Network Virtualization
PDF
VMworld Europe 2014: Advanced Network Services with NSX
PDF
VMworld 2013: Operational Best Practices for NSX in VMware Environments
#NET5488 - Troubleshooting Methodology for VMware NSX - VMworld 2015
OpenStack Networking
Modular Layer 2 In OpenStack Neutron
How to write a Neutron Plugin - if you really need to
OpenStack and the Transformation of the Data Center - Lew Tucker
VMworld 2013: Deploying VMware NSX Network Virtualization
VMworld Europe 2014: Advanced Network Services with NSX
VMworld 2013: Operational Best Practices for NSX in VMware Environments

What's hot (20)

PDF
Openstack Neutron and SDN
PDF
MidoNet 101: Face to Face with the Distributed SDN
PDF
Bridges and Tunnels a Drive Through OpenStack Networking
PDF
OpenStack Paris Summit: Bridges and Tunnels: A Drive Through OpenStack Networ...
PDF
OpenStack networking - Neutron deep dive with PLUMgrid
PPTX
OpenStack Networking and Automation
PDF
OpenStack networking (Neutron)
PPTX
MidoNet Overview - OpenStack and SDN integration
PDF
MidoNet gives OpenStack Neutron a Boost
PDF
VMworld 2013: Bringing Network Virtualization to VMware Environments with NSX
PDF
vVMworld 2013: Deploying, Troubleshooting, and Monitoring VMware NSX Distribu...
PDF
VMworld 2013: NSX PCI Reference Architecture Workshop Session 2 - Privileged ...
PDF
Midokura Gluecon 2014 - Level up your OpenStack Neutron Networking
PDF
OpenStack Neutron Advanced Services by Akanda
PPTX
Neutron VEB Plugin
 
PPTX
Navigating OpenStack Networking
PDF
NetScaler TCP Performance Tuning
PDF
Sdn primer pdf
PPTX
NSX, API, Automation and Unicorns
PPTX
nsx overview with use cases 1.0
Openstack Neutron and SDN
MidoNet 101: Face to Face with the Distributed SDN
Bridges and Tunnels a Drive Through OpenStack Networking
OpenStack Paris Summit: Bridges and Tunnels: A Drive Through OpenStack Networ...
OpenStack networking - Neutron deep dive with PLUMgrid
OpenStack Networking and Automation
OpenStack networking (Neutron)
MidoNet Overview - OpenStack and SDN integration
MidoNet gives OpenStack Neutron a Boost
VMworld 2013: Bringing Network Virtualization to VMware Environments with NSX
vVMworld 2013: Deploying, Troubleshooting, and Monitoring VMware NSX Distribu...
VMworld 2013: NSX PCI Reference Architecture Workshop Session 2 - Privileged ...
Midokura Gluecon 2014 - Level up your OpenStack Neutron Networking
OpenStack Neutron Advanced Services by Akanda
Neutron VEB Plugin
 
Navigating OpenStack Networking
NetScaler TCP Performance Tuning
Sdn primer pdf
NSX, API, Automation and Unicorns
nsx overview with use cases 1.0
Ad

Similar to Log and control all service-to-service traffic in one place (Kelvin Wong) (20)

PDF
Microservices architecture: practical aspects
PDF
Microservices on a budget meetup
PDF
Backend for Frontend in Microservices
PPTX
Intro to Microservices Architecture
PPTX
Api gateway : To be or not to be
PDF
#ATAGTR2020 Presentation - Microservices – Explored
PDF
Building Microservices Software practics
PPTX
Azure reference architectures
PDF
Study Notes - Using an API Gateway
PDF
Monolithic to Microservices Migration Journey of iyzico with Spring Cloud
PDF
Microservices for Application Modernisation
PDF
Microservices designing deploying
PDF
Microservices designing deploying
PDF
Microservices designing deploying
PDF
Microservices_Designing_Deploying.pdf
PDF
Is Microservices SOA Done Right?
PDF
Microservices_Designing_Deploying.pdf
PDF
2019 devoxx - apis, microservices, et le service mesh
PPTX
Breaking down a monolith
PPTX
Microservices architecture
Microservices architecture: practical aspects
Microservices on a budget meetup
Backend for Frontend in Microservices
Intro to Microservices Architecture
Api gateway : To be or not to be
#ATAGTR2020 Presentation - Microservices – Explored
Building Microservices Software practics
Azure reference architectures
Study Notes - Using an API Gateway
Monolithic to Microservices Migration Journey of iyzico with Spring Cloud
Microservices for Application Modernisation
Microservices designing deploying
Microservices designing deploying
Microservices designing deploying
Microservices_Designing_Deploying.pdf
Is Microservices SOA Done Right?
Microservices_Designing_Deploying.pdf
2019 devoxx - apis, microservices, et le service mesh
Breaking down a monolith
Microservices architecture
Ad

More from London Microservices (8)

PDF
Building Event-Driven Microservices using Kafka Streams (Stathis Souris, Thou...
PPTX
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
PPTX
Event Streaming, the hard way by (César Luis Alvargonzález, Revolut)
PDF
Hidden secrets of the Deliveroo Application Platform (Ben Cordero, Deliveroo)
PDF
Reliability in Microservices: Embracing Failure (César Luis Alvargonzález, Re...
PDF
Robots and Food (Orfeo Nicolai, Karakuri)
PDF
Cloud Native Patterns (Jamie Dobson, Container Solutions)
PPTX
Designing an extensible tooling platform (Dmitry Zeldin, Skyscanner)
Building Event-Driven Microservices using Kafka Streams (Stathis Souris, Thou...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Event Streaming, the hard way by (César Luis Alvargonzález, Revolut)
Hidden secrets of the Deliveroo Application Platform (Ben Cordero, Deliveroo)
Reliability in Microservices: Embracing Failure (César Luis Alvargonzález, Re...
Robots and Food (Orfeo Nicolai, Karakuri)
Cloud Native Patterns (Jamie Dobson, Container Solutions)
Designing an extensible tooling platform (Dmitry Zeldin, Skyscanner)

Recently uploaded (20)

PDF
top salesforce developer skills in 2025.pdf
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
history of c programming in notes for students .pptx
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
assetexplorer- product-overview - presentation
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
L1 - Introduction to python Backend.pptx
PDF
Nekopoi APK 2025 free lastest update
PDF
medical staffing services at VALiNTRY
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
top salesforce developer skills in 2025.pdf
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Odoo Companies in India – Driving Business Transformation.pdf
history of c programming in notes for students .pptx
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Why Generative AI is the Future of Content, Code & Creativity?
Odoo POS Development Services by CandidRoot Solutions
assetexplorer- product-overview - presentation
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Softaken Excel to vCard Converter Software.pdf
Reimagine Home Health with the Power of Agentic AI​
L1 - Introduction to python Backend.pptx
Nekopoi APK 2025 free lastest update
medical staffing services at VALiNTRY
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
wealthsignaloriginal-com-DS-text-... (1).pdf
PTS Company Brochure 2025 (1).pdf.......

Log and control all service-to-service traffic in one place (Kelvin Wong)