Multiplayer Game Backend ER diagram and database schema
The Multiplayer Game Backend database schema is a DB Planner template with 30 tables, 245 columns and 67 relationships, free to use. Core tables include achievements, currencies, friendships, game_modes. It can be opened as an interactive ER diagram or exported as PostgreSQL, MySQL, or SQL Server DDL.
- Tables
- 30
- Columns
- 245
- Relationships
- 67
- Category
- Gaming
- Exports
- DBML, SQL, C#
- Price
- Free
What this schema models
A complete multiplayer game backend database design, built the way live-service games protect their economies and ranked ladders: 30 tables, 19 enums and 67 relationships covering player accounts with linked platform identities, a currency wallet ledger, items and inventory, store offers and receipt-validated purchases, seasons, game modes, matchmaking tickets and match results, append-only rating history and leaderboard snapshots, achievements, friends, parties and guilds, and player reports and sanctions. THE FOUR DESIGN RULES 1. A wallet is a ledger, never a balance column. Every credit and debit of every currency is an insert into wallet_ledger_entries with its cause (purchase, match reward, store spend, admin adjustment) and a running balance_after computed under a row lock. There is no balance to UPDATE, so a duplication exploit shows up as rows with a reason, and any balance can be rebuilt from history. 2. Every grant is idempotent. A purchase is unique on (platform, platform transaction id), so a resent receipt returns the existing purchase; every ledger entry carries a unique idempotency key, so a retried fulfilment or reward collides instead of paying twice. 3. Ratings are append-only. rating_events records MMR before and after, per player, per mode, per season; player_ratings is only a cache of the latest row. Undoing the games lost to a banned cheater is a correction row, never an edit. 4. One game account, many platforms. players is independent of any storefront or console network; platform_identities links each external account to exactly one player at a time, which is what makes cross-progression work. Platforms are data, so supporting a new storefront is an INSERT. DETAILS WORTH STEALING - Friendships are stored once as an ordered pair (player_low_id < player_high_id), so A-B and B-A can never both exist. - Leaderboards are snapshots: readers page a frozen board instead of sorting a live table, and the final snapshot is the one season rewards are paid from. - Inventory items record what granted them (purchase, match, achievement), and a refund or chargeback sets revoked_at instead of deleting the row. - Sanctions are rows with a time window (warnings, chat mutes, queue cooldowns, ranked bans, account bans); players.status only caches what is active. - Admin currency adjustments must name a staff account, so an insider grant is always attributed. - Matches record the server build, so every match played on a buggy build can be found and invalidated; an invalidated match pays no rewards and moves no ratings. WHAT YOU GET Clean DBML that imports directly into DB Planner, and a laid-out board with zones color-coded and framed: players and identity, social, matchmaking and matches, ratings and progression, economy and store, and moderation. Every table carries a note. Postgres types throughout; the two jsonb columns (matchmaking latency samples and per-match player stats) map to JSON in MySQL or NVARCHAR(MAX) in SQL Server. Useful for developers building the backend for an online multiplayer game, and for students who need a realistic multiplayer game ER diagram for a DBMS project. This is a schema design reference; anti-cheat, rating math and platform store rules belong in your own services.
Tables (30)
| Table | Columns |
|---|---|
| achievements | 9 |
| currencies | 6 |
| friendships | 6 |
| game_modes | 7 |
| guild_members | 7 |
| guilds | 8 |
| inventory_items | 11 |
| items | 9 |
| leaderboard_entries | 5 |
| leaderboard_snapshots | 6 |
| match_participants | 10 |
| matches | 10 |
| matchmaking_tickets | 11 |
| offer_contents | 5 |
| parties | 7 |
| party_members | 4 |
| platform_identities | 8 |
| platforms | 5 |
| player_achievements | 6 |
| player_profiles | 8 |
| player_ratings | 9 |
| player_reports | 10 |
| players | 8 |
| purchases | 13 |
| rating_events | 10 |
| sanctions | 12 |
| seasons | 6 |
| staff_accounts | 5 |
| store_offers | 11 |
| wallet_ledger_entries | 13 |
Relationships (67)
achievements.reward_currency_id references currencies.idmany to oneachievements.reward_item_id references items.idmany to onefriendships.player_high_id references players.idmany to onefriendships.player_low_id references players.idmany to onefriendships.requested_by references players.idmany to oneguild_members.guild_id references guilds.idmany to oneguild_members.player_id references players.idmany to oneinventory_items.achievement_id references achievements.idmany to oneinventory_items.item_id references items.idmany to oneinventory_items.match_id references matches.idmany to oneinventory_items.player_id references players.idmany to oneinventory_items.purchase_id references purchases.idmany to oneleaderboard_entries.player_id references players.idmany to oneleaderboard_entries.snapshot_id references leaderboard_snapshots.idmany to oneleaderboard_snapshots.game_mode_id references game_modes.idmany to oneleaderboard_snapshots.season_id references seasons.idmany to onematch_participants.match_id references matches.idmany to onematch_participants.party_id references parties.idmany to onematch_participants.player_id references players.idmany to onematches.game_mode_id references game_modes.idmany to onematches.season_id references seasons.idmany to onematchmaking_tickets.game_mode_id references game_modes.idmany to onematchmaking_tickets.match_id references matches.idmany to onematchmaking_tickets.party_id references parties.idmany to onematchmaking_tickets.player_id references players.idmany to oneoffer_contents.currency_id references currencies.idmany to oneoffer_contents.item_id references items.idmany to oneoffer_contents.store_offer_id references store_offers.idmany to oneparties.game_mode_id references game_modes.idmany to oneparties.leader_id references players.idmany to oneparty_members.party_id references parties.idmany to oneparty_members.player_id references players.idmany to oneplatform_identities.platform_id references platforms.idmany to oneplatform_identities.player_id references players.idmany to oneplayer_achievements.achievement_id references achievements.idmany to oneplayer_achievements.player_id references players.idmany to oneplayer_profiles.avatar_item_id references items.idmany to oneplayer_profiles.banner_item_id references items.idmany to oneplayer_profiles.title_achievement_id references achievements.idmany to oneplayer_ratings.game_mode_id references game_modes.idmany to oneplayer_ratings.last_rating_event_id references rating_events.idmany to oneplayer_ratings.player_id references players.idmany to oneplayer_ratings.season_id references seasons.idmany to oneplayer_reports.match_id references matches.idmany to oneplayer_reports.reported_player_id references players.idmany to oneplayer_reports.reporter_id references players.idmany to oneplayer_reports.reviewed_by references staff_accounts.idmany to oneplayer_reports.sanction_id references sanctions.idmany to oneplayers.id references player_profiles.player_idone to onepurchases.platform_id references platforms.idmany to onepurchases.player_id references players.idmany to onepurchases.store_offer_id references store_offers.idmany to onerating_events.game_mode_id references game_modes.idmany to onerating_events.match_id references matches.idmany to onerating_events.player_id references players.idmany to onerating_events.season_id references seasons.idmany to onesanctions.evidence_match_id references matches.idmany to onesanctions.issued_by references staff_accounts.idmany to onesanctions.player_id references players.idmany to onesanctions.revoked_by references staff_accounts.idmany to onestore_offers.price_currency_id references currencies.idmany to onewallet_ledger_entries.achievement_id references achievements.idmany to onewallet_ledger_entries.currency_id references currencies.idmany to onewallet_ledger_entries.match_id references matches.idmany to onewallet_ledger_entries.player_id references players.idmany to onewallet_ledger_entries.purchase_id references purchases.idmany to onewallet_ledger_entries.staff_account_id references staff_accounts.idmany to one
How to use this template
- Open the ER diagram to see the tables and how they relate.
- Copy it into your workspace. You get your own editable copy, in DBML.
- Export it as PostgreSQL, MySQL, or SQL Server DDL, or as C# models.
The copy opens in DB Planner’s ER diagram tool, with the schema as text in the DBML editor beside it. Have a database already? Turn its SQL into an ER diagram instead.
Frequently asked questions
- What is in the Multiplayer Game Backend database schema?
- 30 tables and 67 relationships, across 245 columns. The table names and the full relationship list are shown on this page.
- Can I export it to PostgreSQL or MySQL?
- Yes. Every DB Planner template exports as DBML, as PostgreSQL, MySQL, or SQL Server DDL, and as C# models.
- Is this template free?
- Yes. You can open it in the browser without an account, and copy it into your own workspace with a free DB Planner account.
- Can I change it after copying it?
- Yes. A copy is yours: you can rename tables, add columns, and export it. Changes the author makes later do not affect your copy.