Working with large Collections

Can someone point me to a good resource on structuring Collections in Wix or general considerations about working with large datasets?

Here’s my plan and why I’m asking. I want to plan for having 200,000 users/members, each with 5 rows of data in a single Collection. So the basic framework is one Collection “User Data” which serves as user profile database, and then the second Collection “Cards” is the database that holds unique items purchased, which are game cards with unique values. I will want to query what could be 1,000,000 records for the player’s game cards so I can read what the player has and then use that data to inform the gameplay.

I read you can page through the data with a loop but I’m not sure that applies since I’ll only be after 5 records, not displaying or pulling every record, but it is a bit of a needle in a haystack situation. I think performance would suffer if I had users repeatedly querying 1,000,000 records every time they login and click a button.

One idea I have is to make several Collections of roughly 100,000 each and then index the location of the player’s cards.

In this case, I would ask Support to add an index on card, so your queries will no longer be sequential, but b-plussed. For a million of rows, it will substantially reduce query time (in fact, without an index, you will prob. run up against a timeout).