⚖️ Trade-offs Cheat Sheet

Interview superpower

For every choice, say: “I’m choosing X over Y because of constraint Z. The cost is W, and we’d revisit it if V happens.”

DecisionOption AOption BChoose A whenChoose B when
ArchitectureModular monolithMicroservicesSmall team, early product, unclear domain boundariesMany teams, independent deploy/scale needs, clear bounded contexts
ConsistencyStrong (linearizable)EventualMoney, inventory, seats, uniquenessFeeds, counters, analytics, search
CommunicationSync (REST/gRPC)Async (events/queues)Needs an immediate answer, simple flowsDecoupling, spikes, fan-out, long-running work
Internal APIgRPCRESTService-to-service, streaming, strict contracts, performancePublic APIs, browsers, simplicity, caching
Client APIGraphQLRESTMany clients with different data needs, aggregationSimple resources, HTTP caching, simple ops
DBRelational (Postgres)NoSQL (Cassandra/Dynamo)Relations, transactions, ad-hoc queries (default choice)Massive write scale, known access patterns, multi-region AP
Scaling readsCacheRead replicasHot, repeated reads; tolerate stalenessComplex queries, fresher data
Cache writesCache-asideWrite-through / write-behindGeneral purposeRead-after-write needs / write-heavy buffering
Concurrency controlOptimistic (version)Pessimistic (SELECT … FOR UPDATE)Low contentionHigh contention on the same rows
DeliveryAt-least-once + idempotencyExactly-once (Kafka txns)Almost alwaysStream-processing pipelines inside Kafka
Transactions across servicesSaga2PCMicroservices (almost always)Rare, single-vendor, tightly coupled resources
QueueKafkaRabbitMQ/SQSEvent streams, replay, high throughput, ordering per keyTask queues, routing, per-message ack, simpler ops
IDsUUIDv7 / SnowflakeAuto-incrementDistributed, sortable, no coordinationSingle DB, simplicity
ComputeContainers on K8sServerlessSteady load, many services, platform teamSpiky/low load, small team, event glue
PaginationCursor/keysetOffsetLarge/real-time dataSmall datasets, jump-to-page UI
LanguageGoJava/SpringInfra, high concurrency, small binaries, fast startupRich enterprise ecosystem, complex domains, big teams

Trade-off axes to always consider

Latency · Throughput · Consistency · Availability · Durability · Cost · Complexity · Operability · Security · Time-to-market · Reversibility · Team skill