1/21
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Keep traffic in-region
Try to handle an entire user request inside a single region so you avoid slow, failure-prone cross-region network hops.
Why avoid cross-region calls?
Cross-region calls add ~50-150ms latency each way, extra cost, and more failure modes, so p95/p99 latency and reliability get worse.
Good use of cross-region traffic
Use cross-region links mainly for async replication, backups, and rare control-plane operations, not for every user request.
Bad use of cross-region traffic
Designs where a single user request synchronously calls multiple services in another region, stacking latency and coupling regions.
Single-region hot path principle
The 'hot path' for a request (login, gameplay, purchase) should be satisfiable with only in-region services and data.
Async replication between regions
Writes are committed in the local region first, then replicated asynchronously to other regions for read locality and DR.
Region-local read pattern
Each region serves reads from its own local data (or replicas) instead of reaching across the world for every request.
Chatty cross-region anti-pattern
When one region calls another many times for one user action, causing multiple high-latency hops and fragile dependencies.
Batching definition
Collect multiple small operations or messages and send/process them together in a single larger request or DB transaction.
Why batching helps
Batching amortizes per-request overhead (TLS, syscalls, auth, logging), increasing throughput and stabilizing tail latency.
Batching tradeoff
Bigger batches improve efficiency but add queueing delay, so you must balance latency vs throughput.
Batch size tuning
You typically cap batches by both time (e.g., 10-50ms window) and count (e.g., up to N items) to keep latency reasonable.
Partial failure in batching
When one item in a batch fails, you must choose whether to fail the whole batch or allow partial success with per-item status.
Compression definition
Compression shrinks payload size (e.g., gzip, Brotli, zstd) in exchange for extra CPU to compress and decompress.
When to use compression
Use compression for large, text-heavy payloads (JSON, logs, telemetry) where network cost dominates CPU cost.
When NOT to use compression
Avoid compression for tiny messages and already-compressed formats (images, video, zip files) where it adds overhead without benefit.
Chatty protocol between services
Many small RPCs between services to fulfill one logical operation, creating latency stacking and complex dependencies.
Coarse-grained API
An API that exposes a higher-level operation (e.g., GetPlayerDashboard) returning everything needed in one call.
Why avoid chatty service calls
Chatty calls increase latency, coupling, and risk of cascading failures when any small service misbehaves.
Backend-for-Frontend (BFF) pattern
A BFF aggregates data from multiple internal services into one coarse-grained API tailored to a specific client or UI.
Materialized view for reads
Precomputed, read-optimized data (e.g., player snapshot) used so one read can serve many UI fields without multiple service calls.
Many-small-writes, few-rich-reads pattern
Services keep writes small and localized, but expose richer, aggregated read APIs to avoid chatty request fan-out.