Convex schema/functions design advice for dashboard app
We're building a dashboard-focused web app and need Convex schema/function design advice for handling frequent layout updates efficiently.
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.
3 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Can someone who is an expert in Convex please answer, because I'm really unsure how to proceed 😅
Or at least tell me if kapa's advice is accurate? https://discord.com/channels/1019350475847499849/1405446046892560384
Kapa is correct, go normalized.