Tyler-PetrovT
Convex Community9mo ago
2 replies
Tyler-Petrov

Array vs. Reference Relationship Performance

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.
Was this page helpful?