Rails for everything

by FigurativeVoidon 1/1/25, 8:58 PMwith 243 comments
by ajmurmannon 1/1/25, 11:18 PM

I've been building some apps with stacks lately that are supposed to be more modern and performant. Namely an app with Spring Boot and another with Micronaut. Both had a React frontend. It really made me appreciate Rails' omakase approach. Just having a form that shows validation errors from the backend and having something as simple as Rails' flash messages isn't solved by the frameworks themselves and requires you to build it yourself or find a third-party solution that might or might not do the basic thing you need or might or might not be well-supported. Rails truly solves the problems 90% of web apps share. It might not be in a way that's perfect for your specific project but it will likely work and you can swap it out one you've validated you app or feature.

by rednafion 1/2/25, 1:38 AM

Rails is awesome, and so is Django. I’ve built mission-critical apps in both and still do with Python. That said, I’d love to switch to Go for building large monoliths since it has a tighter type system and better concurrency constructs.

The problem is, Go community has never really filled that gap. I love Go, but the whole "Go doesn’t need a Rails or Django" mindset is part of why it hasn’t taken off in this space. Building networking tools and CLIs in Go is great, but when it comes to quickly building a full-stack web app, I still reach for Rails or Django. So this whole "X is dead" doesn't apply to Rails at all.

by nomilkon 1/2/25, 2:57 AM

> if you follow (the Rails Guides) start to finish, you'll have a Rails app in production. And it isn't just hello world. Your app will have authentication, caching, rich text, continuous integration, and a database. That's a real application.

These features are great for established apps like GitHub and Airbnb, but if you're making a tiny startup, and want to test ideas quickly, I wouldn't spend time on CI, caching, Rails's authentication (use extremely feature rich Devise gem), Rails's 'turbo' features, and writing tests. These are all good things for medium or larger apps, or well-funded apps with a long run way, but are usually cost-benefit negative for small apps.

