Web Development, Performance, Distributed Systems, APIs, Databases, Backend Engineering — Daily Update 2026-11-03
Network Protocols & Transport
HTTP/3 & QUIC — 2026 Adoption Reality Check
Per Cloudflare Radar (Oct 2026): HTTP/3 serves ~31% of global requests (up from 24% Jan 2026). Top 1M: ~42%. But connection migration (QUIC’s killer feature — survive IP change on mobile handoff) is used in < 2% of sessions. Why?
- Client support: Chrome/Edge/Firefox/Safari all support. But
Alt-Svcheader adoption on origin servers lags — many still H2 only. - Load balancer/CDN support: Cloudflare, CloudFront, Fastly, Akamai all terminate QUIC. But on-prem (NGINX, HAProxy, Envoy) QUIC termination is still experimental or requires custom builds.
- UDP blocking: Corporate firewalls, carrier-grade NAT, some ISPs throttle UDP/443. Fallback to H2 adds 1-RTT latency.
Recommendation: Enable H3 at CDN edge. For on-prem, run dual-stack (H2 + H3) with Alt-Svc: h3=":443"; ma=86400. Monitor quic_version_negotiation failures.
QUIC Connection Migration — How It Actually Works
- Client sends packets from new path (new IP/port) with same Connection ID.
- Server validates path via PATH_CHALLENGE / PATH_RESPONSE frames (cryptographic proof of reachability).
- Server migrates sending to new path. Old path drains.
- Zero application-layer disruption — streams continue.
Requires: active_connection_id_limit >= 2 (client provides spare CIDs via NEW_CONNECTION_ID). Most servers default to 2 — sufficient.
HTTP/2 vs HTTP/3 Latency — Controlled Benchmark (AWS c6i.xlarge, 50ms RTT)
| Metric | H2 (TLS 1.3) | H3 (QUIC) | Delta |
|---|---|---|---|
| Cold start (TCP+TLS / QUIC handshake) | 2-RTT = 100ms | 1-RTT = 50ms | H3 -50% |
| Warm (resumption / 0-RTT) | 1-RTT = 50ms | 0-RTT = 0ms* | H3 wins |
| Head-of-line blocking (1 lost packet) | All streams stall | Only affected stream | H3 wins |
| Migration (WiFi → 5G) | Reconnect = 2-RTT | Seamless | H3 wins |
* 0-RTT has replay risk — disable for non-idempotent (POST/PUT).
Database Connection Pooling — Benchmarks & Configuration
The Pool Sizing Formula
Optimal pool size = (core_count * 2) + effective_spindle_count (for SSD: spindle_count = 1). For 32-core DB server: 65 connections. But application servers multiply this.
PgBouncer vs Native Pool vs Proxy
| Mode | Max Conns | Latency Overhead | Features |
|---|---|---|---|
| PgBouncer (transaction) | 10,000+ | ~0.1ms | No prepared stmt reuse across txns |
| PgBouncer (session) | ~1,000 | ~0.1ms | Prepared stmts work, holds connection |
| Native (libpq) | ~200-500 | 0ms | Per-process, no sharing |
| Proxy (Envoy/HAPRoxy) | 5,000+ | ~0.2ms | TLS termination, observability |
Benchmark: 1000 Concurrent Clients, 10ms Query, 32-core PG
# pgbench -c 1000 -j 32 -T 60 -S
# Pool: PgBouncer transaction mode, 200 connections
tps = 28,400 (avg latency 35ms, p99 120ms)
# Pool: PgBouncer session mode, 200 connections
tps = 19,200 (avg latency 52ms, p99 210ms)
# No pool (direct, 200 max_connections)
tps = 8,100 (avg latency 124ms, p99 480ms) — connection thrashing
Key insight: Transaction pooling gives 3.5x throughput over no pool. Session pooling holds connections longer — use only when prepared statements are critical and client count < 500.
Prepared Statement Pitfall
PgBouncer transaction mode: PREPARE in txn A, EXECUTE in txn B → ERROR: prepared statement does not exist. Prepared statements are session-scoped. Fix: pool_mode = session OR use simple_query protocol (no prepare) OR keep pool_mode=transaction and disable prepared statements in driver (prefer_query_mode=simple in pgx/Go, prepared_statements=false in psycopg3).
gRPC vs REST — Latency Analysis (2026 Edition)
Protocol Overhead
| Factor | REST/JSON | gRPC/Protobuf |
|---|---|---|
| Serialization (1KB payload) | ~0.05ms (simdjson) | ~0.02ms (protobuf) |
| Compression | gzip/br (opt-in) | gzip/zstd (built-in) |
| HTTP/2 multiplexing | Yes | Yes (native) |
| Client generation | OpenAPI → SDK | Proto → stub (type-safe) |
| Browser support | Native fetch | grpc-web / ConnectRPC (extra hop) |
| Debugging | curl, DevTools | grpcurl, buf, reflection |
Real-World Latency (Same Service, Go 1.23, 1ms Business Logic)
# 1KB request/response, 10ms network RTT, 1000 RPS
REST/JSON (HTTP/2): p50=12.3ms p99=28.7ms
gRPC (HTTP/2): p50=11.1ms p99=24.2ms
ConnectRPC (HTTP/2): p50=11.3ms p99=24.8ms
gRPC (HTTP/3/QUIC): p50=10.8ms p99=22.1ms
gRPC wins ~10-15% on latency, but the real gain is type safety and contract evolution. Protobuf field numbers = schema evolution without versioning headaches. REST needs OpenAPI discipline + breaking change process.
When to Choose Each
- gRPC/ConnectRPC: Service-to-service, high RPS, polyglot, schema evolution critical, streaming required.
- REST/JSON: Public APIs, webhooks, browser direct, low RPS, team lacks protobuf tooling.
- GraphQL: Client-driven aggregation, mobile (bandwidth), multiple frontends with different needs.
The Fallacies of Distributed Computing — 2026 Revisited
Peter Deutsch / Sun (1994) — still the best checklist for system design reviews.
| Fallacy | 2026 Reality | Mitigation |
|---|---|---|
| The network is reliable | Packet loss 0.1-1%, partitions daily | Retry + idempotency, circuit breakers |
| Latency is zero | Cross-region 50-150ms, AZ 1-2ms | Async, caching, read replicas |
| Bandwidth is infinite | Egress costs $0.02-0.09/GB | Compression, delta sync, columnar |
| The network is secure | TLS 1.3 everywhere, but mTLS gaps | Zero trust, mTLS, SPIFFE |
| Topology doesn’t change | K8s reschedules, spot eviction, DNS | Service discovery, health checks |
| There is one administrator | Platform team, app teams, vendors | RBAC, GitOps, policy as code |
| Transport cost is zero | Serialization, compression, copying | Zero-copy, flatbuffers, Cap’n Proto |
| The network is homogeneous | ARM/x86, IPv4/v6, QUIC/TCP, mesh | Multi-arch images, dual-stack |
Add a 9th for 2026: “Observability is free” — it’s not. Logs/metrics/traces cost 10-30% of infra spend. Sample intelligently (tail-based sampling, probabilistic_sampler in OTel).
TL;DR — Action Items This Week
| Area | Action | Effort |
|---|---|---|
| Network | Enable HTTP/3 at CDN; add Alt-Svc header on origin |
Low |
| Database | Configure PgBouncer transaction mode; disable prepared statements in driver | Medium |
| API | Evaluate ConnectRPC for new service-to-service (simpler than grpc-web) | Medium |
| Architecture | Run fallacies checklist on new service design — document mitigations | High |
| Observability | Implement tail-based sampling (keep errors, sample success 1:100) | Medium |
Next daily update: 2026-11-04. Subscribe to the Backend Engineering category for direct delivery.