CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/Gaming

🎮 Gaming · Database ERD

Game Player and Inventory Schema

Tables for an online game: players, characters, items, inventories, currencies, purchases and match history.

More Gaming templates

Drawing diagram…

What this diagram shows

  • A player can have several characters
  • Inventory rows link characters to item definitions
  • Every purchase and currency change is recorded

Prompt used

Online game database schema: players have accounts and wallets for soft and hard currency; each player has characters; item definitions describe weapons and cosmetics; inventory entries link characters to items with quantity; purchases record real-money transactions; matches store results for each participating character.

Mermaid code
erDiagram
  PLAYER ||--o{ CHARACTER : owns
  PLAYER ||--|| WALLET : has
  CHARACTER ||--o{ INVENTORY_ITEM : holds
  ITEM ||--o{ INVENTORY_ITEM : "instance of"
  PLAYER ||--o{ PURCHASE : makes
  CHARACTER ||--o{ MATCH_RESULT : "plays in"
  MATCH ||--|{ MATCH_RESULT : records
  PLAYER {
    int id PK
    string username
    string region
  }
  WALLET {
    int id PK
    int player_id FK
    int coins
    int gems
  }
  CHARACTER {
    int id PK
    int player_id FK
    string class
    int level
  }
  ITEM {
    int id PK
    string name
    string rarity
  }
  INVENTORY_ITEM {
    int id PK
    int character_id FK
    int item_id FK
    int quantity
  }
  PURCHASE {
    int id PK
    int player_id FK
    string store_txn_id
    decimal amount
  }
  MATCH {
    int id PK
    string mode
    datetime started_at
  }
  MATCH_RESULT {
    int id PK
    int match_id FK
    int character_id FK
    int score
    string outcome
  }

Related templates

C4 ArchitectureProGaming

Multiplayer Game Backend Architecture

The backend for an online multiplayer game: player accounts, matchmaking, dedicated game servers, leaderboards and in-game purchases.

SequenceGaming

Game Matchmaking Sequence

How a player gets into a match: joining the queue, skill-based matching, server allocation and connecting to the game server.

State MachineGaming

Multiplayer Game Session States

The states of an online match on a game server: lobby, loading, in progress, pauses, reconnects and results.

Data FlowGaming

Game Leaderboard Data Pipeline

How match results turn into leaderboards and rankings: result events, anti-cheat checks, rating updates and cached leaderboards.

DeploymentProGaming

Global Game Server Deployment

How an online game runs servers close to players worldwide: regional fleets, a global matchmaker, and central account and store services.

FlowchartGaming

In-App Purchase Flow

How an in-game purchase is completed safely: store purchase, receipt validation on the server, granting items and handling refunds.