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!
4 Replies
@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
That makes sense! Thank you
@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.
Awesome, will dig in!