Implement snapshot-based persistence similar to Redis RDB.
Commands
- `SAVE` — synchronous snapshot to disk
- `BGSAVE` — background snapshot (goroutine)
Behavior
- On startup, load the last snapshot if it exists
- Configurable save interval (e.g. every N seconds if M keys changed)
- Binary or GOB encoding for the data store
- Write to temp file, then atomic rename
Implementation
- New `internal/store/persistence.go`
- Snapshot format: encode `map[string]*Item` with GOB or custom binary format
- Config: snapshot path, auto-save interval
- SAVE/BGSAVE handlers in `internal/commands/server.go`
Implement snapshot-based persistence similar to Redis RDB.
Commands
Behavior
Implementation