Directus vs Sanity vs SonicJS: Database Wrapper vs SaaS vs Edge
Compare Directus, Sanity, and SonicJS headless CMS. Database flexibility, real-time collaboration, and edge-first performance analyzed.

Directus vs Sanity vs SonicJS: Database Wrapper vs SaaS vs Edge
TL;DR — Directus wraps existing databases but struggles at scale (45s+ load times with 400k files). Sanity offers real-time collaboration but usage-based pricing surprises teams. SonicJS is edge-first with sub-50ms global latency and predictable costs.
Key Stats:
- Directus: 1.5s response with 500 items + relations
- Sanity: Custom roles require $949/month enterprise plan
- SonicJS: Under 50ms globally, zero cold starts
- Directus: GPL v3 (copyleft) vs SonicJS MIT (permissive)
Directus and Sanity take fundamentally different approaches: database wrapper vs cloud-native SaaS. SonicJS offers a third path with edge-first architecture. Here's how they compare.
Quick Comparison
| Feature | Directus | Sanity | SonicJS |
|---|---|---|---|
| Architecture | Database wrapper (Express) | Cloud SaaS | Edge-first (Cloudflare Workers) |
| Database | PostgreSQL, MySQL, SQLite, MSSQL, Oracle | Proprietary | D1 (SQLite at edge) |
| Existing DB Support | Yes (unique strength) | No | No |
| Real-time Collab | Basic | Best-in-class | Roadmap |
| Query Language | REST/GraphQL | GROQ | REST API |
| Cold starts | 300-1000ms | N/A (SaaS) | 0-5ms |
| Global latency | 200-500ms | CDN-cached | Under 50ms |
| Data Ownership | Full | Sanity-controlled | Full |
| License | GPL v3 / BSL | Proprietary | MIT |
| Self-hosted | Yes | Studio only | Yes (edge) |
The Real Problems
Directus: Performance at Scale
Directus's ability to wrap existing databases is powerful, but performance degrades with complexity.
Documented Performance Issues from GitHub:
| Issue | Scenario | Reported Time | Notes |
|---|---|---|---|
| #11766 | 500 items with relations | 1,500ms | runAST bottleneck |
| #7783 | 400k files | 45,000ms+ | Heap out of memory |
| #1575 | Simple queries | 4,000ms | Cold query performance |
| #2020 | 1,000 items | 5,500ms | Collection listing |
| #10034 | 200 row inserts | Connection crashes | Pool exhaustion |
"With a lot of items linked to other items, Directus becomes slow. For only 500 items, Directus took 1.5 seconds." — GitHub Issue #11766
"Loading with 400k files takes around 45 seconds. My latest test was now at 500 seconds." — GitHub Issue #7783
Common Directus issues:
- Connection pool crashes under load
- Missing database indexes
- Complex relations slow dramatically
- Memory consumption with large datasets
Sanity: Usage-Based Pricing Trap
Sanity's collaboration is excellent, but costs escalate:
"Started at $99/month, ended up at $400+ with document growth and API calls we didn't anticipate."
GROQ learning curve:
"GROQ is its own thing. Your team needs to learn yet another query syntax useful nowhere else."
Common Sanity frustrations:
- Custom roles require $949/month enterprise
- Studio keystroke lag (GitHub #7456)
- Proprietary data format lock-in
- Build times 10+ minutes reported
SonicJS: Honest Limitations
SonicJS is newer:
- Can't wrap existing databases like Directus
- No real-time collaboration yet (Sanity's strength)
- Smaller plugin ecosystem
- D1 database only
Architecture Deep Dive
Directus: Database First
Unique ability to wrap any SQL database:
// Directus configuration
{
"database": {
"client": "pg",
"connection": {
"host": "localhost",
"database": "existing_db"
}
}
}
When this excels:
- Legacy database integration
- Multiple apps sharing data
- Gradual CMS adoption
- Database portability
When this fails:
- High-traffic applications
- Complex relations at scale
- Global performance needs
Sanity: Collaboration First
Built for real-time editing:
// Sanity Studio
export default defineConfig({
projectId: 'your-project',
dataset: 'production',
schema: { types: schemaTypes },
})
Strengths:
- Multiple editors, same document
- Live presence
- Instant sync
Trade-offs:
- GROQ lock-in
- Proprietary storage
- Unpredictable costs
SonicJS: Edge First
Runs globally on Cloudflare:
import { createSonicJS } from '@sonicjs-cms/core'
const cms = createSonicJS({
database: env.DB,
cache: env.CACHE,
storage: env.STORAGE,
})
export default cms.app
Benefits:
- Under 50ms worldwide
- Zero cold starts
- Full data ownership
- Predictable pricing
Performance Comparison
| Scenario | Directus | Sanity | SonicJS |
|---|---|---|---|
| Simple GET (same region) | 50-200ms | 30-80ms | 15-30ms |
| Simple GET (cross-region) | 200-500ms | 50-150ms (CDN) | 30-60ms |
| Complex query (relations) | 500-1500ms+ | 50-200ms | 40-80ms |
| Cold start | 300-1000ms | N/A | 0-5ms |
| With 400k files | 45,000ms+ | Unknown | Under 100ms |
Edge Architecture Advantage
Directus runs on a single server. Sanity caches at the edge but queries hit origin.
SonicJS runs the entire CMS at 300+ edge locations:
User in Sydney → Sydney Edge → Response (15ms)
User in Tokyo → Tokyo Edge → Response (15ms)
User in Berlin → Berlin Edge → Response (15ms)
No origin round-trips. Consistent global performance.
Data & Lock-in
Directus: Full Ownership
- Your database, any SQL engine
- Standard SQL exports
- GPL v3 license (copyleft—derivatives must be open source)
- Switch databases anytime
Sanity: Vendor Lock-in
- Proprietary data storage
- GROQ creates query lock-in
- Export available but requires transformation
- Cursor.com migration cost: $260 + dev time
SonicJS: Full Ownership
- Standard SQLite in D1
- MIT license (permissive)
- Export anytime
- No proprietary formats
Pricing Comparison
Directus
Self-hosted: Free (GPL v3) Cloud: Starting at $99/month
Real costs (self-hosted):
- Server: $20-200+/month
- Database: $15-100+/month
- DevOps time: Ongoing
Sanity
Published pricing:
- Free: 100k requests/month, 500k documents
- Growth: $15/user/month + usage
- Enterprise: $949/month minimum
Reality: Mid-size sites often hit $300-500/month with usage.
SonicJS
Cloudflare-based:
- Free: 100,000 requests/day, 10GB D1
- Paid: $5/month flat + minimal usage
- Typical: $5-20/month
Use Case Fit
Choose Directus If:
- You have an existing database to wrap
- Database flexibility is essential
- You can handle performance optimization
- GPL licensing works for you
Choose Sanity If:
- Real-time collaboration is critical
- Budget can handle usage-based pricing
- Team can learn GROQ
- Lock-in is acceptable
Choose SonicJS If:
- Global performance is priority
- Predictable costs matter
- Full data ownership required
- MIT licensing preferred
FAQ
Can SonicJS wrap existing databases like Directus?
No. SonicJS uses D1 (edge SQLite) by design for consistent global performance. Directus is unique in this capability.
Is Sanity's real-time collaboration worth the cost?
For content teams doing heavy simultaneous editing, yes. For API-first or solo content work, probably overkill.
Which has better performance?
For complex queries at scale: SonicJS > Sanity > Directus. Directus's database wrapper approach creates overhead that compounds with complexity.
What about GraphQL support?
- Directus: Built-in
- Sanity: Via GROQ or plugin
- SonicJS: REST-focused, GraphQL on roadmap
Conclusion
Three philosophies:
- Directus: Database flexibility with performance trade-offs
- Sanity: Collaboration excellence with usage-based pricing risk
- SonicJS: Edge-first performance with data ownership
For new projects prioritizing global performance and cost predictability, SonicJS provides a compelling modern alternative.
Key Takeaways
- Directus excels at wrapping existing databases but struggles at scale
- Sanity offers best-in-class collaboration at premium pricing
- SonicJS delivers under 50ms global latency with predictable costs
- Directus is GPL v3; SonicJS is MIT—different licensing implications
- Edge-first architecture eliminates database performance bottlenecks
Ready to try edge-first CMS? Get started with SonicJS in under 5 minutes.
Sources & References
Directus
- Performance with Relations (Issue #11766) — 1.5s with 500 items
- File Loading Times (Issue #7783) — 45s+ with 400k files
- Cold Query Performance (Issue #1575) — 4s simple queries
- Collection Listing Performance (Issue #2020) — 5.5s for 1k items
- Connection Pool Issues (Issue #10034) — Pool exhaustion
Sanity
Related Articles

Directus vs Payload vs SonicJS: Open Source CMS Battle
Compare Directus, Payload, and SonicJS open source headless CMS platforms. Performance benchmarks, database flexibility, and developer experience analysis.

Strapi vs Directus vs SonicJS: Headless CMS Comparison
Compare Strapi, Directus, and SonicJS headless CMS. Real performance data, developer feedback, and why edge-first architecture outperforms traditional servers.

Sanity vs Contentful vs SonicJS: Premium CMS Showdown
Compare Sanity, Contentful, and SonicJS headless CMS platforms. Real-time collaboration, enterprise pricing, and edge performance analyzed.