When to Use
UseMemoryStorageAdapter when:
- Developing and testing locally
- Re-indexing is fast enough for your use case
- You don’t need persistence between restarts
Configuration
src/storage/memory-adapter.ts
Options
| Option | Type | Default | Description |
|---|---|---|---|
namespace | string | 'default' | Namespace (for consistency with other adapters) |
Behavior
- No persistence: Data is lost on restart
- No cache validation:
hasValidCache()always returnsfalse - Fast: No I/O overhead
src/memory-behavior.ts
Development Pattern
src/development.ts
Testing Pattern
src/testing.ts
Switching Adapters
Easy to switch between adapters for different environments:src/adapter-switching.ts
Related
Storage Overview
Storage fundamentals
File Adapter
Persist to disk
Redis Adapter
Multi-pod storage