Skip to content

feat: RDB-like persistence (SAVE, BGSAVE, auto-load) #4

Description

@zulerne

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`

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions