nemophrostN
Convex Community9mo ago
3 replies
nemophrost

One to one relationships vs returning partial records

Is there a performance or cost benefit to separating data into multiple tables with one to one relationships vs storing all the data into one table and returning partial records if that’s what you need?

Example:
Books table with title, author, page count, etc
Chapter summaries as a separate 1:1 table (bookId with an index) vs chapter summaries as a field on the books table.

To just query for a list of books with multiple tables, I can just query and return from the books table. If a single table I could remove the chapter summaries before returning data to the client to keep bandwidth down.

Then if I want a list of books or a single book with summaries I could either join that data (convex style) or just not filter it out.

Are there considerations other than the 8MiB data read limit for queries (possible downside to a single table) and having an extra index (possible downside to 2 tables)?
Was this page helpful?