Quick revision
The short answer
Like counts, display names on old comments and the stock count on a product page can all be eventually consistent, because a slightly stale value harms nobody. The wallet debit and the reservation of the last unit must be strongly consistent at the moment of decision, using one authoritative record with an atomic or conditional update, because a stale read there means overspending or selling the same unit twice. The rule is to pay for strong consistency only where a stale read causes real harm.
What to remember
In this answer, we saw that like counts, display names on old comments and product page stock can be eventually consistent because stale values harm nobody and the truth is checked later, while the wallet debit and the reservation of the last unit need strong consistency at the decision point, done with a single authoritative record and an atomic conditional update. We pay for strong consistency only where a stale read causes real harm.
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.
Like counts, display names on old comments and the stock count on a product page can all be eventually consistent, because a slightly stale value harms nobody. The wallet debit and the reservation of the last unit must be strongly consistent at the moment of decision, using one authoritative record with an atomic or conditional update, because a stale read there means overspending or selling the same unit twice. The rule is to pay for strong consistency only where a stale read causes real harm.
Why this question is asked
Consistency is often discussed as a property of a whole system, but in practice each feature chooses. Making everything strongly consistent is slow and expensive at scale, and making everything eventual causes real money bugs. Interviewers ask this question to see whether we can reason about the harm of a stale read feature by feature, and whether we know that the same data can be read loosely in one place and strictly in another. In this answer, we will recap the two models, go through the five features one by one with the reason for each choice, and show the atomic updates that protect the two places where strong consistency is needed.
1A Quick Recap of Strong and Eventual Consistency
With strong consistency, once a write is committed every read sees it. In practice that means reads and writes for a value go through one authority, such as the primary database or a quorum of replicas, which costs latency and limits how far we can spread the load.
With eventual consistency, replicas, caches and derived copies receive changes after a delay, so a read may return a value that is a little old, but all copies converge if writes stop. It is cheaper and scales well. The deciding question for each feature is: what goes wrong if a user sees a value that is a few seconds old, and who pays for it?
2Deciding Feature by Feature
Like counts are eventual. If a listing shows 1,204 likes when the true number is 1,207, nobody is harmed, and counting every like exactly and synchronously at scale is costly. We can count in a cache or a stream and update the displayed number every few seconds.
A user's display name on old comments is eventual too. Comments often store a denormalised copy of the name so a page of comments needs no join. When the user changes their name, a background job updates the old comments over the next minutes, and nobody minds if a few still show the old name for a while.
The stock count shown on a product page is eventual. It may be read from a cache or a search index that lags by seconds. Because it can be wrong when stock is low, a common choice is to show wording such as 'only a few left' instead of an exact number below a threshold. The authoritative check happens at checkout, not on the product page.
| Feature | Choice | Why |
|---|---|---|
| Like counts | eventual | a few seconds stale harms nobody |
| Wallet balance: the debit | strong | a stale balance allows overspending |
| Wallet balance: shown in a list | eventual is fine | display only, the debit rechecks |
| Reserving the last unit | strong at the decision | else two buyers get one unit |
| Display name on old comments | eventual | copies updated in the background |
| Stock on the product page | eventual | checkout does the strong check |
3The Wallet: Strong at the Debit
A wallet balance is money, and a stale read can let a user spend the same funds twice: two purchases read a balance of 50, each sees enough for 40, and both succeed. So the debit must go through one authoritative record and be atomic. The simplest way is a conditional update that checks and changes the balance in one statement, so the database does the check under its own row lock.
Notice that the second statement waits for the first one's row lock and then re-evaluates the condition against the new balance, so it updates nothing. The application checks the row count and refuses the purchase. In a real wallet we would also write a ledger entry in the same transaction. Showing the balance in a list or on a dashboard, though, can come from a replica a moment old, because the debit itself always checks the truth.
4The Last Unit: Strong at the Decision Point
Reserving stock has the same shape. If two buyers both read 'stock = 1' from a cache and both reserve, we have sold one unit twice. At the moment of reservation, we must decide against the authoritative stock row, either with a conditional update like the wallet's or by locking the row with SELECT ... FOR UPDATE inside a transaction.
Everywhere before that point, such as browsing, search and the product page, can stay eventual. That is the general pattern: strong consistency is needed at the decision that commits money or a scarce item, not at every place the value is displayed.
5The General Rule
Strong consistency has a price in latency, availability and scaling, so we pay it only where a stale read causes real harm, usually where money changes hands or a scarce resource is allocated. Everything else, counts, names, displays and recommendations, can be eventually consistent, as long as we know the expected delay and the decision points recheck the truth.
6Follow-up questions
What does strong consistency cost in latency when data is replicated across zones?
A strongly consistent write must be acknowledged by more than one zone before it is committed, either a synchronous standby or a quorum. Within one region, zones are usually a millisecond or two apart, so each write gains a few milliseconds, and the system may refuse writes if it cannot reach enough zones. Across regions, the round trip can be 50 to 150 ms per write, which is why cross-region strong consistency is used only for the data that truly needs it.
Could the like count become a problem if it is eventual?
Only if something important depends on it, such as ranking with payouts or fraud detection. Then we keep the cheap eventual counter for display and compute the important figure separately from a durable log of like events, deduplicated by user and listing.
Why not read the stock for the product page from the primary too?
Because product pages are read far more often than checkout happens, and sending every page view to the primary would load it heavily for a number that may change a second later anyway. The checkout check protects correctness; the page only needs to be roughly right.
7Conclusion
In this answer, we saw that like counts, display names on old comments and product page stock can be eventually consistent because stale values harm nobody and the truth is checked later, while the wallet debit and the reservation of the last unit need strong consistency at the decision point, done with a single authoritative record and an atomic conditional update. We pay for strong consistency only where a stale read causes real harm.
Open with
I would decide by asking what a stale read costs for each feature. Like counts are eventual: a number a few seconds old harms nobody, and exact counting at scale is expensive.
Then, if they want more
The display name on old comments is eventual too: comments keep a denormalised copy and a background job updates them. The stock number on the product page is eventual, often shown as 'only a few left' when low, because the real check happens at checkout.
The wallet is different: the debit must be strongly consistent against one authoritative record, for example a conditional update that subtracts only where the balance is high enough, so two purchases cannot both spend the same money. Displaying the balance in a list from a replica a moment old is fine.
Reserving the last unit is strong at the decision point too, with a conditional update or a row lock on the stock row, otherwise two buyers get the same unit. The general rule is to pay for strong consistency only where money or a scarce item is committed, and let everything that is only displayed be eventual.
About this answer
- Last updated
- 13 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 official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
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 "For a marketplace, decide strong or eventual consistency for: like counts on listings, a...": https://scrivio-interview-library.netlify.app/architecture/sd-fundamentals/0816a04ce0/