Volume 5 · Chapter 7 — Storage and Databases

Choosing the Right Data Store

Goutham Mayaluri 7 min read AWSCloudStorageDatabases

7.1 Introduction

AWS offers many data services, and a hallmark of senior engineering is choosing the right one for each need rather than forcing everything into a single database. This “purpose-built database” mindset - matching the store to the data’s shape, access pattern, scale, and consistency needs - is a common system-design and interview theme. This chapter synthesizes the volume into a decision framework for picking among S3, EBS, EFS, RDS/Aurora, DynamoDB, and ElastiCache.

7.2 The Decision Dimensions

The choice comes down to a few questions. What’s the shape and access pattern of the data - relational with complex queries and joins, simple key-based access at scale, large objects, a disk, a shared filesystem, or hot cache reads? What consistency and transactional guarantees does it need - full ACID for money, or is eventual consistency acceptable? What scale and latency are required - massive throughput with predictable low latency, or moderate load with rich querying? And what durability and retention - long-term archival, or live operational data? Answering these points you to the right service, and the senior instinct is to ask them explicitly rather than defaulting to a familiar database for everything.

flowchart TD
  Start{What do you need?} --> R{Relational, complex queries,\nACID transactions?}
  R -->|Yes| RDS[RDS / Aurora - system of record]
  R -->|No| K{Simple key access,\nmassive scale, low latency?}
  K -->|Yes| DDB[DynamoDB]
  K -->|No| O{Large objects, backups,\narchival, durable at scale?}
  O -->|Yes| S3[S3]
  O -->|No| Disk{A disk for one instance?}
  Disk -->|Yes| EBS[EBS]
  Disk -->|No| Shared{Shared filesystem\nfor many instances?}
  Shared -->|Yes| EFS[EFS]
  Shared -->|No| Hot[Hot reads to speed up? ElastiCache]

7.3 Mapping Needs to Services

Concretely: use RDS or Aurora for relational data needing complex queries, joins, and ACID transactions - the system of record, a bank’s ledger. Use DynamoDB for simple key-based access at massive scale with predictable low latency - sessions, profiles, high-volume events. Use S3 for durable, scalable objects, backups, logs, archives, and data lakes, with lifecycle tiering for cost. Use EBS when a single instance needs a persistent high-performance disk (a self-managed database or local storage). Use EFS when many instances must share a filesystem. Use ElastiCache to cache hot, stable reads in front of a database for latency and load relief. Most real systems combine several - a relational system of record, DynamoDB for high-scale simple access, S3 for objects and backups, and a cache in front - each serving what it’s best at.

7.4 Polyglot Persistence in Practice

Using multiple purpose-built stores together is called polyglot persistence, and it’s the norm in serious systems. The benefit is that each workload runs on the store best suited to it - integrity-critical data on ACID relational, scale-and-speed data on DynamoDB, bulk and archival data on S3, hot reads accelerated by a cache - rather than compromising everything onto one database. The cost is added complexity: more services to operate, and the need to keep data consistent across them (using the reliable, idempotent propagation patterns from the previous chapter). The senior judgment is that this complexity is usually worth it for the right fit, but you don’t multiply stores needlessly - you add a purpose-built store when a workload genuinely benefits, and you keep the authoritative state clearly owned by one system.

7.5 Banking Production Scenario

A bank’s data architecture is deliberately polyglot. The authoritative account and transaction ledger runs on Aurora PostgreSQL for ACID integrity and complex queries. High-scale, simple-access workloads - sessions, profiles, activity events - run on DynamoDB for predictable low latency at scale. Statements, backups, logs, and compliance archives live in S3 with lifecycle tiering to control cost and object lock for immutability. A legacy application’s working data sits on encrypted EBS, and a shared content directory on EFS. ElastiCache fronts the database for hot reference and profile reads, while authoritative balances always come from the ledger. Each store serves what it’s best at, the ledger clearly owns the authoritative financial state, and cross-store consistency is maintained with reliable, idempotent event propagation.

7.6 Troubleshooting: Wrong-Store Symptoms

Many performance and correctness problems are really wrong-store choices. A relational database struggling under massive simple-key load suggests that workload belongs in DynamoDB. Difficulty doing joins or complex queries in DynamoDB suggests that data belongs in a relational store. Expensive block volumes holding rarely- accessed bulk data suggests it belongs in S3 with lifecycle tiering. Repeated identical database reads hammering the primary suggest a missing cache. Integrity problems in a NoSQL store handling money suggest the authoritative ledger should be ACID relational. The diagnostic move is to step back and ask whether the data’s shape, access pattern, scale, and consistency needs match the store it’s in - and to move or split the workload onto the purpose-built service that fits, rather than forcing the wrong store to do a job it’s not built for.

Interview Question

How do you choose the right data store on AWS, and what is polyglot persistence?

I choose a data store by matching it to the data’s shape, access pattern, scale, consistency needs, and durability requirements, rather than defaulting to one familiar database for everything - the purpose-built database mindset. I ask a few questions. What’s the shape and access pattern: relational data with complex queries and joins, simple key-based access at scale, large objects, a disk for one server, a shared filesystem, or hot cache reads? What consistency and transactional guarantees does it need: full ACID for money movement, or is eventual consistency acceptable? What scale and latency: massive throughput with predictable low latency, or moderate load with rich querying? And what durability and retention: long-term archival, or live operational data? The answers map to services: RDS or Aurora for relational data needing complex queries and ACID transactions, which is the system of record and a bank’s ledger; DynamoDB for simple key-based access at massive scale with predictable low latency, like sessions, profiles, and high-volume events; S3 for durable, scalable objects, backups, logs, and archives, with lifecycle tiering for cost; EBS when a single instance needs a persistent high-performance disk; EFS when many instances must share a filesystem; and ElastiCache to cache hot, stable reads in front of a database for latency and load relief. Polyglot persistence is the practice of using several of these purpose-built stores together in one system, each for the workload it’s best at, rather than compromising everything onto a single database. Its benefit is fit: integrity-critical data runs on ACID relational, scale-and-speed data on DynamoDB, bulk and archival data on S3, and hot reads are accelerated by a cache - so each workload gets the store designed for it. The cost is complexity: more services to operate and the need to keep data consistent across them, which you handle with reliable, idempotent propagation patterns and by keeping authoritative state clearly owned by one system. The senior judgment is that this is usually worth it for the right fit, but you don’t multiply stores needlessly - you add a purpose-built store when a workload genuinely benefits and keep the source of truth well-defined. So a real banking architecture is deliberately polyglot: an Aurora PostgreSQL ledger for ACID integrity, DynamoDB for high-scale simple access, S3 for objects and archives, a cache for hot reads - each doing what it’s best at, with the ledger owning authoritative financial state. The mark of good data architecture is exactly this: choosing per workload and combining purpose-built stores, rather than forcing one database to do everything.

Chapter Revision Notes

  • Choose by data shape, access pattern, consistency/transaction needs, scale/latency, and durability/retention - not by default.
  • RDS/Aurora (relational + ACID), DynamoDB (key access at scale), S3 (durable objects/archives), EBS (single-instance disk), EFS (shared files), ElastiCache (hot-read cache).
  • Polyglot persistence: combine purpose-built stores, each for the workload it fits best.
  • The cost is complexity and cross-store consistency; keep authoritative state owned by one system and propagate reliably/idempotently.
  • Many performance/correctness issues are wrong-store choices - match the workload to the purpose-built service.