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.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- 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
- Ask for missing context about the application and scale.
- Design a schema that supports scalability, considering partitioning, sharding, or NoSQL options if relevant.
- Balance normalization for integrity with denormalization for read performance.
- Define tables, keys, and relationships with clear rationale.
- 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?