Instiq
Chapter 5 · Platform & cloud·v1.0.0·Updated 7/11/2026·~15 min

What's changed: Initial version

5.4Network architecture design

Key points

Covers choosing between L7 load balancing, which inspects application-layer content to route traffic, and L4 load balancing, which routes quickly at the transport layer; CDN, which distributes content to edge locations; DNS, which handles the hierarchy and redundancy of name resolution; and design judgment for redundant paths and latency optimization during failures.

A system architect designs the network architecture—how to route traffic from users across a server fleet, where to place content, and how to switch paths during a failure—by weighing performance, availability, and cost. This section covers the difference in load balancing by layer, the roles of CDN and DNS, and judgment for redundant paths and latency optimization.

5.4.1Load balancing: L4 and L7

  • L4 load balancing (transport layer) decides the routing destination by looking only at source/destination IP addresses, port numbers, and TCP/UDP connection information. Because it does not parse packet contents (such as HTTP headers), it is lightweight, fast, and delivers excellent throughput, but it cannot route flexibly based on application content, such as URL path or cookies (e.g., sending only a specific path to a different server group).
  • L7 load balancing (application layer) decides the routing destination by parsing content up through the application layer—HTTP headers, URL path, cookies, and so on. It enables flexible routing, such as "route everything under /api/ to the API server group" or "route users with a specific cookie to a specific server version (for A/B testing, etc.)," but because it parses packet contents, it carries greater processing overhead and lower throughput than L4. A configuration that terminates SSL/TLS (decrypting encrypted traffic) at the load balancer is also often classified as L7.
  • The judgment axis is "do we simply want to route traffic fast?" versus "do we need flexible control based on URL path or user attributes?" Simple routing where high throughput is the top priority favors L4, and cases needing flexibility such as path-based routing or A/B testing favor L7—the choice depends on the requirement (combining both is also common: a multi-tier setup where L4 does coarse distribution first, and L7 further routes by application behind it).

Continue reading — free sign-up

You're reading the free preview. Sign up free to read this section in full, plus every chapter (including 4+) and all questions.