Quick summary · Chapter 12
Databases and Data-Bound Technologies
The essential ideas, decisions, and diagrams from this chapter. Follow the section links for the examples, calculations, and fuller argument.
Plan the work as well as the space
Suppose someone asks for more storage. I want to know what data and copies the service has to keep, and what it does with them on an ordinary day. Then I want to know where the work can run when a node fails and how much time we have to recover. Ten free terabytes on a different node won’t help the busiest partition. They won’t speed up a transfer that is already waiting on the network either.
Cassandra: the data model is part of the capacity plan
Cassandra’s partition key determines how data is grouped into partitions. Rows sharing that key stay together on their replica nodes, so adding nodes does not subdivide the partition. The project’s modeling guidance starts with the queries the application needs to support.1 That makes the distribution of partition sizes and activity much more interesting to me than the result of dividing total bytes by node count.
Kafka: retention is a promise to a future reader
A Kafka consumer tracks its position in a partition’s log and can return to earlier positions to read retained records again. Consuming a record does not instruct Kafka to delete it. Under the delete policy, retention limits govern deletion, while log compaction preserves the latest value for a key rather than a complete event history.2 Before estimating storage, I want to know which of those things the customer expects to have available when they return.
A deletion does not settle the storage question
PostgreSQL updates and deletes leave old row versions for later reclamation. Routine vacuuming makes that space reusable, and it also freezes old transaction IDs; if freezing falls far enough behind, PostgreSQL stops assigning new ones and accepts only read-only transactions until vacuum catches up. Ordinary VACUUM generally does not return space to the operating system. VACUUM FULL rewrites the table, so it needs room for a complete new copy and an exclusive lock that blocks all other use of the table until it finishes.3
Build a data-capacity decision record
A forecast reviewer doesn’t need to know as much about compaction as the Cassandra specialist. They do need to know whether repair and expansion can both finish while the customer keeps using the service. I use a record like this to carry that part of the explanation into the spending decision.
| Record | What the decision needs |
|---|---|
| Business obligation | Customer, useful outcome, retention purpose, latency requirement, recovery deadline, and who may change each commitment |
| Data footprint | Logical versus physical measurements, indexes and logs included, replica scope, growth and deletion assumptions, and placement distribution |
| Work and limits | Foreground demand, tested bottleneck, maintenance backlog and its deadline, effective transfer or replay rate, and competing work |
| Operating scenarios | Normal service, maintenance, expansion, a specified failure, recovery, and migration overlap; identify which coincide |
| Evidence boundary | Engine version, configuration, schema/query assumptions, measurement window, test conditions, and unresolved questions |
| Decision | Action, cost, resource location, lead time, accountable owner, review trigger, and the consequence if the assumption is wrong |
Each specialist brings the measure that fits the work: repair time for Cassandra, replay progress for Kafka, obsolete rows awaiting vacuum for PostgreSQL. The common part is what that evidence lets the business promise.
Apache Cassandra documentation, “RDBMS design” and “Data Definition”, checked October 3, 2026. Query-first modeling and partitions as undivided units of storage; the customer example is hypothetical.↩︎
Apache Kafka 4.3 documentation, “Design”, checked October 3, 2026; the downloads page still listed 4.3.1 (June 25, 2026) as the newest release when rechecked October 4, 2026. Replay of retained records; consumption versus deletion and key compaction.↩︎
PostgreSQL 18 documentation, “Routine Vacuuming”, checked October 3, 2026. Reuse versus release, the steady-state goal,
VACUUM FULL’s copy andACCESS EXCLUSIVElock, and read-only operation near wraparound.↩︎