Skip to content
Derar Sattouf

Laravel vs Ruby on Rails in 2026: Performance, Scaling and Hiring

Backend & databases

Laravel vs Ruby on Rails in 2026: Performance, Scaling and Hiring

Laravel and Ruby on Rails are the two full-stack frameworks that still try to give you the whole app: routing, ORM, migrations, auth, jobs, mail, real-time, testing and a way to deploy. In 2026 both are healthy and both ship every year. The choice between them rarely comes down to speed. It comes down to language, team, hosting and which defaults you would rather live with.

The short answer: pick Laravel if your team writes PHP, if you need to hire quickly in most markets, if you want AI features and vector search from first-party packages, or if the app has to run on ordinary PHP hosting. Pick Rails if your team writes Ruby, if you want one small server to run everything without Redis, or if you want the leanest path from an idea to a deployed app that a small team maintains for years.

The rest of this post explains why, topic by topic. For the wider picture with Django, Flask and FastAPI, and the same endpoint written in all five, see Laravel vs Django vs Flask vs FastAPI vs Rails.

Where each one stands in November 2026

LaravelRuby on Rails
Current versionLaravel 13, released March 17, 2026Rails 8.1, released October 22, 2025
LanguagePHP 8.3 to 8.5Ruby; 4.0 is the newest, and Ruby 3.2 is out of support
Release rhythmOne major a year, around Q1One or two releases a year
Support window18 months of bug fixes, 2 years of security fixes12 to 18 months of bug fixes, 2 years of security fixes
Newest headline featuresFirst-party AI SDK, vector search in the query builder, JSON:API resources, queue routing, more PHP attributesJob continuations, structured event reporting, local CI, Kamal deploys without a registry
Built byLaravel (the company) and its communityThe Rails core team, with 37signals closely involved

Both support windows mean the same thing in practice: plan one framework upgrade a year. Rails 8.0 lost security support on November 7, 2026, and Laravel 12 stopped getting bug fixes in August 2026.

The same feature in both: comments on a post

Feature lists hide what a framework feels like to work in. So here is one small, real feature built in each: signed-in users comment on a blog post, the author is notified in the background, and a test proves it works. Same database, same rules, same responses.

The table

Laravel writes migrations by hand (or with php artisan make:migration):

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('comments', function (Blueprint $table) {
            $table->id();
            $table->foreignId('post_id')->constrained()->cascadeOnDelete();
            $table->foreignId('user_id')->constrained();
            $table->text('body');
            $table->timestamps();
        });
    }
};

Rails generates the model and the migration from one command, bin/rails generate model Comment post:references user:references body:text:

class CreateComments < ActiveRecord::Migration[8.1]
  def change
    create_table :comments do |t|
      t.references :post, null: false, foreign_key: true
      t.references :user, null: false, foreign_key: true
      t.text :body
      t.timestamps
    end
  end
end

One difference shows up already. Rails keeps the current shape of the whole database in db/schema.rb, updated after every migration, so a new developer reads one file to see every table. Laravel has no equivalent by default; you read the migrations, or squash them with php artisan schema:dump.

The model

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Comment extends Model
{
    protected $fillable = ['body', 'user_id'];

    public function post(): BelongsTo
    {
        return $this->belongsTo(Post::class);
    }

    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }

    public function scopeRecent(Builder $query): void
    {
        $query->latest()->limit(20);
    }
}
class Comment < ApplicationRecord
  belongs_to :post
  belongs_to :user

  validates :body, presence: true, length: { maximum: 2000 }

  scope :recent, -> { order(created_at: :desc).limit(20) }
end

Rails puts validation in the model, so every way of saving a comment checks it. Laravel usually validates in the request (next step), and the model only lists which fields may be mass-assigned. Neither is wrong, but in Laravel a comment saved from a job or a console command skips the request's rules unless you validate there too.

Routes and controller

