I want to start implementing this with the right foot so looking for some advice here on best practices.
My use case:
- game currently contains about 300 different items
- each user can have unlimited items (but realistically up to 1000)
What is the best way to store these items held by each user?
Each item is stored in an ITEMS collection with its ID for a key for each user.
items are stored in a USERDATA collection with ITEMS key as:
Are there other options than this? I really hope there are and that I misunderstand the framework because:
- Option 1: you end up with thousands of records in the storage engine, but makes it easier to lookup individual items for each user
- Option 2: it isn’t very granular and you have to read entire collection to find one item and the write the whole collection back to the server even if only one was changed. But it keeps the db records to a lower number.
What is the “Nakama way” of implementing the storage for this use case?
Many thanks in advance for your time.