Payload vs Directus: Code-First vs Database-First CMS
Payload is a code-first TypeScript CMS where schemas are defined in configuration files, generating the database and admin UI from code. Directus wraps existing SQL databases automatically, introspecting tables to generate an admin interface. Both are open source and self-hostable.
Last updated: 2026-04
In This Comparison
72% of organisations have adopted AI in at least one business function
Source: McKinsey 2025
40-60% reduction in operational costs with AI automation
Source: McKinsey 2025
$35/mo
Payload Cloud Standard plan with 3GB database storage, 30GB file storage, and 40GB bandwidth
Payload Pricing, 2026
$49-$499/mo
Directus Cloud pricing range from Professional to Business plans, with self-hosting free under $5M total finances
Directus Pricing, 2026
~33k
Payload CMS GitHub stars vs ~30k for Directus, reflecting both tools's strong open-source adoption in the headless CMS space
GitHub, 2026
Side-by-Side Comparison
| Category | directus | payload |
|---|---|---|
| Approach | Database-first (introspects existing tables) | Code-first (schema in TypeScript config) |
| Self-Hosted Cost | Free (MIT licence under $5M revenue) | Free (MIT licence) |
| Cloud Pricing | $49-$499/mo cloud plans | $35-$199/mo+ cloud plans |
| Schema Definition | Introspects existing SQL database | TypeScript configuration files |
| TypeScript Support | Available but not as deep | TypeScript-first, full type safety |
| Database Support | PostgreSQL, MySQL, MariaDB, SQLite, MSSQL | PostgreSQL, MongoDB |
| Best For | Adding CMS to existing databases | Building new CMS from TypeScript |
| GitHub Stars | ~30k stars | ~33k stars |
directus
- Approach
- Database-first (introspects existing tables)
- Self-Hosted Cost
- Free (MIT licence under $5M revenue)
- Cloud Pricing
- $49-$499/mo cloud plans
- Schema Definition
- Introspects existing SQL database
- TypeScript Support
- Available but not as deep
- Database Support
- PostgreSQL, MySQL, MariaDB, SQLite, MSSQL
- Best For
- Adding CMS to existing databases
- GitHub Stars
- ~30k stars
payload
- Approach
- Code-first (schema in TypeScript config)
- Self-Hosted Cost
- Free (MIT licence)
- Cloud Pricing
- $35-$199/mo+ cloud plans
- Schema Definition
- TypeScript configuration files
- TypeScript Support
- TypeScript-first, full type safety
- Database Support
- PostgreSQL, MongoDB
- Best For
- Building new CMS from TypeScript
- GitHub Stars
- ~33k stars
Winner by Category
Best for Existing_db
directusAutomatically introspects and wraps any existing SQL database without code changes
Best for Type_safety
payloadTypeScript-first with automatic type generation from schema to client
Best for Database_support
directusSupports PostgreSQL, MySQL, MariaDB, SQLite, and MSSQL vs Payload's PostgreSQL and MongoDB
Best for Developer_ownership
payloadSchema in code means version-controlled, reviewable schema changes via pull request
Our Recommendation
Choose Directus to add a CMS layer to an existing SQL database without rewriting your schema. Choose Payload when building a new TypeScript project and want a code-first CMS with full type safety and version-controlled schema management.
“Payload solved a real frustration with headless CMS tools: the disconnect between your content schema and your TypeScript types. When you define a Payload collection, you get type-safe access to that content in your application automatically. There is no separate type definition step, no risk of types drifting from the actual schema, and no runtime surprises. For TypeScript teams, that is a significant quality-of-life improvement over traditional CMS integrations.”
When to Choose Each Tool
Choose Payload
Building a new TypeScript project and want full type safety in your CMS layer
Choose Directus
Have an existing SQL database and need to add a CMS without changing the schema
Payload vs Directus: Two Different Philosophies for Headless CMS
Payload and Directus are both open-source, self-hostable headless CMS platforms, but they take fundamentally different approaches to schema management. Payload is code-first: you define your content collections, fields, and access control rules in TypeScript configuration files. Payload then generates the database schema, admin interface, and REST and GraphQL APIs from that configuration. Schema changes are made in code, reviewed via pull requests, and version controlled alongside your application.
Directus is database-first: you point it at an existing SQL database and it introspects the tables, generating an admin interface and API layer on top of what already exists. This approach means no schema migration is required to add Directus to an existing project, and non-technical users can modify the schema through the Directus admin interface without writing code. Directus supports PostgreSQL, MySQL, MariaDB, SQLite, and MSSQL, giving it broader database compatibility than Payload's PostgreSQL and MongoDB support.
Pricing in 2026: Both Free to Self-Host, Different Cloud Costs
Both Payload and Directus are free to self-host. Payload is MIT licensed with no usage restrictions. Directus is MIT licensed for organisations with total finances under $5 million; larger companies using Directus in production need to purchase a commercial licence.
For managed cloud hosting, Payload Cloud starts at $35 per month for the Standard plan with 3GB database storage and 30GB file storage, rising to $199 per month for the Pro plan. Directus Cloud plans run from $49 per month to $499 per month, with enterprise pricing on request. Both cloud options exist primarily for teams that want the CMS without managing their own infrastructure. Self-hosted deployments on platforms like Railway, Render, or a VPS can reduce costs significantly for teams comfortable with basic DevOps.
TypeScript Experience: Payload's Primary Advantage
Payload is built specifically for TypeScript and generates type definitions from your collection schemas automatically. When you define a Posts collection with a title field and an author relationship, Payload generates the corresponding TypeScript types. Your application code accessing post data is type-safe by default, catching type mismatches at build time rather than at runtime. Access control rules, hooks, and field validations are written in TypeScript and benefit from the same type checking.
Directus provides TypeScript support through its SDK and offers type generation tools, but the type safety is less integrated because the schema is defined through the database or admin interface rather than in TypeScript code. The disconnect between the database-defined schema and application types requires a separate synchronisation step that Payload eliminates entirely. For TypeScript-first teams, Payload's approach reduces a category of maintenance burden that Directus requires ongoing attention to manage.
Which Use Cases Each Platform Handles Best
Payload suits new TypeScript projects where the content schema does not yet exist. Building a blog, product catalogue, documentation site, or multi-tenant content platform from scratch benefits from Payload's TypeScript-first approach. Schema changes made in code are explicit, reviewable, and tied to the same Git history as application changes. Payload also supports custom React components in the admin interface, enabling highly customised editorial experiences for specific editorial workflows.
Directus suits projects where the database already exists and adding a CMS layer is the goal rather than building one from scratch. A SaaS application with an existing PostgreSQL database can get a content management interface in Directus without rewriting or migrating data. Directus also suits teams with non-technical users who need to modify content structures themselves through the admin interface, since schema changes in Directus do not require code deployments.
Database Support: Directus's Broader Compatibility
Directus supports PostgreSQL, MySQL, MariaDB, SQLite, and Microsoft SQL Server. This breadth makes it compatible with almost any existing database stack, which aligns with its database-first philosophy. Teams with MySQL or MSSQL databases can use Directus where Payload is not an option.
Payload supports PostgreSQL and MongoDB. In 2024, Payload 3.0 added PostgreSQL support alongside its existing MongoDB driver, significantly expanding its compatibility. For new projects, PostgreSQL is the recommended choice with Payload and benefits from better performance and full SQL support. The MongoDB adapter remains available for teams already on that stack. For teams with MySQL or MSSQL databases, Directus is currently the better choice since Payload does not support those engines.
Which Should You Choose in 2026?
For new TypeScript projects that need a headless CMS with strong type safety, version-controlled schemas, and a customisable admin interface, Payload is the better choice in 2026. The ecosystem momentum is strong, the TypeScript experience is genuinely excellent, and the migration to cloud hosting is straightforward if you outgrow self-hosting.
For projects with existing databases, teams needing to support MySQL or MSSQL, or teams where non-technical users need to manage content schemas without engineering involvement, Directus is the right tool. The database-first model removes migration risk and the broader database support makes Directus applicable in situations where Payload cannot serve. Both tools are self-hostable and free at the base level, making them practical to trial without financial commitment.
Frequently Asked Questions
Which has better TypeScript support: Payload or Directus?
Payload. It is TypeScript-first, generating type definitions from collection schemas automatically. Your application code is type-safe by default. Directus has TypeScript support but requires a separate type generation step and does not provide the same level of integrated type safety throughout the stack.
Can Payload wrap an existing database?
No. Payload manages its own database schema defined in TypeScript configuration. For adding a CMS layer to an existing database without changing the schema, Directus is the better choice. Directus introspects existing tables and generates an admin interface automatically.
Is Directus free for large companies?
Only if self-hosted and your total organisation finances are under $5 million. Larger organisations using Directus in production need to purchase a commercial licence. Payload is MIT licensed with no revenue or size restrictions on self-hosted usage.
Does Payload support MySQL?
No. Payload supports PostgreSQL and MongoDB. If your stack uses MySQL or MSSQL, Directus is the CMS option that supports those engines natively.
Which is easier to get started with quickly?
For existing databases, Directus is faster since it requires no schema migration. For new projects, both have similar setup time. Payload's CLI scaffolds a new project quickly, and Directus has a Docker Compose file for self-hosting. Both have cloud-hosted options if you want to skip infrastructure setup entirely.
Can non-technical editors modify content structure in Directus?
Yes. Directus allows schema changes through its admin interface, meaning non-technical users can add fields or collections without code deployments. Payload requires schema changes to be made in TypeScript configuration files and deployed by a developer, which provides better version control but less flexibility for non-technical teams.
Master Both Tools at buildDay Melbourne
Join our hands-on workshop and learn to build with the modern AI development stack. Go from idea to deployed app in a single day.