The RailsNotes Newsletter 🟥 ISSUE #24

🟥 ISSUE #24 (SQLite, Litestack, the Lite-ist stack and more!)

This year is shaping up to be the Rails + SQLite love-affair we’ve been holding out for 😘 

— SPONSOR —

Need speed and flexibility in scaling your dev team?

Revelo is the largest platform to hire world-class remote developers from LatAm. Get matched with vetted candidates in 3 days and receive a $2,500 credit on your first hire.

Welcome to The RailsNotes Newsletter — Issue #24! This issue we’re talking SQLite!

Hello and welcome to the 100+ new people since last week! It’s been unreal seeing so many new people joining the newsletter (mainly due to my Rails 8 article getting featured in this week’s Ruby Weekly!).

In this newsletter, we’re talking SQLite. Rails and SQLite go a long way back, and lately, there’s been a ton of work going into making sqlite3 the best choice for new Rails apps! I wanted to dive into some of that today since — 

  1. I think it’s exciting to see the tech evolving, and

  2. because Rails 8 is leaning into SQLite hard.

One last thing — After the surge of new readers, there are over 750+ of you now which is unreal; make sure to follow me on Twitter/X for behind-the-scenes updates, and check out the newsletter archive to browse the previous issues.

With all that out of the way, let’s get into it!

~ FEATURED ARTICLE ~

SQLite is essentially plug-and-play with Rails at this point; This is my plug, now it’s time for you to play! (I hear you booing this pun and it only fuels me).

The Fly team (Brad in particular) have put together this great article on using SQLite for a production Rails app. This article is a great entry point to running SQLite in production — It uses Litestack, a brilliant adapter to use SQLite for your database, job queue, cache and more.

It’s a quick intro article to getting a Rails app deployed on the Fly platform and running SQLite as the database/job queue/cache. Brad also runs through a short production checklist & shows you how to persist the SQLite instance to a disk; Overall, it’s a great little intro to running SQLite + Rails in production.

With DHH pushing hard on SQLite for Rails 8 and ONCE, and tuning it for some pretty unreal performance, I think it’s a great time to explore using sqlite3 more (instead of defaulting to PostgreSQL all the time). Worth a read & a play-around!

This article is part of a 14-part series (mega-series?!) on using SQLite with Rails! 🤯 Stephen (the author) has done an unbelievable job of digging deep and documenting everything you need to know about pairing a Rails app with SQLite.

This particular article is on fine-tuning your SQLite configuration, but he’s also written articles about running branch-specific databases, setting up Litestream, and much, much more!

Litestack is the beating heart of most Rails + SQLite apps these days. It’s a gem that includes sqlite3 adapters to manage/replace your:

  • Database Server (PostgreSQL, MySQL)

  • Cache Server (Redis, Memcached)

  • Job Processor (Sidekiq, Goodjob)

  • Pubsub Server (Redis, PostgreSQL)

  • Fulltext Search Server (Elasticsearch, Mielisearch)

It’s unreal! You can basically replace your entire app infrastructure with a single gem! Litestack has steadily grown in popularity since it was released, gotten some HN attention, and pushed SQLite adoption hard in the Rails community.

This article digs deep into using Litestack to build an actual Rails app (a basic TODO app), using Litestack for all the app infrastructure!

It still blows my mind that you can replace so much infra with just SQLite, but the author does a great job breaking everything down and walking you through a full implementation + deployment. Worth pairing with the featured article above for a full Sunday afternoons-worth of hacking 🧑‍💻 

~ ⚒️ HANDY TIP ~ 

→ A Sandboxed Rails Console environment

Did you know that the Rails console has a sanbox mode? 

By passing the —sandbox flag to rails console, you can enter a sandboxed environment. When you exit a sandboxed Rails console session, all your changes will get rolled back!

Run a Rails console session in a sandboxed environment using the —sandboxed flag.

You don’t want to use this in production, but it can be handy when you’re developing locally and don’t want your changes to persist.

~👀 BEHIND THE SCENES~ 

This is a private section 🔐 for readers with 2+ referrals!

I share behind-the-scenes updates on RailsNotes and RailsNotes UI (think traffic numbers, sales, upcoming updates etc.)

Want access? Learn about the referral program down below! 👇️ 

This newsletter absolutely exploded this week! The RailsNotes blog saw a monster traffic spike this week after my Rails 8 article got featured in Ruby Weekly. Thanks to the exit intent modal I mentioned last week, a bunch of new people learned about this newsletter!

subscribers go brrrrr….

visitors also go brrrrr….

By my calculations, I converted visitors→subscribers at a rate of approx 3.6%. Calculations being — 

  • approx 2.9k people visited via a desktop platform (Mac + Windows + Linux) over the past 7 days (the exit intent modal only shows on desktop).

  • 105 new subscribers over the past 7 days.

  • (105/2900) * 100% = ~3.6% conversion rate.

This conversion rate seems pretty typical for a basic exit-intent modal; I might spend some time optimizing the modal soon (great modals seem to convert at >10%, which is huge); Part of me thinks it might just be better to write more articles and drive more traffic to the blog though 😅 

We’ll see what I end up doing, but either way, stoked with this (and extremely glad I added that modal when I did!)

~ 🌯 WRAP UP ~ 

Thanks for reading! The quick wrap-up for this week is — 

  1. SQLite is growing massively in popularity, and Rails 8 is embracing it.

  2. Litestack is a powerhouse and can replace most of your application infrastructure with a single gem.

  3. Tons of new people have joined this newsletter! If you’ve got feedback, just reply to this email and I’ll get it. I reply to every single email you send me; I love to hear from you all!

→ Big thank you 🙏 to cvz5an and jariquelme for referring your friends to the RailsNotes Newsletter!

Share the RailsNotes Newsletter!

Use your unique link below to refer new Ruby on Rails devs to this newsletter (and make me really happy!). I’ll reward you with coupon codes, access to a private section, and a free RailsNotes UI license key 👇️ 

  • [Refer 1] A small feature in the next newsletter (with a link to something you’re working on, or your socials)

  • [Refer 2] Permanent access to the behind-the-scenes section, above 👆️ 

  • [Refer 5] A $20 coupon for RailsNotes UI 📬️ 

  • [Refer 15] Free licence key for RailsNotes UI 🤑