Designing Versioned Catalog Storage + Indexing Strategy in Nakama Storage
Details
Hi! I’m trying to design a clean way to store a versioned item catalog in Nakama Storage and also figure out how to efficiently index and query items based on attributes like category, rarity, type, etc.
By design, I’m storing the entire catalog version as one JSON value, not individual per-item records. Example:
{
"catalog_v1_inventory": [
{
"item_id": "ITEM_001",
"version": 1,
"name": "Starter Item",
"display_name": "Starter Item",
"description": "Sample item for catalog v1.",
"category": "tool",
"type": "equipment",
"linker": "SHOP_GENERAL",
"enabled": true,
"is_deleted": false,
"start_at": "2025-01-01T00:00:00Z",
"end_at": "2026-01-01T00:00:00Z",
"stackable": true,
"max_stack_size": 5,
"max_count": 12,
"consumable": false,
"tradable": true,
"bind_on_equip": true,
"keep_zero": false,
"attributes": {
"rarity": "rare",
"faction": "A"
},
"metadata": {
"season": "2025",
"tier": "base"
},
"string_properties": {
"material": "composite",
"slot": "hand"
},
"numeric_properties": {
"power": 85,
"control": 80
}
}
]
}
I store this whole JSON under:
bucket: catalog
collection: global
key: catalog_v1_inventory
value: {full catalog json}
Later versions will be:
catalog_v2_inventory
catalog_v3_inventory
...
What I’m Trying to Solve
Since my entire catalog lives inside a single JSON value per version, I’m trying to understand the best approach for indexing so I can quickly query items by:
-
category
-
rarity
-
type
-
faction
-
combinations of the above
Because the data is stored as one blob, I can’t use Nakama’s StorageList query filters which work only on bucket/collection/key—not on the internal JSON fields.
What I’m Considering (Looking for Guidance)
I’m thinking of generating parallel index keys per version, such as:
bucket: catalog_index
collection: category_tool
key: v1
value: ["ITEM_001", "ITEM_005", ...]
Or:
collection: rarity_rare
key: v1
value: ["ITEM_001", ...]
Or composite:
collection: category_tool_rarity_rare
key: v1
value: ["ITEM_001"]
This would give me:
-
Load index → get item IDs
-
Load catalog JSON → extract matching items
Has anyone followed a similar pattern?
Is this the recommended way for versioned catalog systems?
Any alternative ideas or patterns using Nakama Storage that work well in production?
Versions
-
Nakama: v3.28.0
-
Runtime Language: Go 1.24.5
-
Database: PostgreSQL
-
Environment: Self-hosted (Linux)
Media / Code Snippets
Happy to share more code if needed — keeping snippets minimal for the post.