Where can I store and how can I access game content databases?

Hey there!

I’ve started developing my game, and its async. The client sends requests to the server and receives data back, rather than running match-based sessions.

The game is similar in structure to things like My Singing Monsters or Dragon City, where the server needs to hold databases for things such as monster names, stats, breeding combinations, and other content-related info.

My main issue is that this data will be updated quite frequently, since i plan to add new content in most updates. Because of that, I’m not exactly sure what the best place is to store this kind of data, or what the best way is to access it from Nakama running on an EC2 instance.

I’d also like the client to have access to this data as well, mainly for stuff that does not need server validation, so I can avoid excessive server calls (For example, Stat UI for the monsters)

I originally had my databases stored as JSON files in my typescript project, however this quickly proved to be really awkward. It was being compiled into the code, which meant i would have to restart the server every time I wanted modify this. It also meant getting the data more awkward than it needed to be.

Basically, I’m looking for a solution that is:

  • easy to update as new content is added
  • practical to use with Nakama on EC2 (My server data is in a private GitHub repo that I’m modifying remotely while developing)
  • Can be accessed by my TypeScript project for server side code, such as getting the breeding result, or buying a new monster.

What would the best way to handle this kind of frequently updated game data? Thank you!

  1. Versions: Nakama 3.22, Postgres:15-apline, Unity SDK
  2. TypeScript / JavaScript
Heres some example data:
    
     {
      "elementalID": 1,
      "species": "Bellig",
      "elements": "A",
      "memorySound": "Entities/Elementals/Clinkoah/MemorySound/SFX_Memory_Clinkoah",
      "eggImage": "Entities/Elementals/Bellig/GFX/GFX_Elemental_Egg_Bellig",
      "nicknames": [
        "Bellsworth",
        "Elior",
        "Voltair",
        "Regalton",
        "Claremont",
        "Jevin",
        "Aurick",
        "Lexton",
        "Dominel",
        "Bellrick"
      ],
      "kin": "Kin_Electro",
      "bays": 1,
      "goldPerMinute": 2,
      "maxGold": 10,
      "snacksToLevel": 5
    },

Hi @FuryFTF,

I’d just use the Storage Engine and store each monster in a dedicated storage object under some collection (e.g.: monsters) but with empty user_id (meaning these objects are not owned by a specific user, and will be automatically assigned to the System user - nil UUID as the user_id).

You can then use storageList to fetch all the monsters in the collection.

I think it’s reasonable to require the game to fetch the list at startup (requiring the game to be online at first) and then cache it locally to allow it to be used offline.

I’d encourage you to upgrade to Nakama latest release as 3.22 is a bit old at this point.

Best