Volume 5 · Chapter 13 — Storage and Databases
Volume Summary and Interview Rapid-Fire
13.1 What This Volume Covered
This volume covered where data lives and how it stays correct: S3 object storage with tiering and security, block and file storage (EBS and EFS), managed relational databases (RDS and Aurora) with Multi-AZ and read replicas, DynamoDB for NoSQL scale, ElastiCache for in-memory caching, financial transaction integrity through ACID, isolation, and idempotency, and a framework for choosing the right store. The unifying themes are matching the store to the workload (purpose-built, polyglot persistence), keeping correctness-critical data on an ACID source of truth, and using caching and read replicas to scale reads without compromising the authoritative write path. The rest of this chapter consolidates the essentials.
13.2 Rapid-Fire Interview Questions
Object vs block vs file storage?
Object (S3): API-accessed, durable, unlimited - backups, content, archives. Block (EBS): a disk attached to one instance - databases, local storage. File (EFS): a shared filesystem many instances mount concurrently. Match to the access pattern.
How do S3 lifecycle policies save money?
They automatically transition aging objects to cheaper storage classes (Standard → infrequent-access → archival) and can expire them. Cold data drifts to cheap storage without manual work, keeping years of compliance data affordable.
Why do public S3 bucket leaks happen, and how do you prevent them?
They’re a customer misconfiguration - assuming AWS keeps data private when access config is your responsibility. Prevent with block-public-access on, least-privilege policies, KMS encryption, and SCP guardrails denying public buckets.
Multi-AZ vs read replica?
Multi-AZ is a synchronous standby in another AZ for automatic failover (availability) - it doesn’t serve reads. Read replicas are asynchronous copies that serve read-only queries to scale reads - they don’t auto-failover. Often used together.
What does Aurora add over standard RDS?
Cloud-native performance, storage replicated six ways across three AZs, faster automated failover, and efficient low-latency read replicas sharing storage - all with full relational/ACID guarantees, at higher cost. Choose it for demanding, critical workloads.
DynamoDB vs relational - the key design difference?
Relational: model normalized data, query flexibly afterward. DynamoDB: design keys around your access patterns first. Choose relational for complex queries/joins/ACID; DynamoDB for massive scale, low latency, and simple key access.
What should and shouldn't you cache?
Cache hot, stable, staleness-tolerant reads (reference data, profiles, config, sessions) for latency and load wins. Never cache correctness-critical values like a balance authorizing a payment - read those from the ACID source of truth.
State the ACID properties.
Atomicity (all-or-nothing), Consistency (valid state to valid state), Isolation (concurrent transactions don’t interfere), Durability (committed changes survive crashes). Non-negotiable for money movement, which is why the ledger is relational.
Why is idempotency essential for financial operations?
Because requests get retried and messages redelivered, so an operation may arrive more than once, and a retried “transfer $100” must not become $200. An idempotency key makes processing exactly-once, reconciling at-least-once delivery with exactly-once financial effect.
What is polyglot persistence?
Using multiple purpose-built data stores together, each for the workload it fits best - ACID relational for integrity, DynamoDB for scale, S3 for objects/archives, a cache for hot reads. The cost is complexity and cross-store consistency; keep authoritative state owned by one system.
13.3 Closing
Data is the most valuable and least forgiving part of a system - the place where correctness, durability, and consistency truly matter - and this volume’s lessons recur throughout the series: choose purpose-built stores per workload, keep money on an ACID source of truth with idempotent, concurrency-safe operations, and scale reads with caches and replicas without weakening the write path. With compute and data established, the next volume turns to seeing inside running systems: observability and operations.