Omar Farooq
Omar Farooq17mo ago

Say we wanted to build a feature that shows how many followers a user has on a platform..

Convex arrays max at 8k values, this is plenty for current use case but curious how you would advise to handle this in the case of a user having more than 8k followers. Do you suggest having a new field for the overflow arrays, ie a seperate field of followers ID array for each 8,192 limit? Thanks for any insights!
No description
4 Replies
jamwt
jamwt17mo ago
@Omar Farooq in this case we'd recommend you use a separate "junction" or association table with indexes this will scale a lot better than single enormous documents
Omar Farooq
Omar FarooqOP17mo ago
That makes sense! Thank you
jamwt
jamwt17mo ago
@ian has an article that explores some of this here: https://stack.convex.dev/relationship-structures-let-s-talk-about-schemas
Relationship Structures: Let's Talk About Schemas
In this post we’ll look at some patterns for structuring relationships in the Convex database.
Omar Farooq
Omar FarooqOP17mo ago
Awesome, will dig in!

Did you find this page helpful?