Building application logic on top of inconsistent data does more than degrade the experience — it exposes the system to exploits. A paper on "ACIDrain" attacks studied 12 of the most popular self-hosted e-commerce applications and identified at least 22 possible critical attacks; one Bitcoin wallet service had to shut down as a result. Choosing a distributed database that is not fully ACID is risky territory, and because of misinterpretations, badly defined terminology, and aggressive marketing, engineers struggle to determine what guarantees a given database actually offers.
Concretely, this can surface as wrong account balances, unreceived user rewards, trade transactions executed twice, messages appearing out of order, or violated application rules. A distributed database keeps copies of data in multiple locations for scale, latency, and availability. The anomalies below are illustrated with game-development examples — trading systems, messaging, conditional awards — because their complexity resembles serious real-life problems, but the equivalent failures appear in bank transfers and email clients.

Stale reads
A stale read returns data that does not yet reflect the latest writes. Many databases suffer from this, including traditional systems scaled up with read replicas.
Take two players encountering a chest of gold. The first receives data from one database server; the second is connected to another. User 1 opens the chest and retrieves the gold. User 2 sees a full chest, opens it, and fails — yet still sees a full chest and does not understand why. It looks minor, but the second player is both disadvantaged and repeatedly sees things that appear to exist but do not.

Worse is when a player acts on a stale read. A character buys a shield and a sword; the purchase goes to one node, while the inventory check hits another that has not caught up. Seeing neither item, the user assumes the transaction failed and buys again. When the replica catches up, the account has spent double and has duplicates it never wanted. The same pattern breaks email clients: send, refresh, no sent mail, send again.
On the engineering side, you must always code around the possibility that something is not there yet, and faults disappear before you can investigate them — you end up chasing ghosts. Many teams pick eventually consistent databases because the problems surface slowly; once they arise, the teams build custom workarounds on top of their traditional database, as guides for PostgreSQL and MySQL attest. That Cassandra ships consistency features of its own shows the problems are real and common. Such custom solutions are complex and brittle.
Traditional databases using master-read replication — PostgreSQL, MySQL, SQL Server — typically exhibit stale reads. Cassandra started out eventually consistent and later added extra measures to avoid the anomaly. CouchDB and DynamoDB are eventually consistent by default, as is Riak, which adds conflict resolution to reduce outdated values without making the data fully safe.
Lost writes
When writes occur concurrently, a database must either make all nodes agree on their order — requiring synchronized clocks and specific hardware, or an algorithm like Calvin that does not rely on clocks — or let each node write locally and reconcile conflicts afterwards. The second choice loses writes.

With 11 gold, a player buys a sword for 5 and a shield for 5, routed to different nodes. Both read 11 and both write 6. The player gets both items for 5 gold. Databases counter this with strategies such as last write wins (LWW) or longest version history; LWW is Cassandra's long-standing strategy and remains its default.

Under LWW, the player ends with 6 gold and only one item, although the application confirmed both purchases — an inventory the database does not recognize.

Security rules built on such data are unsafe. An admin makes a public group private and says so; the user, possibly on another node, starts adding sensitive data to a group that is technically still public.
Debugging is also hard: when a user reports lost data a day before you respond, you must determine whether the database or your logic caused it. Databases that track history, like FaunaDB or Datomic, let you travel back in time — but neither is vulnerable to lost writes, while the databases that are typically lack this feature.
Every database that resolves rather than avoids conflicts loses writes. Cassandra and DynamoDB default to LWW; MongoDB used to and has since moved away. Master-master setups in MySQL offer several strategies. Riak's simplest is LWW, with more intelligent systems on top; even then, some conflicts have no obvious resolution, so Riak and CouchDB let the client or application choose which version to keep. Because distribution is complex and most algorithms are imperfect, lost writes are common when nodes crash or partitions occur. Even MongoDB, which does not distribute writes, can hit conflicts if a node goes down immediately after a write.
Write skew
Snapshot consistency reads from a snapshot taken when the transaction starts. It prevents many anomalies, and many considered it fully secure until papers proved otherwise.
A knight and a mage each have four hearts. Each attack runs a transaction computing remaining hearts:
damageCharacter(character, damage) {
character.hearts = character.hearts - damage
character.dead = isCharacterDead(character)
}
After each attack, another function checks whether the character is dead:
isCharacterDead(character) {
if ( character.hearts <= 0 ) { return true }
else { return false }
}
Run sequentially, the knight's strike removes three hearts from the mage and the mage's spell removes four from the knight while restoring the mage, all correct:

Now let a third transaction — a second knight's strike — run concurrently with the mage's spell:

Snapshot systems typically apply "the first committer wins": a transaction can only commit if no other transaction wrote the same row, otherwise it rolls back. Here both transactions write the mage's health, so only Life Leech succeeds and the second strike rolls back — a dead knight and a full-health mage. But MySQL/InnoDB do not treat "first committer wins" as part of snapshot isolation, yielding a lost write: the mage dies though the leech should have healed him before the strike took effect.
Snapshot consistency with the first-committer rule is still sold under conflicting names: PostgreSQL calls it "repeatable read," Oracle calls it "serializable" (incorrect by the definition above), SQL Server "snapshot isolation."
Consider two armies, where an army is dead when all its characters are:
isArmyDead(army){
if (<all characters are dead>) { return true }
else { return false }
}
After each attack, a function determines whether a character has died and then whether the army has died:
damageArmyCharacter(army, character, damage){
character.hearts = character.hearts - damage
character.dead = isCharacterDead(character)
armyDead = isArmyDead(army)
if (army.dead != armyDead){
army.dead = armyDead
}
}
Hearts are reduced, the army is checked, and if its state changed, the dead boolean is updated:

Three mages each attack once. All transactions start together, so they take identical snapshots in which every knight has full health:

Each transaction kills its own knight, sees two healthy knights and one dead one in its snapshot, and concludes the army is alive. All knights end up dead, but the boolean stays false — a ghost army. The writes go through because each wrote a different character and the army row never changed.
The same mechanism breaks data quality. To enforce unique names, a create-user transaction checks whether the name exists and otherwise writes it; two concurrent signups write different rows, do not conflict, and both succeed. Martin Kleppmann's Designing Data-Intensive Applications describes further examples.

One mitigation is to make the database rather than the application pick the target: getFirstHealthyCharacter always targets the same knight, so concurrent attacks write the same row and all but one roll back under first-committer-wins. This prevents the anomaly, but the developer must understand it and code around it. Any database offering snapshot isolation instead of serializability can suffer write skew.
Out-of-order writes
Strong consistency means agreeing on a global order: parallel purchases of sword and shield behave as if the sword came first. This is linearizability, the gold standard for safe data. Serializability is slightly weaker and covers most anomalies, but leaves room for writes to be reordered even after commit. Without a guaranteed order, out-of-order writes follow.
Conversations can be ordered confusingly when a second message is sent by mistake:

Shopping behaves similarly. A player with 11 coins buys items in order of importance without checking the balance; the database may reorder the buys, purchasing the least important item first. This matters when an overdraft has a cost, as at a bank: a sale meant to top up the balance can be reordered to the end, pushing the balance below zero and incurring charges.
Security settings face the same problem. An admin makes a group private while the user adds sensitive data; the admin's action may not complete before the user's. Serializability shrinks the window but does not close it. Load balancing across nodes can reorder two consecutive manipulations just the same, and a trading bot whose user first changes the stock list and then the spending limit may spend the newly allocated budget on the old stocks.
Exploits can depend on reversals too. A trophy awarded at 1,000 gold counts the gold across a player's storage and inventory. By quickly swapping money between the two — with a partner ensuring the transfers land in separate transactions and thus possibly on different nodes — the player cheats the requirement.

In banking, a third account used to route a transfer can make the institution miscalculate loan eligibility because the transactions are spread across nodes without time to settle. Any database without linearizability is exposed, and few provide it.
Bounded consistency reopens everything
Some systems guarantee strong consistency only within bounds — a datacenter region, a partition, a node, a collection, a row. Program against such a database and every anomaly above can return once you cross a boundary.
Take three collections — players, smithies, and items — where each player and smithy holds a list of item ids:

Trading a shield between Brecht and Robert stays in one collection, so consistency holds. But if Robert's sword is at the smithy and he retrieves it, the transaction spans the smithy and player collections and the guarantees are forfeited. Document databases such as MongoDB commonly impose such limits, forcing creative workarounds — for example, encoding an item's location on the item itself.

Real games need items dropped on the floor or placed on a market, owned by a player but not in his inventory. As complexity grows, these workarounds significantly increase technical depth and reshape how you write code to stay inside the database's guarantees.

The examples above share a common shape: a database that does not behave the way the application assumes. Some of these failures look minor in isolation, but their cost compounds as a system scales, and they create openings for unpredictable security exploits that can damage an application's reputation well beyond the original defect.
It helps to lay the guarantees side by side, now that the failure modes behind them are concrete:
| Stale reads | Lost writes | Write skew | Out of order writes | |
|---|---|---|---|---|
| Linearizability | safe | safe | safe | safe |
| Serializability | safe | safe | safe | unsafe |
| Snapshot consistency | safe | safe | unsafe | unsafe |
| Eventual consistency | unsafe | unsafe | unsafe | unsafe |
Each of these correctness guarantees can also come with boundaries:
| Row-level boundaries | The guarantees delivered by the database are only honored when the transaction reads/writes to one row. Manipulations such as moving items from one player to another can cause issues. HBase is an example database that limits guarantees to one row. |
| Collection-level boundaries | The guarantees delivered by the database are only honored when the transaction reads/writes to one collection. E.g., trading items between two players stays within a “players” collection, but trading them between a player and an entity from another collection such as a market opens the door to anomalies again. Firebase is an example which limits correctness guarantees to collections. |
| Shard/Replica/Partition/Session boundaries | As long as a transaction only affect data on one machine or shard, the guarantees hold. This is, of course, less practical in distributed databases. Cassandra has recently started offering serializability features if you configure them, but only within a partition. |
| Regionboundaries | Some databases almost go all the way and provide guarantees across multiple nodes (shards/replicas), but their guarantees do not hold anymore if your database is distributed across multiple regions. Such an example is Cosmos. Cosmos is a great technology, but they have chosen an approach where consistency guarantees are limited to one region. |
The anomalies and guarantees covered here are only a subset of the whole. Martin Kleppmann's Designing Data-Intensive Applications is the recommended next read for anyone who wants the fuller picture.
There is, however, a practical reason the trade-offs discussed earlier no longer have to be accepted: strongly consistent databases without those limitations now exist. New approaches such as Calvin (FaunaDB) and Spanner (Google Spanner, FoundationDB) provide multi-region distributed databases that deliver good latencies while behaving as the application expects in each of the scenarios above — which raises the question of why anyone would still choose a database that does not offer these guarantees.
The next article in the series looks at the developer-experience side: why is it so hard to convince developers that consistency matters? The short answer is that most people need to experience the problem before they see the necessity. The question to keep in mind is this: "If bugs appear, is your app wrong, or is it the data? How can you know?" Once the database's limitations surface as bugs or bad user experiences, the workaround is inefficient glue code that does not scale — and by then the investment is deep enough that the realization comes too late.



