#Array vs. Reference Relationship Performance

2 messages · Page 1 of 1 (latest)

mint gale
#

I'm looking to migrate to Convex from MongoDB. From what I've read in the docs, Convex leans more to the normalized/relational way of storing data. MongoDB is on the totally opposite side and is denormalized with no built-in relationships. Coming from this background I have a question:

If I have a one-to-many relationship, should I put an array of child ids in the parent document, or put a reference to the parent document id in the child document?

The aim of my question is toward performance, not necessarily DX wins/loses. I'm newer to Convex, so feel free to add as much context as you can for the new guy.

toxic graniteBOT
#

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](https://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!