Storage
Learn about SoulCache's storage adapters for persistence
Storage
Storage adapters persist cache data across sessions via the StorageManager.
StorageAdapter Interface
All storage adapters must implement this interface:
Usage
Built-in Adapters
| Adapter | Description |
|---|---|
MemoryAdapter | Default in-memory storage, suitable for most use cases |
Custom Adapters
Implement the StorageAdapter interface to create custom adapters:
Features
Pluggable Backends
Swap storage adapters without changing application code
Automatic Serialization
Data is automatically serialized/deserialized for storage
Error Handling
Graceful fallback when storage is unavailable
Quota Management
Automatic monitoring and management of storage limits
Best Practices
Storage Guidelines
- Choose the right adapter — Consider performance and persistence needs
- Handle errors — Storage may be unavailable in some environments
- Monitor quota — Avoid exceeding storage limits
- Use compression — For large datasets