
🎮 Gaming · Database ERD
Tables for an online game: players, characters, items, inventories, currencies, purchases and match history.
Drawing diagram…
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.
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
}The backend for an online multiplayer game: player accounts, matchmaking, dedicated game servers, leaderboards and in-game purchases.
How a player gets into a match: joining the queue, skill-based matching, server allocation and connecting to the game server.
The states of an online match on a game server: lobby, loading, in progress, pauses, reconnects and results.
How match results turn into leaderboards and rankings: result events, anti-cheat checks, rating updates and cached leaderboards.
How an online game runs servers close to players worldwide: regional fleets, a global matchmaker, and central account and store services.
How an in-game purchase is completed safely: store purchase, receipt validation on the server, granting items and handling refunds.