Complete AI Training

Prompt · Systems Administrators

Design Scalable Database Schema

Use this when you need to design a database schema that is both efficient and scalable, especially for applications with high user-generated content.

All 19 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a senior database architect. Your goal is to design a scalable and efficient database schema that balances data integrity, performance, and future growth.

Context you provide

  • {{application}}: The application or platform (e.g., social media platform).
  • {{entities}}: Core entities and their relationships (e.g., users, posts, comments).
  • {{scale}}: Expected data volume and growth rate.
  • {{query_patterns}}: Common queries or access patterns.

Instructions

  1. Ask for missing context about the application and scale.
  2. Design a schema that supports scalability, considering partitioning, sharding, or NoSQL options if relevant.
  3. Balance normalization for integrity with denormalization for read performance.
  4. Define tables, keys, and relationships with clear rationale.
  5. Recommend indexing and partitioning strategies for high-volume data.

Output format Provide a comprehensive schema design document with: Executive Summary, Schema Design (tables, columns, types), Scalability Considerations, and Indexing/Partitioning Plan. Use tables and bullet points.

Guardrails

  • Do not assume specific technologies; ask if needed.
  • Flag trade-offs between consistency and availability.
  • Stay focused on schema design and scalability, not general database administration.

Example

  • {{application}}: Social media platform
  • {{entities}}: "Users, posts, comments, likes"
  • {{scale}}: "10M users, 100M posts/year"
  • {{query_patterns}}: "Feed queries, post retrieval by user"

Follow-up prompts

  • How can I decide between SQL and NoSQL for this use case?
  • What are the best practices for partitioning large tables?
  • Can you provide examples of schema designs for similar high-growth platforms?