You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user views a classroom, every small state change (switching scenes, chat updates during playback) triggers saveStageData() which writes the entire stage to storage — all scenes, all chat sessions, all metadata — regardless of what actually changed.
For IndexedDB this is fine (fast local write), but the interface design makes it hard to optimize for any scenario where writes have real cost.
Why now
There have been several community discussions around adding persistent storage options (cloud sync, database backends, etc.). If we're going to support pluggable storage, the current all-or-nothing saveStageData interface will become a bottleneck — every backend would need to handle redundant full-state writes, or build its own diffing layer on top.
Splitting the save interface before those features land means storage backends can be implemented cleanly from the start, rather than retrofitting dedup/diff logic later.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Background
When a user views a classroom, every small state change (switching scenes, chat updates during playback) triggers
saveStageData()which writes the entire stage to storage — all scenes, all chat sessions, all metadata — regardless of what actually changed.For IndexedDB this is fine (fast local write), but the interface design makes it hard to optimize for any scenario where writes have real cost.
Why now
There have been several community discussions around adding persistent storage options (cloud sync, database backends, etc.). If we're going to support pluggable storage, the current all-or-nothing
saveStageDatainterface will become a bottleneck — every backend would need to handle redundant full-state writes, or build its own diffing layer on top.Splitting the save interface before those features land means storage backends can be implemented cleanly from the start, rather than retrofitting dedup/diff logic later.
Idea
Split
saveStageDatainto focused operations:Each store action calls only the relevant save —
setScenes()→saveScenes(),setChats()→saveChatSessions(), etc.The IndexedDB implementation could batch these into a single transaction internally, so no behavior change for self-hosted users.
Trade-offs
Pros:
Cons:
Curious what others think — especially anyone working on persistent storage features.
Beta Was this translation helpful? Give feedback.
All reactions