CSE Roadmap

Core tier · about 2 hours · 6 parts

Part 2 of 6 · 2 min read

Start with consistency needs

Think of consistency needs like a building's foundation requirement. A shed and a bank vault sit on very different ground. Getting that choice wrong is far harder to undo later than almost anything else about the building.

In plain words: The first question is whether the workload can tolerate a brief window of stale or conflicting data. A workload tracking account balances, inventory counts, or anything where two conflicting updates would cause real harm needs strong consistency guarantees, typically a single-leader relational database or a system offering full ACID transactions. A workload like a social media like-count, a page-view counter, or a recommendation cache can tolerate eventual consistency, opening the door to systems that trade consistency for availability and raw throughput. Getting this question wrong in either direction either builds real data-integrity bugs into the product, or pays an unnecessary coordination cost on every single write for data that never needed it.

A worked example. The bookstore's order and payment data needs strong consistency: double-charging a customer or losing a paid order is unacceptable, so this stays on a transactional relational database. The bookstore's "customers who viewed this also viewed" recommendation counts can tolerate being a few minutes stale, so they can live in a faster, eventually consistent store without any real cost to the business.

The key lines. No new SQL; this is a classification step, not a query.

orders, payments:       strong consistency required  -> relational, ACID
view counts, trending:  eventual consistency acceptable -> eventually consistent store

Consistency requirement (workload)

A consistency requirement is how much staleness or conflict a specific piece of data can tolerate before it causes real harm to the business or the user, and it is the first thing to establish about any workload before comparing databases.

Example: the bookstore's payment data has essentially no tolerance for staleness, while its recommendation counts have a great deal.