Three-tier web app
Browser → Load balancer → API pool → Database / Cache.
What this template contains
- Source
- 12 lines
When to use it
Choose this for a compact diagram-as-code view of a browser, load balancer, API pool, database and cache. It is useful when you want readable text and labelled connections without a large cloud-specific vocabulary. Compare it in software architecture diagram templates
The D2 template shows a browser, load balancer, three API instances, a database and a cache. Use it as a starting view, then replace its identifiers and relationships with those in your actual source. Read the guide: Architecture diagrams linked to code
Make it your own.
browser -> lb: HTTPS
lb -> api1
lb -> api2
lb -> api3
api1 -> db: reads/writes
api2 -> db
api3 -> db
api1 -> cache
api2 -> cache
api3 -> cache
db.shape: cylinder
cache.shape: cylinder