Skip to content

SQLite and LiteFS: The Heart of QuickLinker-ZeroRPM ​

Alright, let’s get into why SQLite and LiteFS are the real MVPs for QuickLinker-ZeroRPM. This isn’t some textbook theory—I’ve been digging into these tools to see if they can actually pull off 100,000 requests a minute at zero cost. Spoiler: they can, and it’s pretty damn cool. Here’s the rundown on what they bring to the table, why they beat out the big dogs like PostgreSQL or MongoDB, and how LiteFS takes it up a notch.

Why SQLite? It’s Lean and Mean ​

I started with SQLite because I wanted something that wouldn’t cost me a dime and could still handle serious traffic. Here’s why it’s a no-brainer for this gig:

  • Zero Bucks, All Guts: SQLite doesn’t need a server—just a file on the VM. No licensing, no extra VMs, nada. Running it on Oracle’s free tier (4 cores, 24 GB RAM) keeps my wallet happy while it churns through URLs.

  • Speed That Slaps: With some tuning—Write-Ahead Logging (WAL), synchronous normal mode, memory mapping—it’s hitting 80,000 inserts a second (check this out). For 100,000 RPM? That’s 1,666 requests a second, with 1% writes (16.7 new URLs) and 99% reads (1,650 redirects). Redis eats 99% of those reads, leaving SQLite with like 33 ops a second. That’s pocket change for it.

  • Real-World Proof: Bit.ly does 23,000 RPM with ~230 new URLs a minute (Bitly stats). My target’s higher, but the write load’s similar—SQLite’s built for this kind of thing.

Compared to PostgreSQL or MongoDB? PostgreSQL’s solid for Phase 1’s 100 req/s—ACID-compliant, simple schema—but it’s a hog when you scale up, needing replicas that cost cash. MongoDB? Great for reads, but Redis already owns that, and its 3-node setup for HA is like $15-30 a month. Nope, SQLite’s my ride-or-die here.

LiteFS: Making SQLite Tougher ​

Now, SQLite’s awesome, but it’s got a weak spot—it’s single-node by nature. If that VM goes down, so do my links. Enter LiteFS—found this gem while digging around (LiteFS GitHub)—and it’s a game-changer for Phase 3. Here’s why I’m stoked about it:

  • Replication on the Cheap: LiteFS uses a FUSE filesystem to sync SQLite across nodes. No extra VMs needed—it runs on the free tier’s spare juice. If one node crashes, another picks up the slack. That’s 99.9% uptime without breaking my $0 budget.

  • Keeps It Simple: It’s not a full-on replacement—it’s SQLite with a safety net. Writes still hit one primary node, but LiteFS mirrors it live. No crazy setup, just bolt it on and go.

  • Fits the Plan: At 33 ops a second (16.7 writes, 16.5 reads after caching), replication’s a breeze. Low write load means no bottleneck, and I’ve got 4 cores and 24 GB RAM to play with.

I was worried SQLite might choke under pressure, but LiteFS makes it resilient without me selling my soul to a cloud bill.

How It Stacks Up ​

  • Vs. PostgreSQL: Postgres is a beast for consistency—perfect for Phase 1’s small scale. But at 100,000 RPM, you’re begging for read replicas, and that’s $10-20 a month. LiteFS gives me HA for free—eat that, Postgres.

  • Vs. MongoDB: Mongo’s all about scaling reads, but Redis already kills that job. Plus, its HA needs three nodes—$15-30 a month, and way too heavy for my free VM. SQLite + LiteFS keeps it lean and mean.

  • Real Talk: Shlink’s been running SQLite in production and loves it (Shlink docs). Add LiteFS, and I’m not just keeping up—I’m pushing the envelope.

What I Learned Messing With This ​

  • SQLite’s No Joke: Everyone says it’s for tiny apps, but tune it right and it’s a monster. 80,000 ops a second? That’s nuts for a file-based DB.

  • LiteFS Is Clutch: Found it late in the game, but it’s perfect for keeping things reliable without extra cost. Wish I’d known about it sooner—would’ve bragged about it in Phase 1.

  • Caching’s King: Redis doing 99% of the work means SQLite and LiteFS can chill. That 80/20 rule (80% of traffic hitting 20% of URLs) is gold here.

Why It’s Feasible ​

This combo nails it—100,000 RPM, $0 cost, 99.9% uptime. SQLite’s fast enough, LiteFS makes it tough, and the free tier’s got the muscle (4 Gbps bandwidth = 2.4M RPM headroom). I’ve got proof from benchmarks, bit.ly’s numbers, and Shlink’s success. It’s not just doable—it’s a flex.

What’s Next? ​


Last Updated: March 11, 2025

Built with precision engineering and innovative solutions.