Turbo saves a fraction of a second on many page loads, but can add days of development time for those not fluent in javascript when it causes some core functionality to not work (e.g. devise's Log out!). Testing is very important on large apps but for quickly flicking a few ideas together and getting it in front of users; unless you're a banking or healthcare app, they can probably be postponed until you have traction.

Be mindful of your size and timelines and don't succumb to 'default bias' where you use things simply because they were there out of the box. Feel confident to say 'no, we don't need that (for now)'.

by icameronon 1/2/25, 2:18 AM

Glad to see Rails is looking better than ever! I've been supporting a few Rails web apps since the Rails 2.3 days -almost 12 years- and today's rails is quite different, like a fully evolved Pokémon. Thankfully the comprehensive Rails Upgrade Guides are solid and well documented. It was manageable to upgrade my apps one version at a time over the years without a major refactor. Rails embraces new developments in web tech, so it's never been backwards compatible, but at least their changes are well documented. ActiveStorage was a huge improvement over the 3rd party gems for file attachments, and came with cloud provider support. The toughest lift was the migration to Webpacker from Bundler for the javascript stuff, which we only finally did a couple years ago. But now it looks like that is all behind us with Import Maps support. I'm looking forward to upgrading these apps once again to 8.1 this year.

by block_daggeron 1/2/25, 12:11 AM

As a single developer of an open source Rails project that has grown to serve ~120k MAU, I can attest to this article’s claims. One tidbit to add: ActiveStorage, which provides file attachment features, is another excellent piece of the Rails family. I’ve been using Dokku but looking forward to trying Kamal. Rails keeps getting better, and Ruby keeps getting faster.

by rich_sashaon 1/2/25, 12:10 AM

As someone who doesn't do enough web dev to justify learning Ruby just for Rails: how does it compare to Django? That's the only batteries-included web backend framework I'm familiar with...

Asking out or curiosity.

by shermantanktopon 1/2/25, 2:20 AM

There’s a thing here that seems to separate people like the article author from…well, from me. They just have a deep, deep affection for Ruby and Rails.

It makes everything great, and every new surprise is like discovering that your new special friend also knows how to juggle! And speaks Cantonese! How cool is that?? Oh, they’re afraid of spiders? How cute. But did you know they went to Ecuador in college?

There’s a honeymoon effect that just never stops, whereas for me it never started. I’m actually jealous.

by ezekgon 1/1/25, 11:51 PM

After using SQLite in production for a little while, I don't think "SQLite is all you need." Migrations are a pain, so any long-lived app will eventually experience pain. As an example, SQLite doesn't have a way to add a NOT NULL constraint to an existing column; you have to rebuild the entire table using a temp table.

by cjohnson318on 1/2/25, 4:36 AM

> There's a bit of hand waving around installing Ruby (which is still more difficult than it needs to be).

For real. I put together a simple Jekyll blog, and figuring out gems and this and that after not looking at Ruby for 15 years was a real slog. A lot of that was my fault for being out of the Ruby loop, and being unfamiliar with Jekyll, but I feel like the process could have gone a little more smoothly.

Anyway, this made me excited to try Ruby again.

by mosselmanon 1/1/25, 11:17 PM

If you want to only use sqlite, I suggest looking into litestack: https://github.com/oldmoe/litestack

I've not used it myself, but I am going to rewrite one of my projects that I only use locally from postgres to litestack. The benchmarks are incredible!

https://github.com/oldmoe/litestack/blob/master/BENCHMARKS.m...

by Syntafon 1/2/25, 7:54 AM

I’m building a member management platform [1] with Rails + Turbo + Stimulus and it continues to surprise me how easy it is to just… do things with rails.

* Want to allow your users to write rich text? Easy just use ActionText * Storage and attachments? ActionStorage is easy to setup * Job queue, asynchronous work? No problem with ActiveJob

Today I learned about Rails system tests and found it so cool. With almost no configuration I can write tests that interact with my app through a headless browser.

Rails is the ultimate solo developer and hobby project tool for me

[1] https://embolt.app

by ethagnawlon 1/1/25, 11:26 PM

Inbuilt authentication is a very welcome addition. I've been using Django instead of Rails for the last 4-5 years (for business reasons) and that was one of the features Django provided which, upon reflection, seems like table stakes for a modern web app. The other glaring omission being an inbuilt admin interface -- which may have been added after I moved on.

by Kerrickon 1/1/25, 11:30 PM

Since Rails 8 I’ve even found myself using Rails + Sitepress over a static site generator. Kamal makes it really easy to run multiple lightweight sites on a cheap VPS writing even less configuration than Nginx, so it saves time up front.

Plus, nearly every static site ends up with someone saying, “oh I wish I could ____, but it’s a static site.” Instead of needing to pick a client-side-only solution, use a third party service, or integrate with a cloud Functions as a Service provider, Rails and a production-ready database are right there ready to help.

by phoronixrlyon 1/1/25, 11:02 PM

The essential convention over configuration ideas still prevail when you want to pile on functionality quickly and without boilerplate.

by rootedboxon 1/2/25, 5:31 AM

With sqlite and docker.. rails apps are easy to share.. my last project is easy to install and use because of rails https://github.com/ThinkThinkAI/ThinkDB

# change directory_on_your_machine_for_think_db_storage docker run -d --name thinkdb -p 3000:3000 -v directory_on_your_machine_for_think_db_storage:/app/storage thinkthinkai/think_db:latest

TADA.. Rails is great.

by hk1337on 1/2/25, 12:49 AM

I’m curious on others thoughts on whether or not to use Devise?

With the recent Rails updates, even in Rails 7, Devise didn’t seem that useful and seemed to over complicate the user authentication, registration, lost password experience and also seemed like I had to do a lot of work overriding their views to fit with my application. It seemed easier to not use Devise? It had its usefulness in earlier versions of Rails but not so much now?

by 94b45eb4on 1/2/25, 3:13 AM

Ruby and Rails anre amazing. I love Rails and recommend it for most small to medium sized projects. What I find frustrating though is the constant hum of people using “Ruby is slow” as the excuse for every problem they have. Everyone I know using Rails is in the process of convincing everyone that they have outgrown its capabilities and need to move onto something “more mature”. I also see a lot of people using Rails but replacing its components with others. A. If part of what makes Rails powerful is that it comes with pretty much everything you need, replacing them without good reason (there usually isn’t one) erodes the value you get from Rails.

by jilleson 1/2/25, 12:16 AM

If you replace the title with Django it still works. I’m doing the same as the author, but with Django.

by anthony_francoon 1/2/25, 12:42 AM

I agree with everything except for Kamal. I'm happy to have someone else handle the server side maintenance. Maybe once my service grows so huge that handling it myself makes sense moneywise, but starting off that way is overkill when there's such affordable alternatives.

by VeejayRampayon 1/2/25, 11:18 AM

Ruby and Ruby and Rails are really having a revival recently

I guess the work on performance and tooling has paid off and people are starting to realize that if python can have the spotlight then ruby (overall a better language) might deserve it too

by dartoson 1/2/25, 1:03 PM

For those of you with a functional bend, check out elixir and phoenix.

Elixir very similar to ruby in syntax and Phoenix very similar to rails in functionality.

The creator of elixir (Jose Valim) was a core rails contributor back in the day IIRC

by lyloon 1/2/25, 9:00 AM

Rails is wonderful and I’m thankful for what the community (and DHH) has done over the years.

My company (founded 2007) was built on Rails and that B2B app now has 200,000 customers… all on a Rails monolith, the same code base that has evolved with Rails over the years. It’s not just for side projects!

That’s said, I run my current side project on Rails 8 and Postgres (I don’t get on with SQLite). You can do so much with so little code! Inspect the source code here if you like :) https://github.com/lylo/pagecord

