Quick revision
The short answer
I would frame it around access patterns, amplification and money over three years rather than around engine preferences. Append-heavy writes with per-customer key reads favour an LSM engine such as Cassandra or ScyllaDB, while ad hoc queries, joins and transactions favour PostgreSQL; at 500,000 events per second we must quantify write, read and space amplification in machines, weigh the operational skills each option needs, model the three-year cost and exit path of a managed service, and design the data lifecycle so that most of the three years lives in cheap object storage rather than in the hot store.
What to remember
In this answer, we saw that the decision starts with numbers: 500,000 events per second is 43 billion events and several terabytes per day, which makes lifecycle planning essential. Append writes with per-customer reads favour LSM engines, while flexible queries and transactions favour PostgreSQL. We convert write, read and space amplification into machines, weigh operations and skills, model the three-year cost and exit path of a managed service, and keep only recent data hot while older events move to columnar files in object storage, with a week-long proof of concept to confirm the choice.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would frame it around access patterns, amplification and money over three years rather than around engine preferences. Append-heavy writes with per-customer key reads favour an LSM engine such as Cassandra or ScyllaDB, while ad hoc queries, joins and transactions favour PostgreSQL; at 500,000 events per second we must quantify write, read and space amplification in machines, weigh the operational skills each option needs, model the three-year cost and exit path of a managed service, and design the data lifecycle so that most of the three years lives in cheap object storage rather than in the hot store.
Why this question is asked
This is the kind of decision that is hard to reverse: once billions of events and dozens of consumers depend on a store, migrating away takes years. Interviewers ask it at the most senior level to see whether we can structure a decision with numbers and long-term costs, rather than defend a favourite technology. In this answer, we will turn the requirement into numbers, compare the engines against the access patterns, put amplification and operations into cost terms, treat build versus buy honestly, and plan the data lifecycle, finishing with the proof of concept that should settle it.
1Turning the Requirement Into Numbers
The first step is to make the scale concrete, because it changes the answer. 500,000 events per second is 43.2 billion events per day. If an event is about 200 bytes before compression, that is about 8.6 TB per day, and three years is roughly 9.5 PB of raw data, before replication. With three replicas that is almost 30 PB. Even at a compression ratio of 4, keeping all of it in a hot, replicated store means many petabytes of fast disks.
These numbers alone show that the lifecycle of the data matters as much as the engine. They also tell us what to ask the business: is the 3-year requirement for interactive queries, or for retention and occasional retrieval? The answer usually is the second.
2Matching Engines to Access Patterns
Next we write down the access patterns precisely. Writes are appends of immutable events, keyed by customer and time. Reads are per customer: the last 30 days of events for customer 123, or the events of one order. If that is all, an LSM engine is a natural fit: writes are sequential, and a partition key of (customer_id, month) with events clustered by time turns each read into one partition slice.
PostgreSQL is a B-tree based row store. It handles ad hoc queries, joins, secondary indexes and transactions far better, but 500,000 inserts per second with indexes is beyond a single primary, so we would need partitioning by time plus sharding across many primaries, for example with an extension like Citus, and careful vacuum management. If the product needs flexible queries across customers, that cost may be justified; if it needs only key-based reads, it is paying for features we do not use.
| Criterion | PostgreSQL (sharded) | Cassandra / ScyllaDB | Managed service |
|---|---|---|---|
| append writes at 500k/s | possible with many shards | natural fit | fit, priced per request |
| per-customer key reads | good with indexes | good with partition design | good |
| ad hoc queries and joins | strong | weak, model per query | usually weak |
| operations burden | vacuum, sharding, upgrades | compaction, repair, tombstones | low, provider runs it |
| lock-in and exit | low, standard protocol | low to medium | medium to high |
3Putting Amplification Into Machines
At this scale, small efficiency differences become large hardware bills. Write amplification decides how much disk bandwidth we need: if an engine writes each byte 10 times through compaction, 8.6 TB per day of input becomes 86 TB per day of disk writes per replica, which drives the number and type of disks. Space amplification decides how many terabytes we provision beyond the live data, and read amplification decides how much I/O and cache each query costs.
So we estimate these for each candidate from tests with our own event shape, not from blog posts, and convert them into nodes. For example, if a ScyllaDB node sustains 100,000 writes per second with our schema at acceptable latency, we need at least 5 nodes for raw throughput, then multiply for replication, headroom for compaction and failures, and growth. Doing the same for PostgreSQL shards and for the managed service's pricing makes the options comparable.
4Operations and Skills
Every engine moves work to the operators somewhere. Cassandra and ScyllaDB need compaction strategy choices, regular repairs, and data models that avoid tombstone problems. PostgreSQL needs partition management, vacuum tuning, a sharding layer and replication. A managed service removes most of that, but we still own data modelling, capacity limits and cost control.
The skills already in the company weigh heavily over three years. If we run a strong PostgreSQL platform team and nobody has operated Cassandra, choosing Cassandra means hiring, training and a period of incidents. That is not a reason to avoid it, but it belongs in the cost model next to hardware.
5Build or Buy, With an Exit Path
A managed offering such as DynamoDB or a managed Cassandra-compatible service turns operations into a bill. At 500,000 writes per second, per-request pricing is significant, so we model it at our real volume, including reads, storage and cross-region replication, and compare it with the three-year total cost of running our own clusters, including engineers' time. We should model reserved or provisioned capacity too, because on-demand pricing is usually the most expensive at a steady high rate.
We also price the exit. A proprietary API ties applications to the provider; a Cassandra-compatible API or keeping events also in an open format in our own object storage keeps an exit available. A decision record should state how we would leave and roughly what it would cost.
6Planning the Data Lifecycle
The largest saving usually comes from not keeping three years in the hot store. Events older than, say, 90 days are exported to object storage in a columnar format such as Parquet, partitioned by date and customer range, and queried with an engine like Trino, Spark or a warehouse when needed. The hot store then holds about 580 TB instead of many petabytes, and the old data costs a fraction per terabyte. Time-based TTLs or dropping time partitions remove data from the hot store cheaply.
- IngestKafka topic buffers 500k events/s
- Hot store, 90 daysLSM cluster or sharded PostgreSQL, per-customer reads
- Warm exporthourly Parquet files to object storage
- Cold archive, up to 3 yearsobject storage lifecycle rules, query engine on demand
4 layers, from the top down. Step through them one at a time.
7Follow-up questions
What proof of concept would you run before deciding?
I would generate realistic events, with our size distribution and customer skew, at 500,000 per second and above, into each short-listed option for at least a week, so compaction, vacuum and repairs reach a steady state. I would measure write latency, p99 read latency for the real per-customer queries, disk and CPU per node, amplification, recovery time after killing a node, and for the managed service the actual bill. Each option gets the same test written by the same team.
Why put Kafka in front of the store?
It absorbs bursts and lets the store fall briefly behind without losing events, and it lets several consumers, such as the hot store writer and the Parquet exporter, read the same stream independently.
When would PostgreSQL win this decision?
If the product really needs flexible queries across customers, transactions with other data, or the volume is much lower than forecast, a time-partitioned and sharded PostgreSQL may be cheaper overall, especially where the company already has deep PostgreSQL skills.
8Conclusion
In this answer, we saw that the decision starts with numbers: 500,000 events per second is 43 billion events and several terabytes per day, which makes lifecycle planning essential. Append writes with per-customer reads favour LSM engines, while flexible queries and transactions favour PostgreSQL. We convert write, read and space amplification into machines, weigh operations and skills, model the three-year cost and exit path of a managed service, and keep only recent data hot while older events move to columnar files in object storage, with a week-long proof of concept to confirm the choice.
Open with
I would frame it in four steps. First, numbers: 500,000 events a second is 43 billion a day, at about 200 bytes that is 8.6 TB a day and around 9.5 PB raw over three years before replication.
Then, if they want more
That tells me the hot store must not hold three years, so I would ask whether three years means interactive queries or retention, and plan a lifecycle where events older than about 90 days go to Parquet in object storage.
Second, access patterns: appends keyed by customer and time with per-customer reads fit an LSM engine like Cassandra or ScyllaDB very well, with a partition key of customer and month. PostgreSQL wins if we need ad hoc queries, joins or transactions, but at this rate it needs time partitioning and sharding across many primaries.
Third, cost: I would measure write, read and space amplification with our own event shape and turn them into node counts, add operations, meaning compaction and repairs for Cassandra or vacuum and sharding for PostgreSQL, and be honest about the skills we already have.
For a managed service I would model per-request pricing at our steady rate, reserved capacity and the exit path, preferring compatible APIs or a copy of events in open formats.
Fourth, I would decide with a week-long proof of concept at full rate for each short-listed option, measuring p99 reads, node failure recovery and the real bill, and record the decision with its reasons.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- PostgreSQL documentation, MySQL reference manual
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Your company is choosing the storage engine for a new event history service expected to...": https://scrivio-interview-library.netlify.app/databases/storage-internals/af1e778fd0/