# Event Stream Persistence

Once you decide to store events, you have to decide *how* — what database table holds them, how aggregate identity and version are constrained at the storage layer, what happens when you rename a class, and how PII fields are encrypted. This section covers those choices.

The pages below are mostly independent — read the one that matches the problem in front of you:

{% content-ref url="/pages/jbxT1HoQUhNgU8J6i1L6" %}
[Persistence Strategies](/modelling/event-sourcing/event-sourcing-introduction/persistence-strategy/persistence-strategies.md)
{% endcontent-ref %}

How Ecotone lays out events on disk: simple append-only streams, partitioned streams (one stream per aggregate with version uniqueness), or a single global stream. Pick the one that matches your concurrency and ordering needs.

{% content-ref url="/pages/bQjhJA1srvfbksNhXzKm" %}
[Event Sourcing Repository](/modelling/event-sourcing/event-sourcing-introduction/persistence-strategy/event-sourcing-repository.md)
{% endcontent-ref %}

When you already store events somewhere else (EventSauce, Patchlevel, your own table) and want Ecotone to read/write through that storage instead of its built-in event store.

{% content-ref url="/pages/mj2uWvqhmLMTmbAWdtAH" %}
[Making Stream immune to changes](/modelling/event-sourcing/event-sourcing-introduction/persistence-strategy/making-stream-immune-to-changes.md)
{% endcontent-ref %}

You renamed `App\Order\Order` to `App\Sales\Order` — now production events still reference the old class. `#[NamedEvent]`, `#[Stream]`, and `#[AggregateType]` decouple stored event names from PHP class names so refactors don't break stored data.

{% content-ref url="/pages/WU1Ga8Qf49eemoZ5tFFC" %}
[Snapshoting](/modelling/event-sourcing/event-sourcing-introduction/persistence-strategy/snapshoting.md)
{% endcontent-ref %}

Your aggregate has 50,000 events and rehydration takes seconds. Snapshots store a periodic checkpoint so the aggregate loads from `snapshot + recent events`.

{% content-ref url="/pages/8MSSHXx2eRxXEY5LgNiZ" %}
[Event Serialization and PII Data (GDPR)](/modelling/event-sourcing/event-sourcing-introduction/persistence-strategy/event-serialization-and-pii-data-gdpr.md)
{% endcontent-ref %}

Your event store contains user emails. The user requests deletion under GDPR and your store is append-only. Crypto-shredding via per-subject keys satisfies the requirement without rewriting events.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ecotone.tech/modelling/event-sourcing/event-sourcing-introduction/persistence-strategy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
