frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

SQLite in Production: Optimizing WAL Mode, Concurrency, and VFS Layers

https://micrologics.org/blog/sqlite-in-production-optimizing-wal-mode-concurrency-and-vfs-layers-for-low-latency-app-servers
42•ankitg12•2h ago

Comments

madhu_ghalame•41m ago
It would be great to include production benchmarks comparing these optimisations with a default SQLite setup.
yladiz•21m ago
I'm fairly confident this is AI generated, but it makes me think regardless: Whenever I see these kind of articles, I'm left wondering if they've actually used SQLite in production because I always see points about how to optimize performance, like using the WAL, but never about annoyances/issues you'd run into before even needing to worry about that. I guess it's the zeitgeist to use it in a production setting, and I think it's great that it's getting hyped because it truly is a capable database, but after trying myself I think I'd never reach for it in production because it lacks a lot of power that a database like Postgres has, and some of that power is actually relevant to a real production setting:

- Column definitions aren't able to be changed with something like `alter column` after creation. To change a column definition you have to manually update the underlying schema using the `writable_schema` pragma. If you mess this up you can be left with a corrupt database.

- Column types are pretty limited. This isn't too much of an issue in practice since you can handle this somewhat in application code, but it can still be a bit annoying at times.

- You have limited options for dealing with schema migrations. You basically either copy the migrations to the server and run it there (manually or with something like Ansible), or you run the migrations in your application on startup. Ideally you'd perform your schema migrations separately from your application, and having to somehow copy/get the migrations to your server to then run the migration is a bit clunky.

All 3 of these are handled in a more powerful (and not local-only) database, and so I don't get why someone would choose SQLite except for prototyping (or places like the browser or phone apps) where performance concerns aren't really relevant.

michaellee8•16m ago
I previously had a golang based crawler doing 5 concurrent process writing into the same sqlite wal, it caused the sqlite to get corrupted, and i finally decided to move to postgres instead.
andersmurphy•12m ago
I would only recommend sqlite if you know what you are doing (and/or prepared to learn it inside out). It's more of a build your own database primitive (often you'll have multiple sqlite databases for different things). Which can be incredibly rewarding and deliver amazing performance outcomes, simple ops, etc.

I see the migration argument come up a lot. But, in practice with sqlite you'll be using projections where you have a source of truth database (event log) and project off it into disposable/expendable sqlite databases. So schema changes are often just delete and rebuild the projection.

grebc•9m ago
I’ve never once had to change a column definition. Sure in theory that option is available. Better option is to just add a new column with the correct definition then copy over existing data in the old column.

I don’t think that’s really a positive or negative.

And the point about migrations ideally being separate js really just your own opinion. I prefer having the database definition in the same source tree as the application, ideally just a .sql file in the project.

Lio•4m ago
I also treat articles about production optimisation with a bit of caution when they don't include any numbers to back up the claims.

If you're saying "do this, get that", you should be able explain how to measure and reproduce that result.

The answer to why someone might choose SQLite in production could be latency but if it is then prove it's worth the trade-offs.

andersmurphy•17m ago
Personally, I think the better way to tackle sqlite_busy is to have a single writer managed at the application level. That effectively eliminates sqlite_busy in the context of a single process.

> To ensure write operations don't suffer from disk synchronization bottlenecks, pair WAL mode with the following pragma

Only do this if you are prepared to sacrifice durability (i.e can afford to lose transactions).

yread•2m ago
> Ideally you'd perform your schema migrations separately from your application

Why is that the ideal? With SQLite your database is 1:1 connected to your application (meaning there is no other application using that database), it doesn't make sense to move the app to a new version but not the database or vice versa. Running migrations on startup of the app is ideal.

Migrations are a bit more difficult to write for SQLite than they need to be (DROP column only being added recently...), though. I usually iterate a few times to get the column definitions just right so that I don't have to change them later.

As you say column types are limited (and enforcement lax) but in practice it's a non-issue because you convert the data to application-specific types when reading from db (and enforce by writing only right data types) anyway.

More Tailscale tricks for your jailbroken Kindle

https://tailscale.com/blog/jailbroken-kindle-proxy-tun-modes
175•Error6571•4h ago•52 comments

User Interfaces of the Demo Scene

https://www.datagubbe.se/scenegui/
181•zdw•5h ago•29 comments

SQLite in Production: Optimizing WAL Mode, Concurrency, and VFS Layers

