Runtime Models
Use this page when you are designing real application models, not just reading the API signatures.SQL models
Use SQL models when:- you want migration-backed structure
- you want relational integrity
- you need pivot tables and conventional relational workflows
- MySQL: conventional production web-app default
- PostgreSQL: stricter relational workloads and richer SQL semantics
- SQLite: local development, lightweight apps, and test isolation
MySQL
Use MySQL when:- you want a conventional production web-app default
- broad hosting compatibility matters
- your workload is standard relational CRUD
PostgreSQL
Use PostgreSQL when:- you prefer stricter relational workloads
- advanced SQL semantics matter
- the system leans on PostgreSQL-native behavior
SQLite
Use SQLite when:- local development should stay lightweight
- tests should be isolated and file-based
- the app does not need a separate database server
Example SQL model
Mongo models
Use Mongo models when:- the domain is document-first
- shape flexibility matters
- explicit
--mongoflows are part of the runtime story - relation support depends on explicit model methods instead of SQL constraints
- foreign-key guarantees
- pivot-table guarantees
- migration-backed relational integrity expectations
Example Mongo model
Relations
Relations belong to model design, but their detailed contract is documented in the ORM pages. Common relation types:belongsTohasOnehasManybelongsToManymorphOnemorphManymorphTo
Use Mongo when relation references are explicit and document-first behavior matters more than SQL-style guarantees.