Understand how Multisynq automatically saves and restores session state for persistence and new user synchronization
Snapshots are automatic copies of the model state that Multisynq saves to the cloud. This system provides seamless persistence and enables new users to join existing sessions efficiently without replaying the entire event history.
Snapshots are serialized copies of your complete model state, saved periodically to the cloud. They capture:
Snapshots are taken automatically by the Multisynq system - you don’t need to manually create them.
Automatic Creation
The Multisynq reflector periodically requests one of the session participants to create a snapshot of the current model state.
Cloud Storage
The snapshot is compressed and stored in the cloud, associated with your session ID.
Restoration
When needed, the snapshot is loaded and your model state is restored exactly as it was.
Automatic save functionality for your application
When users quit or reload:
Automatic save functionality for your application
When users quit or reload:
Efficient joining of existing sessions
When a new user joins an active session:
1. Snapshot Loading
The local model is initialized with data from the last snapshot
Your model’s init()
method is NOT called when loading from a snapshot.
2. Event Replay
The reflector resends all events transmitted after the snapshot
Event replay is deterministic - the same events produce the same results.
3. Model Simulation
The model simulates all events to bring the snapshot up-to-date
4. View Initialization
The local view initializes to match the model state
Important: When writing your View initialization, account for the fact that the Model may have been restored from a snapshot and already contains data.
Current Limitation: The snapshot system is currently unoptimized and may cause performance hitches when snapshots are taken.
Until the system is optimized, you can:
Keep your model state snapshot-friendly
Design views to handle existing state
init()
Test your snapshot behavior
Optimize for snapshot performance
Detect if your model loaded from a snapshot
Detect if your model loaded from a snapshot
Verify snapshot state is correct
🎮 Game State Snapshots
Preserving game progress across sessions
💬 Chat History
Preserving conversation history
The Multisynq development team is working to make snapshots invisible to both users and developers:
Learn about explicit persistence beyond snapshots
Master model development for snapshot-friendly code
Learn to handle both fresh starts and snapshot loads
Understand time-based behaviors in snapshotted sessions
Snapshots are fundamental to Multisynq’s persistence and scalability. Understanding how they work will help you design better models and views that handle session continuity seamlessly.