Crystal web framework
The batteries-included framework for Crystal
Routing, controllers, views, a real ORM, generators and a CLI — with sane defaults, so building a web app feels like the framework is working for you.
- 992 specs passing
- SQLite + PostgreSQL
- Linux · macOS · Windows
One framework, the whole stack
Everything a web app needs ships together and agrees on conventions — typed at compile time, so renames break the build instead of the page.
Record — a real ORM
SQLite3 and PostgreSQL adapters, migrations with db/schema.cr, validations, callbacks, associations with batched eager loading, and a contract suite that runs against both backends.
Segment-based routing
Typed to: PagesController.index references, resources, constraints, globs and redirects.
Controllers
Per-request instances, typed params, filters, callbacks and content negotiation.
Views
Compile-time ECR with auto-escaping, layouts, partials and a form builder.
Sessions and auth
Signed cookies, flash, CSRF and full registration via altair g auth.
Secure by default
Security headers, request ids, sliding-window rate limiting and opt-in CORS.
CLI + generators
new, g scaffold, server, routes and database commands.
Performance
Measured under real load
A public k6 harness compares Altair with Express, Fiber and a Ruby full-stack MVC app on identical PostgreSQL-backed CRUD endpoints — 100 virtual users for 60 seconds at an identical connection budget.
Write · POST /items
13,981 req/s
1.7x Express · 6.3x the Ruby full-stack arm · best write max of all four (25.2 ms, tighter than Go).
Read · GET /items/:id
13,619 req/s
1.8x Express · 4.6x the Ruby full-stack arm · deterministic tail on the official gcry collector.
Methodology
100 VUs · 60s
Full report — plus the official gcry collector: one flag removes Boehm's tail spikes.
| Framework | Write req/s | Write p99 | Write max | Read req/s | Read p99 |
|---|---|---|---|---|---|
| 13,981 | 13.8 ms | 25.2 ms | 13,619 | 16.6 ms | |
| 20,300 | 9.8 ms | 36.8 ms | 18,990 | 12.1 ms | |
| 8,074 | 23.2 ms | 65.5 ms | 7,671 | 28.0 ms | |
| 2,213 | 407.0 ms | 1,072 ms | 2,975 | 313.6 ms |
100 virtual users, 60 seconds, one 20-connection / 6-worker budget for every framework. Altair holds second place on throughput with the best write tail of all four arms; the closest architectural peer — the Ruby full-stack arm — trails 6.3x on writes and 4.6x on reads.
Start here
Documentation
Install once, scaffold in seconds, and learn the framework guide by guide.