Read-your-writes
How Silos uses LSN tokens to guarantee a session sees its own writes, even when reads come from a lagging replica.
Read-your-writes is the default consistency level. It guarantees that within a session, any read reflects that session's own prior writes — so the classic "I just inserted a row and my next query doesn't see it" problem doesn't happen, even when reads are served by replicas that lag the primary.
The mechanism: LSN tokens
Silos uses log sequence number (LSN) tokens to make this work:
A write returns an LSN
When you commit a write, the primary records its position in the write-ahead log as an LSN. That LSN is, in effect, a watermark: "the database is at least this current."
A read can carry a minimum LSN
A subsequent read can pass a minimum LSN — the position it needs the data to have reached. The default session behavior tracks your latest write's LSN automatically.
The router enforces it
The router checks the candidate replica's position:
- If the replica has caught up to the required LSN, it serves the read locally.
- If the replica is behind, the router waits for it to catch up, or routes the read to the primary, which is always current.
This gives you local-latency reads when the nearby replica is fresh enough, and a correct fallback when it isn't — without you having to reason about replica lag.
What it guarantees (and what it doesn't)
- Guarantees: within a session, you never read older than your own latest write.
- Does not guarantee: that you see writes made by other sessions instantly. Those
may still be slightly behind on a replica. If you need the freshest cross-session
data, use
strongconsistency, which reads from the primary.
When to use a stronger level
Read-your-writes is the right default for most application logic. Step up to bounded staleness if you need a freshness bound across sessions, or strong if every read must reflect the absolute latest committed state globally. See Consistency levels.
LSN-token read-your-writes is implemented, but it operates over the rolling-out replication path. Until cross-region streaming is production-proven, the dependable way to always read your latest write across regions is to read from the primary. See the Replication overview.