Rails + PostgreSQL
Ruby on Rails with PostgreSQL, the common production pairing for Rails apps, where Rails 8's database-backed Solid Queue and Solid Cache can run on the same Postgres.
- Ruby on Rails
- Ruby
- PostgreSQL
- Learning curve
- Moderate
- Status
- Mature and maintained
- Reviewed
- November 2026
- Best for
- SaaS products and marketplaces built by small teams
- CRUD-heavy B2B apps with server-rendered UI via Hotwire
- MVPs that need auth, email, jobs and an admin quickly
- Teams that prefer a single monolith over a separate SPA and API
- Not ideal for
- CPU-bound or very low-latency services
- Highly interactive, offline-capable web app
Overview
Rails is a full-stack, convention-over-configuration framework: Active Record models, migrations, Action Controller, server-rendered views with Hotwire (Turbo and Stimulus), Action Mailer and Active Job all come in the box. PostgreSQL is the usual production database, and since Rails 8 the default job queue, cache and Action Cable backends (Solid Queue, Solid Cache, Solid Cable) can live in Postgres too, so many apps run with no Redis at all. Small teams pick it to ship and iterate on database-backed products quickly.
What's inside
Generators and conventions make the first app fast, but much happens implicitly. Developers new to Ruby must learn the language, Active Record's query and callback behaviour, and Hotwire's server-driven UI model.
Ruby on Rails
Backend
Handles requests, business logic and APIs
Learning: Moderate
Status: Active
PostgreSQL
Database
Stores and queries the data
Learning: Moderate
Status: Active
Ruby
Language
The language the code is written in
Learning: Moderate
Status: Active
How it works
Puma serves requests to Rails controllers, which load Active Record models from PostgreSQL and render HTML (often Turbo Frames or Streams) or JSON; slow work goes to Active Job, which Solid Queue stores in and pulls from PostgreSQL.
- 1.
Infrastructure to backend
Thruster or Nginx in front of Puma passes the request through the Rack middleware stack to the router and a controller action.
- 2.
Backend to database
The controller queries Active Record models, with includes/preload to avoid N+1 queries, and validations and callbacks run before writes.
- 3.
Database to backend
Rows are instantiated as model objects and rendered into ERB views, Turbo Stream updates or JSON via Jbuilder or serializers.
- 4.
Backend to database
perform_later enqueues an Active Job; with Solid Queue the job is a row in a queue database that workers claim with FOR UPDATE SKIP LOCKED.
Strengths and drawbacks
Strengths
Integrated defaults
Migrations, mailers, jobs, file uploads (Active Storage), websockets (Action Cable), an authentication generator and Kamal deployment all ship together and follow the same conventions.
Fewer services with solid adapters
Solid Queue, Solid Cache and Solid Cable store jobs, cache entries and pub/sub messages in the database, so a Rails + PostgreSQL app can run background jobs and caching without Redis.
Rich UI without a SPA
Turbo Drive, Frames and Streams update parts of server-rendered pages, and Stimulus adds small JS behaviours, which avoids maintaining a separate React front end and API for many products.
Good PostgreSQL coverage
Active Record supports jsonb, arrays, ranges, native enums, UUID primary keys, upsert_all and deferrable constraints, and schema can be kept as structure.sql when you need triggers or extensions.
Drawbacks
Ruby concurrency limits
The global VM lock means one Ruby process runs Ruby code on one core at a time, so throughput comes from Puma workers times threads. Memory per worker and CPU-heavy endpoints need watching; YJIT helps but does not remove the limit.
Callbacks and concerns sprawl
Large apps accumulate model callbacks, concerns and implicit behaviour that make side effects hard to trace. Teams often introduce service objects and strict loading to regain control.
N+1 queries hide easily
Lazy association loading in views makes N+1 queries the most common performance problem; strict_loading and tools such as Bullet or query logs are needed to catch them.
Major upgrades take effort
Rails upgrades are well documented, but large apps with many gems and monkey patches often lag several versions behind and need dedicated upgrade work.
Smaller hiring pool and dynamic typing
Ruby developers are fewer than JavaScript, Python or Java developers in most markets, and types are optional (Sorbet or RBS), so large refactors lean heavily on test coverage.
Scores
Editorial ratings out of 10, comparable across every stack in the guide. They are judgement, not benchmarks. How we score
- Speed of building
- 9.5 out of 10, catalog average 7.7
- Ease of learning
- 7.2 out of 10, catalog average 7.2
- Scalability
- 7.2 out of 10, catalog average 7.6
- Performance
- 6.0 out of 10, catalog average 7.5
- Maintainability
- 7.4 out of 10, catalog average 7.2
- Ecosystem
- 8.0 out of 10, catalog average 8.2
- Flexibility
- 7.2 out of 10, catalog average 7.4
How quickly a team ships features
Higher means easier to pick up
How far it grows before a redesign
Speed of the running application
How well the codebase ages
Libraries, hosting, docs and hiring
How many kinds of product it suits
How it scales
Rails scales horizontally with stateless Puma processes; the database is the main constraint, handled with indexes, caching, replicas via Rails' multi-database support and, much later, sharding.
- Starting outMVP and first users
- One server deployed with Kamal running Puma, Solid Queue in the same process (the Puma plugin) and PostgreSQL holding app data, jobs and cache.
- GrowingReal traffic, a few engineers
- Multiple Puma containers behind a load balancer, separate Solid Queue worker processes, PgBouncer, fragment caching with Solid Cache, and a CDN for assets.
- LargeHeavy traffic or data
- Read replicas with automatic role switching, a separate database for queue and cache, Redis or a dedicated job backend where job volume outgrows the database, and heavy query tuning.
- EnterpriseMany teams and regions
- Large modular monoliths split into engines or packs, horizontal sharding with Active Record's multi-database APIs, and selected hot paths moved to separate services.
Where it fits
Common projects, from best fit to worst.
SaaS product from MVP to growth
Auth, billing hooks, mailers, jobs and admin screens come together quickly, and the same monolith carries the product well past launch.
Great fit
Internal B2B workflow app
Forms, approvals and dashboards with Hotwire avoid a separate front-end build while still feeling interactive.
Great fit
Highly interactive, offline-capable web app
Hotwire covers most interactivity, but editors, canvases and offline-first apps usually need a React or similar client with Rails as an API.
Workable
CPU-bound or very low-latency services
Per-process concurrency and Ruby's speed make Go, Rust or the JVM a better fit for compute-heavy or tight-latency workloads.
Poor fit
Alternatives
Similar stacks, and when you would choose them instead.
- Django + PostgreSQL
Pick Django for the same batteries-included model in Python, with a built-in admin and direct access to Python's data and ML libraries.
CompareRails + PostgreSQL with Django + PostgreSQL - Laravel + PostgreSQL
Pick Laravel for a comparable full-stack framework in PHP, with a larger hosting and hiring pool in many regions.
CompareRails + PostgreSQL with Laravel + PostgreSQL - Next.js + Prisma + PostgreSQL
Pick a TypeScript full-stack app when the product needs a highly interactive React front end and one language across client and server.
CompareRails + PostgreSQL with Next.js + Prisma + PostgreSQL - Spring Boot + PostgreSQL
Pick Spring Boot for large organisations that want static typing, JVM performance and enterprise integration over raw iteration speed.
CompareRails + PostgreSQL with Spring Boot + PostgreSQL
Sources
Reviewed on November 19, 2026 against the documentation below. Found something out of date? Suggest a correction. Read our methodology.
- Rails Guides: Active Record and PostgreSQL
Official guide to PostgreSQL-specific types and features in Active Record.
- Rails: Configuring a database
Official configuration guidance; new apps use SQLite unless created with --database=postgresql.
- Rails 8.0 release notes
Solid Queue, Solid Cache, Solid Cable, Kamal 2, Propshaft and the authentication generator.
- Solid Queue
Database-backed Active Job backend that uses FOR UPDATE SKIP LOCKED on PostgreSQL.
Related stacks
Stacks that share technologies with Rails + PostgreSQL.
FastAPI + PostgreSQL
FastAPI API services with PostgreSQL, a high-adoption Python API stack for microservices and ML-adjacent backends.
- FastAPI
- Python
- PostgreSQL
- +1
Learning: Easy
FastAPI + SQLAlchemy + PostgreSQL
FastAPI with the SQLAlchemy 2.0 ORM, Alembic migrations and PostgreSQL, the Python API stack for teams that want a full unit-of-work ORM behind typed endpoints.
- FastAPI
- SQLAlchemy
- PostgreSQL
- +2
Learning: Moderate
Flask + PostgreSQL
Flask microframework with PostgreSQL, usually through Flask-SQLAlchemy and Flask-Migrate, a long-standing lightweight Python stack for small web apps, internal tools and APIs.
- Flask
- Python
- PostgreSQL
Learning: Easy