by cal85on 1/2/25, 1:31 PM

Anyone know any good hosting options for little personal, experimental Rails apps that might not go anywhere (i.e. that I might well lose interest in but forget to cancel)?

I’ve always liked Vercel’s approach for these kind of side-projects, as I don’t have to worry about cancelling anything if I stop using it. But I guess that is a perk of it being serverless, which precludes Rails. What’s the next best option, something suitable for small, database-driven Rails apps?

by wiseowiseon 1/2/25, 3:06 PM

I always read how great Ruby/Rails are, but learning language just for one thing (Rails) rubs me up the wrong way. Especially when alternative (Python) is so much more useful (on a surface) and Django can do the job of Rails (while not as good or nice as Rails (from what I gathered), but still). Kinda like learning Dart for Flutter.

Those of you who struggled with the same dilemma, what did you do?

by thathooon 1/2/25, 2:50 AM

I 100% agree. I have been able to get started super quickly with small projects using Rails. Such a blessing!

by dzongaon 1/2/25, 7:05 AM

for auth - instead of devise or the rails 8 auth - you can also opt for authentication-zero.

what's hardly ever mentioned is how great hotwire is. it takes time getting used to, documentation is sparse but oh man oh man - hotwire is nice. you get to skip a majority of spa shenanigans.

by nickjjon 1/2/25, 12:58 PM

One thing I don't get about the current Rails direction is pushing hard to use SQLite and removing external dependencies but at the same time also advocating to use Docker.

Running Postgres and Redis in Docker is a matter of adding a few lines of YAML to a file once and never thinking about it again. I have done this for 10 years, it is painless.

I'm all for reducing moving parts and would also choose the same strategy if there were no down sides but DHH is running their apps on dedicated hardware with some of the best performing SSDs you can get. Most VPS providers have a lot worse disk performance.

There's also downsides to running your DB (SQLite or Postgres) directly on your single VPS when it comes to uptime. If your server is stateless then you can upgrade it with zero downtime. All you have to do is spin up a new server, provision it, add it to DNS, wait a day or 2 and then decommission the old one. This is nice for resizing instances or big OS updates in a zero risk way. You can just make a new server.

That works because it doesn't matter if the old or new server is writing to your externally hosted DB. If your DB is directly on the host or using block storage that can only be connected to one instance at a time then you can't spin up a new server since one of the DBs will get out of date.

by jchwon 1/2/25, 12:46 AM

Don't really know much about Rails because I wound up picking Django instead when faced with the choice many years ago. That said, honestly, my perspective of Ruby on Rails has been tainted by watching GitLab get pwned over and over and over. My distro can barely keep up with GitLab being pwned because by the time the security release hits stable channels there's already another CVE. I liked GitLab, but something is deeply wrong.

Of course clearly not all apps are GitLab, but GitLab is the only Rails app I run, and must be one of the most problematic software I've ever deployed for security patching, and most of it seems to do with issues in the Ruby side of things. What makes GitLab so uniquely crap at security, and how do you avoid it as a Rails developer?

by patateroon 1/2/25, 4:17 AM

Title says "everything" but author didn't mention Android/iOS apps.

by kissgyorgyon 1/2/25, 7:53 AM

Same for Django+SQLite

by rgloveron 1/2/25, 1:17 AM

> Rails is not dead; It's better than ever. Try using it to make something new this year.

I hope as an industry we can move away from this "___ is dead" talk. The OP shouldn't even need to say this. If something is being worked on (in any capacity) and has at least one user, it isn't "dead."

"Is it dead" is groupthink questioning that leads to great ideas being swept under the rug because they're not perceived as popular enough.

Think for yourself and use the tools that make sense to you.

by darksaintson 1/2/25, 1:46 AM

> Rails is not dead; It's better than ever. Try using it to make something new this year.

Apparently that's one of the few things you can do well with a rails app. As evidenced by all of the rails apps stuck behind 3+ major versions because refactoring or upgrading without breaking everything is damn near impossible.