# Persistence and replication scope

> Why PostgreSQL WAL replaces AOF, RDB and Redis replication.

---

LLMS index: [llms.txt](/llms.txt)

---

## Decision {#decision}

PostgreSQL WAL, checkpoints, physical/logical backups (`pg_basebackup`, `pg_dump`/`pg_restore`) and PostgreSQL streaming replication are the only durability and high-availability mechanisms in pgredis. Redis-native file persistence (AOF, RDB, `SAVE`, `BGSAVE`, `BGREWRITEAOF`, `DEBUG RELOAD`) and Redis replication (`REPLICAOF`, `SLAVEOF`, `SYNC`, `PSYNC`) are outside the product scope.

## Upstream test conflicts {#conflicts}

An audit of the 39 official Redis 7.2.4 test files (1,914 required test cases) identified 55 cases that invoke Redis-native persistence or replication mechanisms alongside ordinary data assertions:

| Redis-native mechanism | Affected upstream cases |
| --- | ---: |
| `SYNC`, `REPLICAOF` or an external Redis replica | 17 |
| AOF files, `BGREWRITEAOF` or AOF loader startup | 20 |
| `DEBUG RELOAD` (save and reload RDB in place) | 12 |
| `BGSAVE` child process or background-save rehash behavior | 1 |
| RDB startup configuration | 1 |
| Persisting a non-empty `save` schedule | 4 |

Because pgredis stores all keys in PostgreSQL tables rather than an in-memory heap backed by RDB/AOF files, it rejects these commands rather than faking a no-op success reply.

## How mixed test cases are verified {#handling}

1. **Unchanged official test counts:** Official Redis 7.2.4 test files are run without editing their Tcl bodies or silently skipping assertions. When a file hits `DEBUG RELOAD` (for example in `unit/type/list`) or AOF/replica setup (in `unit/type/stream` and `unit/type/stream-cgroups`), the failure or abort remains visible in the official matrix counts.
2. **Retained ordinary obligations:** For the 55 mixed cases, `tests/differential/retained-scope-obligations.json` maps the 24 groups that contain ordinary data, TTL, encoding, queue, Stream, `DUMP`/`RESTORE` or configuration assertions onto PostgreSQL recovery tests (normal restart, immediate shutdown WAL recovery and logical `pg_dump`/`pg_restore`).
3. **Clear separation of claims:** Passing PostgreSQL restart and WAL recovery suites (such as the `246,784`-assertion mixed-dataset recovery run on commit `e8cb31f5`) verifies durability of Redis data types in PostgreSQL storage; it does not claim compatibility with Redis AOF, RDB file loaders or Redis replication protocols.

---

Backlinks:

- [Design](/docs/redis/design/)
- [MVP goal (v0.1.0)](/docs/redis/design/mvp-goal/)
