For the game where only 1v1 matches are available, should I create NoSQL collections per challenge's instance?
For example, for the card game:
1. collections: cards_at_hand, cards_at_table
2. collections: cards_at_hand_game_challenge1, cards_at_hand_game_challenge2...
I mean that two players in challenge plays only with their cards (each one has about 60 of them) in complete isolation to other challenges/players.
So I guess single collection for "cards at hand" of all challenges can be slow. And I know that player will only ask for his cards or his opponents' cards. So if the collections would be per challenge, I would save a lot of searching (through about 120 records instead of 120 x number of challenges, e.g. 12000).
But should I go this way? If so, how should I generate that collections "on fly" when the challenge begins? Wouldn't that be a drawback to create as many runtime collections as active challenges instances?
First off there is much less persistent data, and without the card-collections being stored in one specific place, the data being sent between turns has less context, so you are more secure against interception (if you are worried about security).
Also, sending only the data required each turn will make it easier to script and manage.
Another alternative if you feel the need for a collection, is to store each player's card collection in the challenge-instance itself. You can add script data to the challenge, so that each time you get a response, you can also access all the cards.
Does that help?
Thank you for an interesting solution.
Or maybe even with such type of card game (that require more data), should I store it between players anyway?
Could you also tell me if collections in challenge-instance are faster then normal one (runtime)? Are they limited to some amount of data?