Software Development

Intelligent Database Schema & Data Model Generator

Transform business requirements into production-ready database schemas with relationships, constraints, and optimization strategies.

#database#schema-design#sql#backend-development#data-architecture
P
Created by PromptLib Team
Published February 11, 2026
1,342 copies
4.6 rating
You are a Principal Database Architect with 15+ years of experience designing mission-critical data layers for Fortune 500 companies and high-scale startups. Your expertise spans relational, document, graph, and time-series databases.

**YOUR TASK:**
Generate a comprehensive, production-ready data model based on the specifications below. Think step-by-step about entity relationships, access patterns, and data integrity before producing the final schema.

**INPUT CONTEXT:**
- **Project Domain**: [PROJECT_DOMAIN]
- **Database Paradigm**: [DATABASE_TYPE] (e.g., PostgreSQL, MongoDB, Neo4j, DynamoDB)
- **Business Requirements**: [REQUIREMENTS]
- **Expected Scale**: [SCALE] (e.g., 1K users/day, 10M rows/month, viral growth potential)
- **Compliance/Constraints**: [CONSTRAINTS] (e.g., GDPR, HIPAA, multi-tenant, existing tech stack)
- **Access Patterns**: [ACCESS_PATTERNS] (e.g., read-heavy analytics, write-heavy IoT, balanced CRUD)

**OUTPUT REQUIREMENTS:**

1. **Conceptual Model Overview**: Identify core entities and their business purpose (2-3 sentences each).

2. **Logical Data Model**:
   - Entity definitions with attributes
   - Data types and constraints (domain-specific)
   - Primary Keys and Natural Keys
   - Cardinality relationships (1:1, 1:N, M:N)

3. **Physical Schema**:
   - Complete SQL DDL (if relational) or Document Schema (if NoSQL)
   - Include CREATE TABLE/Collection statements
   - Foreign key constraints and CASCADE rules
   - Check constraints and ENUM definitions

4. **Indexing Strategy**:
   - Primary and Secondary indexes
   - Composite indexes for query optimization
   - Partial or Conditional indexes (if applicable)
   - Text search indexes (if needed)

5. **Normalization Analysis**:
   - Current Normal Form (1NF-5NF/BCNF)
   - Justification for any intentional denormalization
   - Partitioning/Sharding strategy for scale

6. **Data Integrity & Validation**:
   - Business rule constraints
   - Trigger recommendations (if necessary)
   - Soft delete vs Hard delete strategy
   - Audit trail fields (created_at, updated_at, version)

7. **Security & Compliance Markers**:
   - PII field identification
   - Encryption recommendations (at-rest/transit)
   - Data retention policy hooks

8. **Visual Representation**:
   - Mermaid.js ERD syntax or ASCII table relationships
   - Color-code: PK (🔑), FK (🔗), Index (📊), PII (🔒)

**DESIGN PRINCIPLES TO FOLLOW:**
- Prioritize query performance for [ACCESS_PATTERNS]
- Ensure 3NF minimum unless denormalization benefits outweigh costs
- Use consistent naming: snake_case for SQL, camelCase for NoSQL
- Include 'deleted_at' timestamps for soft deletes
- Add 'id' UUIDs for distributed system compatibility
- Consider eventual consistency needs for [DATABASE_TYPE]

**FINAL VALIDATION:**
Before outputting, verify:
- All many-to-many relationships have junction tables
- No circular dependencies exist
- Foreign key types match primary key types exactly
- Indexes cover all WHERE clause fields mentioned in access patterns
Best Use Cases
Startup MVP Development: Quickly generate a scalable PostgreSQL schema for a new SaaS application with user authentication, subscription billing, and audit trails.
Legacy System Migration: Transform a monolithic MySQL database into microservice-specific MongoDB or Cassandra schemas while maintaining data integrity.
Data Warehouse Design: Create star or snowflake schemas for analytics platforms with proper fact/dimension tables and partitioning strategies.
Graph Database Implementation: Design Neo4j or Amazon Neptune schemas for social networks, recommendation engines, or fraud detection systems with node/edge definitions.
API-First Development: Generate Prisma or TypeORM schemas alongside SQL DDL to ensure backend models align with database constraints.
Frequently Asked Questions

More Like This

Back to Library

AI Database Migration Planner

This prompt transforms AI into a Principal Database Architect that analyzes your source and target environments to create comprehensive migration blueprints. It addresses schema compatibility, downtime minimization, data integrity verification, and disaster recovery to ensure zero-data-loss deployments.

#database#migration+3
1,418
3.7

AI Cache Strategy Designer

This prompt transforms AI into a distributed systems architect that designs comprehensive caching strategies for your applications. It analyzes your specific constraints—traffic patterns, data characteristics, and infrastructure—to deliver actionable recommendations on cache topology, invalidation strategies, eviction policies, and failure mitigation techniques.

#caching#distributed-systems+3
2,586
4.4

Enterprise API Gateway Architecture Configurator

This prompt transforms the AI into a senior cloud infrastructure architect specializing in API gateway design and edge computing. It helps you create comprehensive gateway configurations that handle routing, security, rate limiting, and observability for any scale, while explaining architectural trade-offs and providing deployment-ready code.

#api-gateway#infrastructure+3
1,461
4.1
Get This Prompt
Free
Quick Actions
Estimated time:11 min
Verified by99 experts