SysPadExamples › 3-tier web app

3-tier web app

A modern web stack: edge network, load balancer, API on Kubernetes, cache, database, and a payments API.

The basics, plus a grouped Data Layer you can collapse.

Cloudflare Edge Cloudflare Load Balancer ALB API Service EKS Session Cache ElastiCache PostgreSQL DB RDS Payments API External

How it works

Cloudflare Edge
The first thing a request meets. Seven in ten are answered here from cache, so everything drawn after it only ever sees the other three.
Load Balancer
Spreads requests across the API pods and hides a failed one from users. It also terminates TLS, which is why it sits in the path rather than off to the side.
API Service
Where your code runs. How much traffic it holds comes from threads per pod and how long a request takes, not from the instance type: try changing either and rerun the simulation.
Session Cache
Session lookups that would otherwise be database reads. At a 90% hit rate the database does a tenth of that work, which is usually the cheapest speed-up available.
PostgreSQL DB
The usual bottleneck in a design this shape. Reads can be shared with the replica, but every write lands on the one primary, and that is what runs out first.
Payments API
Someone else’s system. Its latency is added to yours and its rate limit becomes yours during a spike, which is why it is worth drawing rather than assuming.

Other reference architectures

Open this architecture in SysPad · All examples