Convex schema/functions design advice for dashboard app
Our data model:
- Users create multiple dashboards (~30 per user)
- Each dashboard contains multiple widgets that can be:
- Dragged and resized (x, y, width, height positions)
- Configured with ~10 settings parameters each
- Added/removed dynamically
- Users frequently switch between dashboards (querying full dashboard state)
- Users regularly move/resize widgets (mutating widget's position data)
- Users regularly configure widgets' settings parameters (mutating widget's settings config data)
Some constraints:
- Grid libraries like React Grid Layout provide the entire layout state on each change (not diffs)
- Moving one widget often repositions others automatically
- Users expect snappy drag/resize without lag
- Switching between dashboards should feel fast
Schema options we're considering:
Option A: Normalized
Option B: Hybrid
Option C: Document-centric
Option D: Something else?
I'm looking for any advice or best practices on how to design our schema and queries/mutations to make sure we properly take advantage of Convex's strengths, performance, layout engine constraints while ensuring cost efficiency, performance.
Thank you.
