Snapshot Support for Performance #248

Open
opened 2025-12-28 20:00:19 -08:00 by jwilger · 0 comments
jwilger commented 2025-12-28 20:00:19 -08:00 (Migrated from github.com)

Overview

Optimize state reconstruction for long-lived streams by periodically saving snapshots and starting reconstruction from snapshot instead of version 0.

Depends on: #247 (Performance Benchmarking Suite) - need performance data to determine if snapshots are necessary and what snapshot frequency makes sense.

Design

SnapshotStore Trait

  • save_snapshot(stream_id, version, state) method
  • load_snapshot(stream_id) returns (version, state)
  • Snapshots stored alongside events
  • Automatic snapshot creation at configurable intervals

Executor Integration

  • Check for snapshot before reading events
  • If snapshot exists, start from snapshot version
  • Apply only events after snapshot

Benchmark-Driven

  • Use benchmark data to determine optimal snapshot frequency

Acceptance Criteria

  • Benchmark data reviewed to determine if snapshots needed
  • SnapshotStore trait defined
  • Snapshot save/load implemented
  • Executor loads from snapshot when available
  • Configurable snapshot frequency
  • Benchmark documents performance improvement

Migrated from beads issue: eventcore-012

## Overview Optimize state reconstruction for long-lived streams by periodically saving snapshots and starting reconstruction from snapshot instead of version 0. **Depends on**: #247 (Performance Benchmarking Suite) - need performance data to determine if snapshots are necessary and what snapshot frequency makes sense. ## Design ### SnapshotStore Trait - `save_snapshot(stream_id, version, state)` method - `load_snapshot(stream_id)` returns `(version, state)` - Snapshots stored alongside events - Automatic snapshot creation at configurable intervals ### Executor Integration - Check for snapshot before reading events - If snapshot exists, start from snapshot version - Apply only events after snapshot ### Benchmark-Driven - Use benchmark data to determine optimal snapshot frequency ## Acceptance Criteria - [ ] Benchmark data reviewed to determine if snapshots needed - [ ] SnapshotStore trait defined - [ ] Snapshot save/load implemented - [ ] Executor loads from snapshot when available - [ ] Configurable snapshot frequency - [ ] Benchmark documents performance improvement --- *Migrated from beads issue: eventcore-012*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jwilger/eventcore#248
No description provided.