// framework · roda

Roda: the fastest gem in the west.

Routing trees over routing tables. Roda is what you reach for when latency is a feature.

Roda's routing tree is a joy once you get it, and its performance profile makes it the pragmatic pick for high-QPS internal services. Deploys look like Sinatra but scale like something meaner.
~12k
req/s on 1 vCPU (JSON)
sub-ms
P99 latency
1
dependencies
01 / 03

The routing tree

Roda's `route do |r|` block is the whole app. It composes beautifully across mounts, which makes it a great fit for multi-tenant APIs behind an ALB or Application Gateway.
ruby
# app.rb require "roda" class App < Roda plugin :json plugin :halt route do |r| r.on "api/v1" do r.get "health" do { ok: true, ts: Time.now.to_i } end r.on "users", Integer do |id| r.get { User.find(id).to_h } end end end end
02 / 03

Threaded Puma, always

Roda is thread-safe by default and its middleware footprint is tiny. Push threads to 16–32 and workers to 1 per vCPU. Measure with a real load test — Roda handles far more concurrency than most Rails configs.
03 / 03

Sequel over ActiveRecord

Roda pairs beautifully with Sequel — same author, same philosophy. Use `Sequel.connect(ENV['DATABASE_URL'], max_connections: threads * workers)` and let it manage the pool.

Gotchas we learned the hard way

  • !Route ordering matters — Roda matches top-to-bottom, first-match-wins. Reorganize before you optimize.
  • !The default Roda scaffold is minimal. Add `plugin :error_handler` and `plugin :not_found` explicitly, or every 4xx/5xx will look scary in production.
  • !If you use Sequel with pgbouncer in transaction pooling mode, disable prepared statements or your first migration will teach you a lesson.

Official resources

Docs, repos, and training materials for this framework.

Related guides

Ready?
Roda + Cloud Run = magic

For pure JSON APIs, GCP Cloud Run on top of Roda is one of the leanest, lowest-latency setups you can ship.