prooph/snapshot-store
Lightweight snapshot store for prooph/event-sourcing setups. Provides a simple API to persist and load aggregate snapshots, reducing replay time and improving performance. Note: library support ended Dec 31, 2019 (deprecated).
igbinary) allows optimization for performance or compatibility with legacy systems.prooph/event-sourcing and prooph/snapshotter. If the team uses Prooph, this is a low-effort add-on; otherwise, requires additional setup.serialize(), JSON, or custom callbacks, accommodating diverse use cases.Strategic Alignment:
Snapshot Strategy:
Persistence Layer:
Fallback Resilience:
Long-Term Viability:
prooph/event-sourcing, this is a drop-in; otherwise, requires compatibility checks.CompositeSnapshotStore).serialize() but supports custom strategies (e.g., igbinary for performance).Assessment Phase:
Prooph Integration:
composer require prooph/event-sourcing prooph/snapshotter prooph/snapshot-store
$snapshotStore = new PdoSnapshotStore(
$pdoConnection,
['snapshot_table' => 'aggregate_snapshots'],
'default',
new CallbackSerializer('igbinary_serialize', 'igbinary_unserialize')
);
$repository = new PdoAggregateRepository(
$pdoConnection,
$metadata,
$snapshotStore
);
Composite Store (Optional):
$cacheStore = new RedisSnapshotStore($redis);
$persistenceStore = new PdoSnapshotStore($pdo);
$compositeStore = new CompositeSnapshotStore([$cacheStore, $persistenceStore]);
Snapshotter Configuration:
prooph/snapshotter to take snapshots after specific events or periodically:
$snapshotter = new EventSnapshotter($snapshotStore, $serializer);
$snapshotter->takeSnapshot($aggregate, $eventStream);
Testing & Validation:
prooph/event-sourcing version.UserProfile) to validate performance gains.Order, Inventory) with monitoring.How can I help you explore Laravel packages today?