game-database

Design PostgreSQL schemas for multiplayer game-state persistence with JSONB.

3|Updated Dec 14, 2025
One-click install
npx skills add https://github.com/fil512/upship --skill game-database
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: game-database
Source: https://github.com/fil512/upship/tree/main/.claude/skills/game-database
Command: npx skills add https://github.com/fil512/upship --skill game-database

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Design robust PostgreSQL schemas for multiplayer games and ensure scalable, consistent game-state storage.

Core Features & Use Cases

  • Hybrid schema design with users, games, game_players, and game_states for lobby management, matchmaking, and persistence.
  • JSONB-based game state to store complex, nested data while keeping it queryable.
  • ACID transactions, optimistic locking, and versioned state to ensure consistency and reliable history.

Quick Start

Create the PostgreSQL schema shown, run migrations, and begin persisting and querying game state with JSONB.

Frequently Asked Questions about game-database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a PostgreSQL schema for multiplayer game state persistence?

Design a PostgreSQL schema for multiplayer game state persistence by using a hybrid relational structure for users, games, and game_players, alongside JSONB columns to store complex, nested game states queryably. This approach ensures scalable and consistent storage for lobbies and matches.

When should I use JSONB columns for game state storage in PostgreSQL?

Use JSONB columns for game state storage in PostgreSQL when you need to persist complex, dynamic, or nested data structures that change frequently, while still requiring the ability to query and index specific attributes within that game state.

How do I maintain transactional integrity and consistency for multiplayer game matches?

Maintain transactional integrity and consistency for multiplayer matches by applying ACID transactions, optimistic locking, and versioned state patterns. This ensures reliable history tracking and prevents data races during concurrent game state updates.

Can I use this PostgreSQL schema design for lobby management and matchmaking?

Yes, you can use this PostgreSQL schema design for lobby management and matchmaking. It explicitly supports structured schemas for lobbies, user accounts, and game_players, enabling reliable match persistence and scalable player grouping.

What is the best way to version dynamic game state in a relational database?

The best way to version dynamic game state in a relational database is to combine JSONB storage for the nested data with optimistic locking and versioned state columns. This ensures consistent history and reliable conflict resolution during updates.

Does this multiplayer game database schema require migration tooling?

Yes, this multiplayer game database schema requires migration tooling. The design explicitly satisfies requirements for structured schemas and migration tooling to run schema changes and begin persisting game state reliably.