Skip to content

Storage Adapters

core/StorageAdapter.ts defines the storage contract. MemoryAdapter, FilesystemAdapter, and IndexedDBAdapter implement it for process-local, Node filesystem, and browser IndexedDB use cases.

Applications attach an adapter with engine.useStorage(adapter), then call persist(name) and resume(name). Saves contain serialized Chronicle state; the Engine also exposes save listing, deletion, and auto-save controls. Adapter persistence is separate from network synchronization and does not automatically make a peer authoritative.

Compaction is a Chronicle operation rather than an adapter feature. It reduces the retained document history but discards everything before the new epoch, and it must be coordinated across peers as described in Chronicle.