Live data from Hacker News

SQLite on Rails: The how and why of optimal performance

fractaledmind.github.io

1–10 of 98 posts

Re: SQLite on Rails: The how and why of optimal performance

#3
post #2

This is a really long blog post to just say that you should turn on the WAL if you want concurrency out of SQLite. All the other stuff is superfluous.

Can't agree.

I learned about BEGIN IMMEDIATE TRANSACTION.

And there's also busy_timeout.

The article also explains why/how/when things occur in detail which is valuable.

Re: SQLite on Rails: The how and why of optimal performance

#5
post #2

This is a really long blog post to just say that you should turn on the WAL if you want concurrency out of SQLite. All the other stuff is superfluous.

I thought it was a pretty good list of common Rails-application-specific and sqlite3-specific knobs to turn, for newcomers to performance tuning. (Really just a guided tour though -- turn this knob to enable this particular tool for dealing with concurrency problems...)

Re: SQLite on Rails: The how and why of optimal performance

#8

much easier just to use pg

Not really. Setting a few sqlite options and enabling litestream for backups is much easier than setting up Postgres with reliable backups.

Should you do this for all apps? No. Do you have read heavy applications? Consider SQLite

Re: SQLite on Rails: The how and why of optimal performance

#10

much easier just to use pg

I'm not using Rails, but I now have several sites using my own little thing that is a single docker container where all state + content is in a single sqlite file, and it's very nice to be able to just move that single file around. I love postgres, but doing the equivalent of that with Postgres is a lot more hassle.
Post reply on HN