# Old events must still decode

> For agents: start with the [agent guide](https://ratstack.sh/llms.txt). Every page is Markdown by default; add `Accept: text/html` for HTML.

Free workshop: [Build Agent Loops That Never Stop Shipping](/tokenmaxx#interested).

Historical records remain useful only while consumers can translate their versions. A deployment can break recovery without changing newly produced data.

> Schema evolution ensures that the consumer can translate it to a familiar version.

Source: [Q12](/lore/durability-bibliography#q12); [B5](/lore/durability-bibliography#b5-building-event-driven-microservices), [B14](/lore/durability-bibliography#b14-refactoring-databases).

## Failure it prevents

A new consumer cannot decode already-accepted work.

## Our Effect 4.0.0 reading

`Schema.decodeUnknownEffect` validates a representation. Define supported versions and transformations; the decoder does not choose the compatibility policy.

Source: `packages/effect/src/Schema.ts`, `packages/effect/src/persistence/PersistedQueue.ts`.

## How to check

Keep old payload fixtures. Decode and restore them with the proposed consumer before removing old representations. This check is our proposal. The books do not prescribe it.

Continue with [Shared schemas need a transition period](/lore/schema-changes-need-a-transition), [Replay needs stable inputs](/lore/replay-needs-stable-inputs).

Connect this to [the existing rat-stack guidance](/lore/schemas-define-the-boundary).

Use [the durability skill](/skills/durability) for the full review. Return to [the durability index](/lore/durability).

## Sources

1. [Bellemare, Adam. Building Event-Driven Microservices: Leveraging Organizational Data at Scale. O’Reilly, 2020.](https://www.oreilly.com/library/view/building-event-driven-microservices/9781492057888/)
   O’Reilly. Chapter 3 Communication and Data Contracts; Chapter 6 Deterministic Stream Processing; Chapter 7 Stateful Streaming; Chapter 9 Microservices Using Function-as-a-Service; Chapter 14 Supportive Tooling. Accessed 2026-10-23.

2. [Ambler, Scott W.; Sadalage, Pramod J. Refactoring Databases: Evolutionary Database Design. Addison-Wesley, 2006.](https://www.amazon.com/Refactoring-Databases-Evolutionary-paperback-Addison-Wesley/dp/0321774515)
   Addison-Wesley. §3.11 What You Have Learned (transition period); Chapter 4 Deploying into Production. Accessed 2026-10-23.

3. [Effect contributors. Effect 4.0.0. Schema.ts](https://github.com/Effect-TS/effect/blob/67ba4e46a11ccda0b6761578bfd22c04ae00167d/packages/effect/src/Schema.ts)
   Effect-TS. Pinned source for our Effect mapping, not a claim from the book. Accessed 2026-10-23.

4. [Effect contributors. Effect 4.0.0. persistence/PersistedQueue.ts](https://github.com/Effect-TS/effect/blob/67ba4e46a11ccda0b6761578bfd22c04ae00167d/packages/effect/src/persistence/PersistedQueue.ts)
   Effect-TS. Pinned source for our Effect mapping, not a claim from the book. Accessed 2026-10-23.

## Linked from

- Agent guide → An Effect stack so pure (aspirational) Kit Langton will blush. → [Read page](https://ratstack.sh/llms.txt)

- Change log → What changed in the files served here, newest first. → [Read page](https://ratstack.sh/log)

- Durability bibliography → Books, checked short quotations, source limits, and Effect mapping provenance. → [Read page](https://ratstack.sh/lore/durability-bibliography)

- Durability starts with a recovery record → A reading order for storage, replay, worker ownership, overload, and recovery tests. → [Read page](https://ratstack.sh/lore/durability)

- Full agent guide → An Effect stack so pure (aspirational) Kit Langton will blush. → [Read page](https://ratstack.sh/llms-full.txt)

- Rat Stack lore | rat-stack → Short, source-grounded notes on the ideas and decisions behind rat-stack. → [Read page](https://ratstack.sh/lore)

- Replay needs stable inputs → Historical processing must not silently depend on today’s clock or external decisions. → [Read page](https://ratstack.sh/lore/replay-needs-stable-inputs)

- Shared schemas need a transition period → Keep old and new representations usable while consumers migrate. → [Read page](https://ratstack.sh/lore/schema-changes-need-a-transition)

- Source change history (log.md) → The generated change log as Markdown. → [Read page](https://ratstack.sh/log.md)
