Skip to main content

Overview

PrismStorage provides a single protocol for all persistence needs. Every engine conforms to the same interface, making stores interchangeable and composable.

Unified Protocol

Actor-based stores conform to PrismAsyncStorageProtocol — same methods with async throws.

Architecture

Quick Start

Concurrency

All stores are Sendable. Actor-based stores (PrismDiskStore, PrismMemoryStore, PrismModelStore) provide safe concurrent access. Sync stores use NSLock internally.

Next Steps

Defaults & Disk

UserDefaults and file-based persistence.

SwiftData

Type-safe persistence with @Model and PrismModelStore.

Encryption & Compression

AES-GCM encryption and LZFSE/LZMA compression wrappers.

Advanced

Composite stores, batch operations, migrations, observation.
Need to store secrets securely? See Encryption & Keychain in PrismSecurity for keychain-backed secret storage with biometric protection.