Get a value by key
Storage key
Value or undefined if not found
Set a value with optional TTL
Storage key
Value to store
Optionalttl: numberTime to live in seconds (optional)
Delete a value by key
Storage key
Check if a key exists
Storage key
OptionalclearClear all stored values (optional)
OptionalkeysGet all keys (optional, for debugging)
OptionalsizeGet storage size/count (optional, for monitoring)
Generic storage interface for caching and persistence
Users can provide their own implementations (Redis, database, etc.) The library provides a default in-memory implementation