// routes/web.php
Route::middleware('auth')->group(function () {
    Route::get('/posts/{post}/comments', [CommentController::class, 'index']);
    Route::post('/posts/{post}/comments', [CommentController::class, 'store']);
});
<?php

namespace App\Http\Controllers;

use App\Jobs\NotifyPostAuthor;
use App\Models\Post;
use Illuminate\Http\Request;

class CommentController extends Controller
{
    public function index(Post $post)
    {
        return $post->comments()->with('user')->recent()->get();
    }

    public function store(Request $request, Post $post)
    {
        $data = $request->validate([
            'body' => ['required', 'string', 'max:2000'],
        ]);

        $comment = $post->comments()->create([
            ...$data,
            'user_id' => $request->user()->id,
        ]);

        NotifyPostAuthor::dispatch($comment);

        return response()->json($comment, 201);
    }
}
# config/routes.rb
resources :posts do
  resources :comments, only: [ :index, :create ]
end
class CommentsController < ApplicationController
  before_action :set_post

  def index
    render json: @post.comments.includes(:user).recent
  end

  def create
    comment = @post.comments.create!(comment_params.merge(user: Current.user))
    NotifyPostAuthorJob.perform_later(comment)
    render json: comment, status: :created
  end

  private
    def set_post
      @post = Post.find(params[:post_id])
    end

    def comment_params
      params.expect(comment: [ :body ])
    end
end

Both bind the post from the URL and return 404 when it does not exist, and both answer 422 when the body is missing (Laravel from validate, Rails because create! raises a validation error that Rails maps to 422). params.expect, new in Rails 8, is the stricter form of strong parameters: it rejects a request whose comment key is missing or the wrong shape. Current.user comes from the authentication code that bin/rails generate authentication writes; in Laravel, $request->user() comes from the auth middleware and the starter kit.

The test

Laravel apps usually test with Pest, with model factories building the data:

<?php

use App\Jobs\NotifyPostAuthor;
use App\Models\Post;
use App\Models\User;
use Illuminate\Support\Facades\Queue;

it('adds a comment to a post', function () {
    Queue::fake();
    $user = User::factory()->create();
    $post = Post::factory()->create();

    $this->actingAs($user)
        ->postJson("/posts/{$post->id}/comments", ['body' => 'Nice post'])
        ->assertCreated();

    expect($post->comments()->count())->toBe(1);
    Queue::assertPushed(NotifyPostAuthor::class);
});

Rails ships Minitest and loads test data from fixtures, YAML files that are inserted once and rolled back after each test:

require "test_helper"

class CommentsControllerTest < ActionDispatch::IntegrationTest
  include ActiveJob::TestHelper

  test "adds a comment to a post" do
    sign_in_as users(:one) # a helper that logs in through the session route
    post_record = posts(:one)

    assert_difference -> { post_record.comments.count }, 1 do
      assert_enqueued_with(job: NotifyPostAuthorJob) do
        post post_comments_url(post_record), params: { comment: { body: "Nice post" } }, as: :json
      end
    end

    assert_response :created
  end
end

What the comparison shows

  • The amount of code is close. Rails is a little shorter because the generator writes the migration and the routes come from resources; Laravel is a little more explicit, which some teams prefer when reading code months later.
  • Rails centralizes rules in the model; Laravel spreads them across requests, policies and models. Laravel's form request classes and policies keep controllers thin once the app grows.
  • Testing culture differs. Fixtures make Rails tests fast but shared; factories make Laravel tests explicit but slower to set up. Many Rails teams switch to RSpec and factory_bot, which feels closer to Laravel.

Working with the database: Eloquent and Active Record

Both ORMs follow the active record pattern: a model class maps to a table, and an instance is a row that saves itself. Day to day they feel very similar. The differences are in the guard rails.

N+1 queries are the most common performance bug in both. Each framework can make them fail loudly in development:

// app/Providers/AppServiceProvider.php, in boot()
use Illuminate\Database\Eloquent\Model;

Model::preventLazyLoading(! app()->isProduction());
# config/environments/development.rb
config.active_record.strict_loading_by_default = true

With either setting on, loading comment.user in a loop without eager loading raises an error in development instead of quietly running one query per row.

TaskEloquent (Laravel)Active Record (Rails)
Eager loadPost::with('comments.user')Post.includes(comments: :user)
Reusable queryLocal scope or a custom builderscope or a class method
Batch over many rowslazyById(), chunkById()find_each, in_batches
Encrypted columnencrypted castencrypts :column
Schema overviewRead migrations, or schema:dumpdb/schema.rb, always current
Multiple databasesRead/write split in the connection config; sharding by handPrimary and replica roles, plus built-in horizontal sharding
Vector searchwhereVectorSimilarTo (Laravel 13)neighbor gem

Both handle read replicas; Rails also has built-in horizontal sharding, which matters once one database server is no longer enough. Laravel has the more convenient query builder for raw SQL work, and first-party vector search.

How each one serves a request

This is where the two really differ, and it explains most of what people say about their speed.

Laravel runs on PHP's shared-nothing model. Under PHP-FPM, every request boots the framework, handles the request and throws everything away. OPcache keeps the compiled code in memory, so booting is cheap, and nothing can leak from one request into the next. The cost is that boot work repeats on every request. Laravel Octane removes it by keeping the app in memory between requests, on FrankenPHP, Swoole or RoadRunner. That makes Laravel faster on busy endpoints, but it brings the rules of long-running processes back: no state in static properties or singletons that should be per-request.

Rails runs as a long-lived process. Puma keeps the app booted and serves requests with a pool of threads in each worker process. Ruby has a global lock (the GVL), so threads help while a request waits on the database or an API, and worker processes give you parallel CPU work. YJIT, Ruby's JIT compiler, is on by default in Rails 7.2 and later on Ruby 3.3 or newer. Each worker holds the full app in memory, often a few hundred MB, so on a small server memory sets the worker count more often than CPU does.

What this means in practice:

  • For typical web pages and JSON endpoints, neither is the bottleneck. The time goes to database queries, external APIs and serialization. One missing index costs more than the framework choice. Reading EXPLAIN ANALYZE will do more for your latency than switching frameworks.
  • Laravel under plain PHP-FPM is the easiest to run safely, because there is no shared state to get wrong.
  • Laravel with Octane, and Rails with Puma, are the setups that scale per server. Both need code that does not keep request data in global state.

Published benchmarks rarely match a real app, so measure your own: load-test one realistic endpoint on staging, and compare p50 and p99 latency, error rate, and memory per worker. The Laravel performance guide covers the Laravel side in detail.

Scaling past one server

Both scale the same basic way: run more app servers behind a load balancer, keep sessions and cache out of the app servers, and move slow work to background jobs. GitHub and Shopify run Rails at very large scale, and Laravel apps scale the same way. Neither framework is what stops an app from growing.

The difference is what you have to run next to the app:

NeedLaravelRails 8
Background jobsRedis with Horizon is the usual setup; database, SQS and others work tooSolid Queue, stored in your database
CacheRedis or Memcached, or the database driverSolid Cache, stored in your database
WebSocketsReverb, Laravel's own WebSocket serverAction Cable with Solid Cable, stored in your database
Dashboard for jobsHorizon (Redis only)Mission Control – Jobs

Rails 8's "Solid" trio means a new Rails app needs only the app server and a database, even with jobs, cache and WebSockets. That is a real saving for a small team: one less service to run, secure and back up. Laravel can also run its queue and cache on the database, but its best tooling, Horizon in particular, assumes Redis. When you grow, Redis is worth adding to either; see caching strategies with Redis and Valkey.

Background jobs: the same task in both

A job that imports thousands of records, retries on failure, and must not redo finished work after a deploy restarts it.

Rails 8.1 has job continuations: the job is split into steps, and a cursor records progress, so an interrupted job picks up where it stopped.

class ProcessImportJob < ApplicationJob
  include ActiveJob::Continuable

  retry_on ActiveRecord::Deadlocked, wait: :polynomially_longer, attempts: 5

  def perform(import_id)
    @import = Import.find(import_id)

    step :process do |step|
      @import.records.find_each(start: step.cursor) do |record|
        record.process
        step.advance! from: record.id
      end
    end

    step :finalize
  end

  private
    def finalize
      @import.finalize
    end
end

Laravel 13 declares retries and back-off with attributes on the job class. There is no built-in continuation, so resuming after an interruption is up to you, for example by saving the last processed ID on the import record.

<?php

namespace App\Jobs;

use App\Models\Import;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Queue\Attributes\Backoff;
use Illuminate\Queue\Attributes\Timeout;
use Illuminate\Queue\Attributes\Tries;

#[Tries(5)]
#[Backoff([10, 60, 300])]
#[Timeout(600)]
class ProcessImport implements ShouldQueue
{
    use Queueable;

    public function __construct(public Import $import) {}

    public function handle(): void
    {
        $this->import->records()
            ->where('id', '>', $this->import->last_processed_id ?? 0)
            ->lazyById()
            ->each(function ($record) {
                $record->process();
                $this->import->update(['last_processed_id' => $record->id]);
            });

        $this->import->finalize();
    }
}

Laravel 13 can also send whole groups of jobs to a queue from one place, for example Queue::route(ProcessImport::class, connection: 'redis', queue: 'imports') in a service provider. Rails gives you resumable jobs for free; Laravel gives you a richer dashboard in Horizon and more queue backends.

Front end

Both let you build the whole interface on the server, and both let you put a JavaScript framework on top.

  • Rails defaults to Hotwire: Turbo for page updates without a full reload, Stimulus for small bits of JavaScript, and import maps, so a new app needs no Node build step. It is the fastest way to a responsive app with very little JavaScript.
  • Laravel offers Livewire for server-driven components, or Inertia with React, Vue or Svelte if you want a JavaScript framework without writing a separate API. Its starter kits come with authentication, TypeScript, Tailwind and shadcn/ui.

If your team already writes React or Vue, Laravel with Inertia is the more natural fit. If you would rather write as little JavaScript as possible, Rails with Hotwire is the more complete default.

Auth and security defaults

Both frameworks are secure by default against the common web attacks. What differs is how much of the auth layer you get, and how secrets are stored.

LaravelRails
Login, registration, password resetStarter kits (React, Vue, Svelte or Livewire), or Fortify without a UIbin/rails generate authentication writes session login and password reset into your app; registration you add yourself, or use Devise
Social loginSocialite (first-party)OmniAuth
API tokensSanctum (first-party)has_secure_token, or a gem; Doorkeeper for a full OAuth2 server
OAuth2 serverPassport (first-party)Doorkeeper
AuthorizationPolicies and gates, now also as #[Authorize] attributesPlain Ruby, or Pundit or Action Policy
Mass assignment$fillable on the modelStrong parameters in the controller (params.expect)
CSRFOn by default; Laravel 13 adds origin checksOn by default
Secrets.env file, optionally encrypted with env:encryptEncrypted credentials.yml.enc, edited with bin/rails credentials:edit
Security scannerCommunity toolsBrakeman, included in new apps since Rails 7.2

Laravel gives you more of the auth stack as first-party packages. Rails gives you less code but owned by you: the authentication generator writes plain controllers and models you can read and change, instead of a dependency. Rails also scans every new app for security issues out of the box.

Testing and CI

LaravelRails
Test frameworkPest or PHPUnitMinitest by default; RSpec is very common
Test dataModel factoriesFixtures by default; factory_bot is common
Browser testsDusk, or Pest's browser testingSystem tests with Capybara
Fakes for side effectsQueue::fake(), Mail::fake(), Http::fake() and moreTest helpers for jobs and mail; WebMock for HTTP
CI out of the boxNone generatedA GitHub Actions workflow in new apps, and since 8.1 a local bin/ci
Formatter and linterPint, includedRuboCop with the Rails Omakase rules, included
Static analysisPHPStan with LarastanSorbet or Steep, rarely used

Laravel's fakes are a strong point: one line turns off a whole kind of side effect and lets you assert on it. Rails' strength is that a new app arrives with tests, linting, a security scan and a CI workflow already wired up, so the team starts with the habits in place.

The packages you will reach for

Most apps need the same dozen extras. Laravel tends to have a first-party package; Rails tends to have a long-established community gem, or a built-in framework.

NeedLaravelRails
Admin panelFilament (free), Nova (paid, first-party)Avo, ActiveAdmin, Administrate
Subscriptions and paymentsCashier for Stripe and PaddlePay gem (Stripe, Paddle, Braintree, Lemon Squeezy)
Full-text searchScout with Meilisearch, Typesense, Algolia or the databasepg_search, Searchkick
File uploadsStorage (S3, local and more)Active Storage, built in, with image variants
Rich text editingCommunity editorsAction Text, built in
Receiving emailCommunity packagesAction Mailbox, built in
Feature flagsPennant (first-party)Flipper
MonitoringPulse, Telescope, Nightwatch (hosted)Mission Control for jobs; AppSignal, Scout or Skylight for performance
Real-timeReverb and EchoAction Cable, Turbo Streams

Laravel's first-party packages share one style and one release cycle, which makes them easy to adopt together. Rails covers more inside the framework itself, Active Storage, Action Text and Action Mailbox in particular, so there is less to choose.

Day-to-day tooling

LaravelRails
Command linephp artisanbin/rails
Interactive consoleTinkerbin/rails console
Generatorsmake:model -mfc and dozens moregenerate scaffold builds a full working feature
Local environmentHerd (macOS and Windows) or Sail (Docker)bin/dev, optional dev container
TypesNative PHP types on parameters, properties and returnsDynamic; optional RBS signatures
Editor supportVery good, helped by types and PhpStorm with Laravel IdeaGood with Ruby LSP; less certain on dynamic code

The biggest everyday difference is typing. PHP's native types let editors and static analysis catch many mistakes before you run the code. Ruby code is shorter and reads closer to English, but more mistakes surface only when tests or the app run, which is one reason Rails culture leans so heavily on tests.

Deployment and hosting cost

Rails 8 ships with Kamal. kamal setup takes a fresh Linux server, installs Docker and deploys the app, with Thruster in front of Puma for compression and asset caching. Since Rails 8.1, a basic deploy does not even need a container registry. With the Solid trio, one inexpensive VPS can run the entire app.

Laravel has more managed options: Forge provisions and manages servers you own, Laravel Cloud is a fully managed platform, and Vapor runs apps on AWS Lambda. PHP also runs on almost any host, including cheap shared hosting, which matters for small client projects and in markets where that is the default.

Both containerize well; the Docker course covers a production setup for either.

AI features

Laravel 13 has first-party AI support. The Laravel AI SDK gives one API for text generation, tool-calling agents, embeddings, images and audio across providers, and the query builder can run vector similarity searches on PostgreSQL with pgvector:

$documents = DB::table('documents')
    ->whereVectorSimilarTo('embedding', 'Best wineries in Napa Valley')
    ->limit(10)
    ->get();

Rails has no first-party equivalent. You use community gems such as RubyLLM for model calls, and the neighbor gem with pgvector for similarity search. They work well, but you assemble them yourself. If AI features are central to the product, Laravel currently makes that easier. For the database side in either framework, see vector search in Postgres.

Hiring and community

PHP has the larger pool of developers, and Laravel is the most popular PHP framework. In many markets Laravel developers are easier to find than Rails developers, and many agencies build on it by default.

Ruby's pool is smaller but experienced. Rails developers often have years of the same conventions behind them, and a Rails codebase tends to look familiar to any Rails developer you hire. Expect fewer applicants per opening.

Check your own market before deciding: search your local job boards for both, and look at the language numbers in the latest Stack Overflow developer survey.

Long-term cost

Both expect you to keep up. Laravel releases a major version every year and supports each one for two years of security fixes; it aims for upgrades that take a day or less, and Laravel Shift can automate much of the work. Rails ships one or two releases a year and supports each for about two years of security fixes; upgrades of large apps can take longer, especially across major versions. Neither framework is going away: both have active core teams, regular releases and companies that depend on them.

Mistakes that hurt in each

In Laravel:

  • Leaving lazy loading on in development. N+1 queries pile up unnoticed until production. Turn on preventLazyLoading on day one.
  • Keeping request data in singletons or static properties under Octane. It works under PHP-FPM and leaks between users under Octane. Audit for it before switching.
  • Validating only in the controller. Jobs, commands and imports that create records skip those rules. Put shared rules in form requests or a dedicated class you call everywhere.
  • Running slow work during the request. Sending mail, calling APIs and generating PDFs belong in queued jobs; with the sync driver left on in production, they quietly do not.

In Rails:

  • Callbacks that do too much. An after_save that sends mail or calls an API runs on every save, including imports and console fixes. Move side effects into jobs or explicit service objects.
  • Too few Puma workers, or too many. Each worker holds the whole app in memory. Size the count to the server's RAM, and keep threads modest when requests do CPU work.
  • Ignoring strict_loading. N+1 queries are as easy to write in Rails as in Laravel.
  • Falling behind on upgrades. Skipping several Rails versions turns a routine upgrade into a project. Upgrade one version at a time, as each release comes out.

How to choose

ChooseWhen
LaravelThe team writes PHP
LaravelYou need to hire several developers quickly, or work with agencies
LaravelAI features or vector search are central to the product
LaravelThe app must run on shared hosting, or you want managed hosting from the framework's makers (Cloud, Vapor)
LaravelThe team prefers React or Vue for the interface
RailsThe team writes Ruby
RailsYou want to run the whole app on one server and a database, with no Redis
RailsYou want long jobs that resume after a restart without extra code
RailsYou want the smallest amount of JavaScript and no Node build
RailsA small senior team will maintain the app for years

If both fit, choose the language your team writes best. A team is far more productive in the framework it knows than in the one that wins a feature table.

Questions that come up

Is Laravel faster than Rails?

Not in a way that decides anything for most apps. Laravel on Octane and Rails on Puma with YJIT are both fast enough that, in a typical app, database queries and external calls take more time than the framework does. Plain PHP-FPM pays a small boot cost on every request in exchange for having no shared state. Measure your own endpoints before treating speed as a reason.

Is Ruby on Rails dead in 2026?

No. Rails 8.0 and 8.1 added major features, Ruby 4.0 came out in December 2025, and large companies such as GitHub and Shopify run on Rails. Its community is smaller than Laravel's, which matters for hiring, not for whether the framework will be maintained.

Which is better for an API?

Both are good. Rails has an API-only mode (rails new --api). Laravel has Sanctum for token auth, and Laravel 13 adds first-party JSON:API resources. If the API is the whole product and you want typed request models with automatic docs, also look at FastAPI.

Which is easier to learn?

Laravel is usually easier to start, because PHP runs everywhere and the documentation is unusually good. Rails asks you to learn its conventions, and repays it once you have. Both have generators that build a working feature in minutes.

Can Laravel run without Redis?

Yes. Queues, cache and sessions all have database drivers, which are fine for small and medium apps. You give up Horizon, which only manages Redis queues, so most growing Laravel apps add Redis eventually. Rails 8 is designed to run without it from the start.

Which has the better admin panel?

Laravel, narrowly. Filament is free, polished and very widely used, and Nova is a paid first-party option. Rails has good choices too, Avo, ActiveAdmin and Administrate, but none is as dominant as Filament.

Can I move from one to the other later?

Not cheaply. The languages, ORMs and conventions differ throughout, so a move is a rewrite. Choose with the next few years in mind, and if performance is the reason to leave, read replacing Laravel with Rust first.

Sources and docs