https://micrologics.org/blog/sqlite-in-production-optimizing-wal-mode-concurrency-and-vfs-layers-...
42•ankitg12•2h ago•8 comments

Lisp moving Forth moving Lisp

https://letoverlambda.com/textmode.cl/guest/chap8.html
20•fallat•2d ago•1 comments

Codex Security

https://github.com/openai/codex-security
498•bakigul•12h ago•167 comments

Show HN: I was tired of opening 2 tabs for every HN link, so I made a userscript

https://github.com/twalichiewicz/HNewhere
313•twalichiewicz•11h ago•81 comments

Substack writers, you need a website

https://elizabethtai.com/2026/06/10/substack-writers-you-need-a-website/
541•speckx•16h ago•272 comments

Half-Life ported to Mac OS 9

https://mac-classic.com/news/half-life-ported-to-mac-os-9/
241•freediver•12h ago•115 comments

Cracking Windows Open: Porting RADV to Win32

https://www.collabora.com/news-and-blog/news-and-events/cracking-windows-open-porting-radv-to-win...
44•zdw•5h ago•12 comments

LearnVector – Andrew Ng's AI company building one‑to‑one learning experiences

https://learnvector.ai/
182•ajhai•7h ago•109 comments

ReFrame – The EPaper Camera

https://reframe.camera/
128•phil294•10h ago•26 comments

Kimi K3 Architecture Overview and Notes

https://sebastianraschka.com/blog/2026/kimi-k3-architecture-notes.html
419•ModelForge•17h ago•84 comments

Hubble: Open-source notetaking app for you and your agents

https://www.hubble.md/
110•handfuloflight•9h ago•41 comments

Teach yourself programming in ten years (1998)

https://www.norvig.com/21-days.html
138•vinhnx•3d ago•83 comments

Transformer Transformer: A Unified Model for Motion-Conditioned Robot Co-Design

https://transformer-transformer.github.io/
51•ilreb•5h ago•3 comments

Truth is not a direction: a Tarski attack on LLM probes

https://abeljansma.nl/2026/07/10/truth-is-not-a-direction.html
94•abelaer•1d ago•43 comments

Steel Bank Common Lisp version 2.6.7

https://sbcl.org/all-news.html?2.6.7
232•tmtvl•16h ago•101 comments

Delayed Gratification – Proud to Be 'Last to Breaking News'

https://www.slow-journalism.com/
295•speerer•17h ago•165 comments

Hooray for the Sockets Interface

https://blog.apnic.net/2026/07/28/hooray-for-the-sockets-interface/
37•jruohonen•7h ago•19 comments

60 Years Ago, a Submerged Submarine Circled the Globe for the First Time (2020)

https://www.popularmechanics.com/military/weapons/a32009109/operation-sandblast-sumbarine-circumn...
17•baud147258•1d ago•5 comments

Mag Computer: A Mag History of RAM (1960–2025)

https://magworld.pw/episodes/computer/
22•evakhoury•4d ago•2 comments

Zig's Incremental Compilation Internals

https://mlugg.co.uk/posts/incremental-compilation-internals/
244•garyhtou•17h ago•168 comments

Log is non-monotonic in PHP and Lua

https://purplesyringa.moe/blog/log-is-non-monotonic-in-php-and-lua/
54•ibobev•5d ago•33 comments

Una GPS smart watch – Repairable, USB-C charging, developer-friendly

https://unawatch.com/
214•pimterry•18h ago•136 comments

The iPhone Upgrade Program is being replaced by Apple Upgrade

https://www.apple.com/shop/iphone/iphone-upgrade-program
181•lkurtz•16h ago•328 comments

Beyond Greece and Rome

https://aeon.co/essays/uncovering-a-global-ancient-history-beyond-greece-and-rome
34•diodorus•1d ago•31 comments

Interview with Boris Cherny [video]

https://www.youtube.com/watch?v=qyPCVqFUyDo
56•knighthacker•1d ago•62 comments

Now is the time to give LLMs access to the ACM digital library

https://cacm.acm.org/opinion/now-is-the-time-to-give-llms-access-to-the-acm-digital-library/
159•rbanffy•18h ago•129 comments

Multiple Mouse Cursors in Wayland

https://blinry.org/multi-seat-wayland/
129•marvinborner•8h ago•89 comments

Fixing a bug with byte order marks

https://alexwlchan.net/2026/byte-order-marks/
6•surprisetalk•5d ago•6 comments