AI Prompt for App Architecture
Design a normalized, performant database schema with migrations, indexes, seed data, and query optimization notes.
You are a database architect with deep expertise in relational and NoSQL database design. Design a complete database schema for the following application. Application: [APP_NAME] Database engine: [DATABASE_ENGINE] Description: [APP_DESCRIPTION] Core entities: [ENTITY_LIST] Expected scale: [EXPECTED_ROWS_AND_QUERIES] Deliver the following: 1. **Entity-relationship design** -- List all entities with their fields, types, constraints (NOT NULL, UNIQUE, CHECK), and default values. Draw relationships in text format showing one-to-one, one-to-many, and many-to-many connections. 2. **Normalization review** -- Verify the schema is in 3NF. Explain any intentional denormalization with performance justification. 3. **Migration files** -- Write complete SQL migration files (or ORM migration code for [ORM_NAME]) that create all tables, indexes, constraints, and foreign keys in the correct order. 4. **Indexes** -- Design indexes based on expected query patterns: - Primary and foreign key indexes - Composite indexes for common WHERE + ORDER BY combinations - Partial indexes where beneficial - Full-text indexes if needed 5. **Seed data** -- Generate realistic seed data for development and testing. Include at least 10 rows per table with varied data. 6. **Query patterns** -- Write optimized SQL for the 5 most common queries the application will run. Include EXPLAIN analysis notes. 7. **Scaling considerations** -- Address partitioning strategy, connection pooling configuration, and backup/restore procedures. Output everything as executable SQL files with clear comments.
Replace the bracketed placeholders with your own context before running the prompt:
[APP_NAME]— fill in your specific app_name.[DATABASE_ENGINE]— fill in your specific database_engine.[APP_DESCRIPTION]— fill in your specific app_description.[ENTITY_LIST]— fill in your specific entity_list.[EXPECTED_ROWS_AND_QUERIES]— fill in your specific expected_rows_and_queries.[ORM_NAME]— fill in your specific orm_name.More prompts for App Architecture.
Generate a comprehensive system design document covering architecture, data flow, scalability, and deployment strategy.
Design a complete serverless architecture on AWS Lambda, Vercel, or Cloudflare Workers with infrastructure-as-code.
Design a multi-layer caching architecture with cache invalidation, TTL policies, and consistency guarantees.
Design a complete database schema and data strategy for a analytics dashboard serving the parenting industry.
Design a RESTful or GraphQL API for a restaurant ordering system using SQL with best practices and documentation.
Design a complete system architecture for a healthcare patient portal built with Django + PostgreSQL for real-estate.