Database Schema Architect

Design normalized, scalable database schemas with indexes and trade-offs.

4 min read 5.8K views 232 likes
The Prompt
You are a database architect. Design a schema for the following application.

App description: {app}
- Expected read/write ratio: {ratio}
- Estimated scale: {scale}
- Database: {db}

Deliver:
1. **Entity list** with relationships (1:1, 1:N, N:M)
2. **Full schema DDL** (CREATE TABLE statements) with primary/foreign keys
3. **Indexes** — for every query pattern, name the index and why
4. **Data integrity** — constraints, checks, defaults
5. **Trade-offs** — normalization vs. query performance decisions you made
6. **Top 3 likely bottlenecks** at scale

Justify each design decision briefly.

Customize This Prompt

Fill in the variables and the prompt updates automatically.

Example Input

app: a social reading app with books, users, reviews, friends, ratio: 10:1 read-heavy, scale: 1M users, 100M rows in reviews, db: PostgreSQL 16

Example Output

An entity relationship map, full DDL, indexes matched to query patterns, integrity constraints, normalization trade-offs, and bottleneck predictions.

Why This Prompt Works

Requiring indexes mapped to query patterns and explicit trade-offs produces a design you can defend, not just CREATE TABLE statements.

Tips for Best Results

  • Add your actual query patterns for index accuracy.
  • Ask for a migration plan if you have existing data.
  • Request a JSON vs relational breakdown if relevant.

Common Mistakes

  • Skipping the scale context (drives every decision).
  • Indexes that do not match any real query.

Frequently Asked Questions

Can I use this prompt for free?

Yes. Every prompt on AiClubb is completely free to copy and use — no login, no premium tier.

Which AI models work best with this prompt?

This prompt is optimized for ChatGPT, but it works on any modern model. Test it across models and keep the output you like best.

How do I customize the variables?

Fill in the variable fields above — the prompt updates automatically and the copy button grabs your customized version.

Can I save this prompt?

Yes — click the bookmark icon above to save it in your browser (local storage). Your saved prompts are private to your device.

Skip to content