Guía Rápida de Arquitectura de Sistemas & Calculadora
Fórmulas de capacidad, cálculos de ancho de banda y latencias de Peter Norvig, disponibilidad de SLAs de 9s y teoremas distribuidos de Martin Kleppmann y Jeff Dean.
Calculadoras Interactivas de Arquitectura
Modela el tráfico, la memoria y la disponibilidad de sistemas en producción:
Latency Numbers Every Engineer Must Know
Understanding relative orders of magnitude between CPU, RAM, NVMe, and network hops:
| Hardware Operation | Dean 2009 Baseline | Modern 2026 Datacenter | Human Scale (1ns = 1s) | Architectural Rule of Thumb |
|---|---|---|---|---|
| L1 CPU Cache Reference | 0.5 ns | 0.7–1.0 ns | 1 second | Sub-nanosecond compute; use cache-friendly contiguous arrays. |
| Branch Mispredict | 5 ns | 2–3 ns | 3 seconds | Flushes CPU pipeline; write branchless code in hot paths. |
| Main RAM Reference (DDR4/5) | 100 ns | 50–80 ns | 1.2 minutes | 100x slower than L1; pointer-heavy trees cause cache-miss stalls. |
| Snappy / ZSTD Compression (1 KB) | 10 µs | 1.5–3.0 µs | 50 minutes | CPU compression is 10x faster than transmitting uncompressed wire bytes. |
| Send 2 KB over 1 Gbps Network | 20 µs | 20 µs | 5.5 hours | Wire serialization delay; 25/100G NICs reduce this to ~200 ns. |
| NVMe SSD Random 4 KB Read | ~100 µs | 10–25 µs | 7 hours | Fastest disk storage; ~1,000x faster than rotational HDD seek. |
| Same-Datacenter RTT (Same AZ) | 500 µs (0.5 ms) | 150–300 µs | 3.5 days | 3,000x slower than local RAM. Batch remote calls into single MGETs. |
| Rotational HDD Seek | 10 ms | 8–10 ms | 4 months | Mechanical head motion caps throughput at ~120 IOPS per disk. |
| Cross-Continental RTT (SF to NYC) | ~40 ms | 40 ms | 1.3 years | Speed of light in fiber (200,000 km/s). Requires edge CDNs. |
| Transpacific RTT (CA to Europe/Asia) | 150 ms | 150 ms | 4.75 years | Multi-region synchronous database writes cannot bypass this latency. |
PACELC Database Decision Matrix
CAP only applies during partitions. PACELC explains behavior in normal operations (Latency vs Consistency):
Strict Consensus Databases
Google Cloud Spanner, CockroachDB, Apache HBase, Bigtable
Rejects writes on minority partitions; waits for consensus replication before returning.Best for: Financial ledgers, stock trading, inventory reservation, strict ACID compliance.
Primary-Follower Stores
MongoDB (w:1), PostgreSQL / MySQL (Async Replication)
Preserves linearizability during network splits, but optimizes for sub-millisecond local writes during normal health.Best for: User profiles, e-commerce catalogs, SaaS dashboards.
Eventual-Consistency Leaderless
Apache Cassandra, Amazon DynamoDB, ScyllaDB, Riak
Accepts writes on all partitions; replicates asynchronously in background. Ultra-fast write latency.Best for: High-volume IoT telemetry, shopping cart items, chat history, metrics logs.
Monotonic Timeline Stores
Yahoo! PNUTS (Sherpa), Hazelcast Split-Brain Modes
Guarantees per-record monotonic timeline order under normal conditions while remaining available during datacenter partitions.Best for: Social timeline feeds with master record leases.
HTTP Idempotency & Distributed Status Codes
How distributed gateways and microservices handle retries, timeouts, and concurrency conflicts:
✓Safe vs Idempotent HTTP Methods
👈 Swipe 👉| Method | Safe? | Idempotent? | Auto-Retry Rule |
|---|---|---|---|
| GET / HEAD | Yes | Yes | Safe to replay anytime. |
| PUT | No | Yes | Replaces full state; safe to retry. |
| DELETE | No | Yes | Resource stays deleted; safe to retry. |
| POST / PATCH | No | NO | NEVER retry without Idempotency-Key! |
!Distributed System Error Triage
Retry-After: N header; backoff with full jitter.Back-of-the-Envelope Mental Math Shortcuts
Alex Xu & Google SRE rules to calculate interview numbers in seconds without a calculator:
• 1 Day = 86,400 s ≈ 100,000 s (10⁵ seconds)
• 1 Year = 31.5 × 10⁶ seconds
• 1 Million req/day ≈ 12 QPS
• 100 Million req/day ≈ 1,200 QPS
• 2¹⁰ ≈ 1,000 = 1 KB (Kilobyte)
• 2²⁰ ≈ 1,000,000 = 1 MB (Megabyte)
• 2³⁰ ≈ 10⁹ = 1 GB (Gigabyte)
• 2⁴⁰ ≈ 10¹² = 1 TB (Terabyte)
• 365 × 5 = 1,825 ≈ 2,000×
• Daily Storage × 2,000 ≈ 5-Year Storage
*The extra 175× naturally accommodates index B-tree overhead, write replication, and organic user growth!
Ready to diagram your production system?
Apply these calculations to our interactive Excalidraw canvas or explore real-world blueprints.