schema gallery

Database schema examples

100 complete schemas for real domains, 1232 tables in all. Open any of them in the free editor and make it yours. Every one is public domain.

100 schemas

PostgreSQL
SaaS

A/B testing & experimentation platform schema

An experimentation platform end to end: experiments and weighted variants, deterministic hash bucketing, exposure events, metric definitions, per-variant aggregates with sufficient statistics, significance results and staged rollout.

PostgreSQL
Travel

Airbnb database schema

How a short-term rental marketplace models its data: hosts and listings, a host-owned per-night calendar, request-to-book versus instant book, reservations, guest payments and host payouts, and two-way reviews that only reveal once both sides have written.

PostgreSQL
Commerce

Amazon-style marketplace database schema

How a marketplace models many sellers listing the same product: a shared catalogue, competing offers, the buy box decision as a log, orders split into per-seller sub-orders, fulfilment, payouts and product-level reviews.

PostgreSQL
SaaS

Product analytics platform database schema

How a product analytics service stores its data: projects and a discovered event registry, raw events with JSONB properties, anonymous and identified users with identity merges, sessions, funnels, cohorts, retention reports and precomputed metric snapshots.

PostgreSQL
Developer tools

API gateway & rate limiting database schema

How an API platform is modelled: consumers and applications, hashed API keys with scopes and rotation, upstream services and routes, rate limit policies, durable usage counters, rolled-up aggregates, sampled request logs, plans, quotas and overage billing.

PostgreSQL
Internal tools

Applicant tracking & recruiting database schema

An ATS modelled end to end: jobs with openings and hiring teams, candidates separate from applications, per-job pipeline stages, interviews with panels, structured scorecards, offers with approval chains and a talent pool of near misses.

SQL Server
Internal tools

IT asset management database schema

How an IT estate is tracked end to end: models versus serialised assets, custody history, software licences and seat allocation with compliance counts, warranties and support contracts, maintenance, depreciation, audits and disposal.

PostgreSQL
Fintech

Banking ledger database schema (double-entry)

A double-entry bank ledger: accounts in a single currency each, balanced journal entries that are never updated, card authorizations that hold funds, transfers kept separate from postings, and frozen statements.

PostgreSQL
Media & content

Blog & CMS database schema

A content management schema that survives contact with editors: posts with an append-only revision history, categories and tags, threaded comments, a real media library, slug redirects and a double opt-in newsletter list.

PostgreSQL
Productivity

Calendar and scheduling database schema

How a calendar app models its data: calendars and sharing, events with their own time zones, RRULE recurrence with exception dates and per-occurrence overrides, attendees and RSVP, reminders, working hours and a free-busy index.

MySQL
Travel

Car rental and fleet database schema

A vehicle rental schema: branches, vehicle classes versus the individual cars behind them, a per-branch availability calendar, reservations and signed agreements, mileage and fuel, damage inspections with photos, protection add-ons and one-way fees.

PostgreSQL
Developer tools

CI/CD build pipeline database schema

How a build system models its data: versioned pipeline definitions, immutable runs triggered by a commit, stages with approval gates, a job DAG stored as edges, runners and capabilities, attempts and retries, artifacts, caches and streamed logs.

MySQL
Healthcare

Clinic appointment scheduling database schema

Outpatient scheduling in MySQL: recurring availability templates that generate slots, appointments that consume exactly one slot, waitlists that backfill cancellations, two-way reminders, referrals, and a dated no-show policy.

PostgreSQL
Education

Coursera-style online course platform database schema

How a MOOC platform models its data: versioned course content, dated session runs, an outline tree of modules and lectures, quizzes drawn from question banks, peer-graded assignments with rubric criteria, entitlements and certificates.

PostgreSQL
Internal tools

Sales CRM & pipeline database schema

A sales CRM modelled end to end: accounts and contacts, leads converted into an account, contact and deal, deals moving through stages with full stage history, activities, quotes, forecasts, territories and custom fields.

PostgreSQL
Fintech

Crypto exchange order book database schema

How a centralised crypto exchange models its data: trading pairs, limit orders resting on the book, maker and taker trades, available versus locked balances, on-chain deposits and withdrawals, fee tiers and order book snapshots.

PostgreSQL
Communication

Discord chat platform database schema

How a community chat platform models its data: servers with nested channels, roles carrying permission bitfields, three-state per-channel overwrites, per-server nicknames, messages and threads, reactions, attachments, invites and voice sessions.

PostgreSQL
Food & drink

DoorDash food delivery database schema

How a food delivery marketplace models its data: restaurant menus built from reusable modifier groups, orders that snapshot every chosen option, courier dispatch offers, live location tracking, and the fee split between restaurant, courier and platform.

PostgreSQL
Productivity

Dropbox-style file storage & sync database schema

How a cloud drive models its data: a folder tree, versioned files, content-addressed blocks that deduplicate identical uploads to a single copy, shares and expiring public links, per-device sync cursors, trash retention and quota accounting.

PostgreSQL
Education

Duolingo-style language learning database schema

How a gamified language app models its data: directional courses, a skill tree with unlock rules, lessons and exercise items, crown levels, a per-word spaced-repetition schedule, streaks with freezes, hearts and weekly leagues.

PostgreSQL
Commerce

E-commerce store database schema

A production-shaped e-commerce schema: products with variants, inventory per location, carts, orders with snapshotted line items, payments and shipments. Open it in the editor or export SQL for six dialects.

PostgreSQL
SaaS

Email marketing & campaign database schema

How a campaign sender stores its data: lists and contacts with custom fields, rule-based segments, campaigns with A/B variants, one send row per recipient, opens and clicks, bounces and suppressions, and drip automations.

PostgreSQL
Communication

Email & mailbox service database schema

How a webmail service models its data: labels applied many-to-many instead of IMAP folders, one stored copy per message, conversation threading, attachments deduplicated by content hash, delivery filters, drafts, read state, spam scoring and quota.

PostgreSQL
Developer tools

Error tracking and monitoring database schema

How an error monitoring service models its data: projects and releases, raw events with stack frames and breadcrumbs, grouping into issues by fingerprint, resolve and regression detection, alert rules and event sampling.