Re:SQLite Is All You Need
by chasd00 on Friday July 17, 2026 @07:41AM
(#48946101)
> WAL vs the old rollback journal isn't a minor tuning knob, it's the whole story.
That gave it away for me. I still appreciate the information contained in the reply but it was obvious. FWIW I don’t mind LLM content as long as I’m learning something.
Re:SQLite Is All You Need
by rmunn on Friday July 17, 2026 @07:36AM
(#48946051)
Have you read https://www.sqlite.org/howtocorrupt.html? Section 1.2 addresses the exact scenario you wrote about in "Backups are a file copy". You got lucky with your testing, and didn't manage to copy the database in the middle of writing a transaction to the WAL file. Backing up an SQLite database with `cp` can produce corrupt backups if you lose the race condition, an unlikely but possible scenario,
Your later advice about "VACUUM INTO (backupfile)" is good, though: the SQLite manual guarantees that that's safe. But it's not safe to back up with `cp` if there are transactions currently writing to the DB: that has a chance of copying files in an inconsistent state, resulting in a corrupt DB and data loss you don't realize has happened until you restore the backup and find out there are some rows missing, or some rows have an invalid mix of old and new data.
Re:SQLite Is All You Need
by danosull on Sunday July 19, 2026 @04:07AM
(#48965920)
It's fun that this doesn't actually flag anything on my recent blog post about clichés and LLMs, which deliberately lists cliches. I think because I'm focusing on words and this is looks for phrase patterns?
Re:SQLite Is All You Need
by afonsosoares on Tuesday July 14, 2026 @08:57AM
(#48906133)
I could not agree more KISS is always the way to go.
For those people that are interested you can have a sqld instance on a different VM with S3 backup.
On my case I use k8s and the backend pod use rust libsqld crate with local first sql database file with remote sync to sqld.
When pod start if db file is not available libsqld will try recover it from slqd otherwise it will just load local db file and sync.
Re:SQLite Is All You Need
by 0xblinq on Friday July 17, 2026 @09:31AM
(#48947195)
So you don't have a redundant server until $1marr?
That means you also don't apply updates to the server/kernel that require a reboot until then? Or you accept the downtime? And what happens if it doesn't boot properly?
None of that is an issue depending on what your software actually does. Now sure if you're doing something like logging, or you're cloudflare, or meta or some shit then yeah it's not going to cut it.
Generally I target enterprise b2b customers, they use the application from 9-5 generally. Weekly scheduled downtime is not the end of the world.
If it doesn't boot properly, which has never happened, I build a new server - takes 10 minutes max. Litestream keeps database relatively fresh, so it gets pulled on boot. Floating IP points at new server. We do this in dev regularly, the only difference in prod is a few variables.
Even if your target is higher uptime or bigger scale, you can go far further than you think on sqlite - it's multitudes of magnitude quicker than postgres for most general use cases.
Most software projects go nowhere. YAGNI. Build something valuable and people will put up with bullshit for a while.
Re:SQLite Is All You Need
by petcat on Friday July 17, 2026 @07:12AM
(#48945881)
> the Postgres container you spun up out of habit was never needed
These posts need to stop comparing their contrived use-cases for SQLite to Postgres. Sure, SQLite is all you need if it really is all you need. But Postgres does so much more than just act as a data dump with an SQL engine on top.
Dr. Hipp himself even said that SQLite does not, and will never, compete with the likes of Postgres. It competes with fopen.
Re:SQLite Is All You Need
by petcat on Friday July 17, 2026 @07:27AM
(#48945991)
> the "architect" imagines they need more (or is preparing for the potential)
I guess I am one of those "architects" that imagines they need an actual date/time storage class instead of some stringly-typed text column that I hope will contain a parsable ISO8601 datetime string when I try to read it back.
Hipp said that it will never be added because it will bloat the size of the embedded object. Because that is what SQLite was designed for: single-user embedded databases. Like the address book on your phone.
> I guess I am one of those "architects" that imagines they need an actual date/time storage class instead of some stringly-typed text column that I hope will contain a parsable ISO8601 datetime string when I try to read it back.
To be honest if you're using JSON at any point in your stack you have the same issue.
Re:SQLite Is All You Need
by masklinn on Friday July 17, 2026 @07:36AM
(#48946049)
In fairness, sqlite is perfectly happy with Julian dates or Unix timestamps (that’s the affinity of a column typed “datetime” in non-strict mode) and timestamp(tz) are nothing to write home about except in complaint.
Re:SQLite Is All You Need
by petcat on Friday July 17, 2026 @07:48AM
(#48946169)
Well for one we should probably validate that the number is smaller than the total life of the physical universe.
SQLite will gladly store a u64::MAX as a "unix timestamp" despite it being about 300x larger than the number of seconds that the universe and everything in it has existed.
Try reading that back in any application date/time code and your app probably crashes immediately.
Re:SQLite Is All You Need
by masklinn on Friday July 17, 2026 @10:34AM
(#48947870)
> SQLite will gladly store a u64::MAX as a "unix timestamp"
SQLite does not support unsigned integers.
> Try reading that back in any application date/time code and your app probably crashes immediately.
Postgres will happily ingest and produce dates in the 280th millenium, which will also crash your application if its datetime type can’t handle that shrug.
You can add a check constraint that your field passes through SQLite’s datetime functions and it’ll be clamped between the years 0 and 9999. Or you can put in your own limits matching your application layer, or your application’s business logic. That’s what check constrains are for (amongst other things).
Re:SQLite Is All You Need
by petcat on Friday July 17, 2026 @11:06AM
(#48948289)
> SQLite does not support unsigned integers.
omg you're right. Another example of SQLite's type-flimsyness.
> You can add a check constraint
So now we're just layering on our own brittle validation and runtime checks to make up for sqlite's woeful deficiency supporting even basic domain data types.
Re:SQLite Is All You Need
by masklinn on Friday July 17, 2026 @12:58PM
(#48949561)
> omg you're right. Another example of SQLite's type-flimsyness.
You're just firing on all the bullshit cylinders in your little motorised gish gallop aren't you?
The only RDBMS in widespread use which supports unsigned integers is mysql. Not postgres, not oracle, not sql server, not db2, not snowflake, not databricks.
> So now we're just layering on our own brittle validation and runtime checks to make up for sqlite's woeful deficiency supporting even basic domain data types.
Ah yes, the "brittle validation" of actually validating the thing you purported to care about two comments ago. Amazing.
Re:SQLite Is All You Need
by f3b5 on Friday July 17, 2026 @07:45AM
(#48946143)
I was such a big sqlite fan that I used it for my data-intensive startup. Once I actually started scaling it up I ran into crippling file system race conditions. This was because we were hosted on a distributed file system in the cloud which I learned is very very bad for sqlite.
So I had to migrate the production db under live load from sqlite to mysql which was a quite ...intense week. I still like sqlite but I'd be wary of using it again for a usecase like mine.
Re:SQLite Is All You Need
by inigyou on Friday July 17, 2026 @07:27AM
(#48945990)
If you could conceivably use multiple processes at once to access the database, and not just as an edge case, you need something more than sqlite.
Sqlite does support multi-process access correctly, but the performance is abysmal as it locks the entire file for any write transaction. Client/server databases have much smarter concurrency.
Re:SQLite Is All You Need
by masklinn on Friday July 17, 2026 @07:39AM
(#48946084)
It’s perfectly fine if your write throughput is low, especially in wal mode. Multiprocess does not actually change much if anything, even in multithreaded mode you want every thread to have its own connection and to have a good handle on who is writing when.
Re:SQLite Is All You Need
by inigyou on Friday July 17, 2026 @09:39AM
(#48947285)
Regardless, it's a sign sqlite is not right for you. You should start with postgres if you aren't sure your application will always be good with sqlite. It'll save you a migration, and doesn't really cost anything to start your project with postgres instead of sqlite.
Re:SQLite Is All You Need
by mahcha on Friday July 17, 2026 @10:24AM
(#48947746)
There is an interesting pattern SyncLite (https://github.com/syncliteio/SyncLite) attempts to solve to bring the best of both SQLite and Postgres with one or more SQLite databases directly serving the application while SyncLite replicating/consolidating data from all those SQLite databases into a centralized PostgreSQL database..
Re:SQLite Is All You Need
by inigyou on Friday July 17, 2026 @10:43AM
(#48947989)
It sounds like a solution trying to sell itself. While you probably can do something like that and it might even be useful for some applications, I can't imagine it's a very good generic solution - you probably want to do it yourself if you want to do it.
Re:SQLite Is All You Need
by haspok on Friday July 17, 2026 @07:52AM
(#48946208)
> It competes with fopen.
No, it actually competes with Excel.
At least in the finance world, there are still a million small processes driven by an Excel spreadsheet put together in an afternoon by an intern 20 years ago. If it is a really business critical process, then the input is usually a csv file, read by an Excel macro.
Because Excel is user friendly, and "is good enough". Mostly...
For example you cannot have concurrent access. As soon as you need a worker process and a web process SQLite is out. Or if you are trying to use it as a vector db all of those vector searches will block a node event loop.
Re:SQLite Is All You Need
by Cthulhu_ on Friday July 17, 2026 @07:28AM
(#48945998)
Article mentions WAL and how this sentiment is about 16 years out of date. But also, you can duplicate databases for out-of-order processes.
But also also, if you have higher concurrency requirements - e.g. multiple servers, one database - or a more write-heavy use case, sqlite is no longer the right choice.
Yeah it blocks for the 0.001ms it takes for 99.99% of queries to come back. Or you can enable WAL and allow readers to read at the same time as somebody is writing.
Re:SQLite Is All You Need
by chistev on Friday July 17, 2026 @07:23AM
(#48945951)
The SQLite documentation says that
"SQLite works great as the database engine for most low to medium traffic websites (which is to say, most websites). The amount of web traffic that SQLite can handle depends on how heavily the website uses its database. Generally speaking, any site that gets fewer than 100K hits/day should work fine with SQLite. The 100K hits/day figure is a conservative estimate, not a hard upper bound. SQLite has been demonstrated to work with 10 times that amount of traffic.
The SQLite website (https://www.sqlite.org/) uses SQLite itself, of course, and as of this writing (2015) it handles about 400K to 500K HTTP requests per day, about 15-20% of which are dynamic pages touching the database. Dynamic content uses about 200 SQL statements per webpage. This setup runs on a single VM that shares a physical server with 23 others and yet still keeps the load average below 0.1 most of the time."
Re:SQLite Is All You Need
by Cthulhu_ on Friday July 17, 2026 @07:30AM
(#48946015)
I remember this section for the 200 queries per page thing, which is a huge difference between sqlite and most databases. Most databases run in a separate process and use a network boundary to separate it from the server processes (socket connection or even http), which alone exacerbates the n+1 problem, and / or puts pressure on the amount of queries one should trigger per page view. SQLite doesn't care because it runs as part of the server process.
Re:SQLite Is All You Need
by mikeocool on Friday July 17, 2026 @07:25AM
(#48945972)
I love SQLite, but my clients expect minimal data loss and downtime when one of my servers goes down.
How are people solving that issue with SQLite? Everytime I’ve investigated it, it seems like the state of the art is not very battle tested WAL shipping solutions.
If I’m setting something like that up, suddenly running Postgres with its battle tested replication starts to look not so much more complicated in comparison.
Re:SQLite Is All You Need
by ndr on Friday July 17, 2026 @07:44AM
(#48946134)
I use it in several projects. You're still open to a few seconds of possible downtime (depending how often you flush the WAL to your remote location, and how bursty your writes are), and you need to have all of your db on disk on the process doing the reads, but it's been great.
Re:SQLite Is All You Need
by rmunn on Friday July 17, 2026 @07:32AM
(#48946020)
There's some bad advice in the article:
"Backups are a file copy. [...] you can back up a live SQLite database, under write load, without stopping anything."
This is straight out of section 1.2 of https://www.sqlite.org/howtocorrupt.html. Yes, you can do that, and sometimes you will end up with a valid, non-corrupt backup. But it's timing-dependent: lose the race and you'll end up backing up a partially written transaction, making the backup corrupt. They didn't end up losing that race when they wrote the article, but that doesn't mean it is safe 100% of the time.
The section later on about running "VACUUM INTO backup-$(date +%F).db" is 100% safe, though: SQLite guarantees that you'll get consistent state if you do that.
Re:SQLite Is All You Need
by luke5441 on Friday July 17, 2026 @07:49AM
(#48946183)
At some point I thought I would be clever and just backup the file while no transaction is active (or manual WAL checkpointing and no WAL checkpointing active).
Re:SQLite Is All You Need
by arpinum on Friday July 17, 2026 @07:35AM
(#48946046)
I use a in-memory database per unit test with both rocksdb and sqlite, it is a game-changer to get better quality tests.
Overall premise is wrong though. Moving the database out of process will change performance characteristics and data architecture too much and will cause massive headaches at exactly the time when you are trying to scale with success. You should have out of process performance tests early to catch these issues, even if you do deploy a single node.
If success can be satisfied with a single node and you are satisfied with availability and recovery that gives you then great, but it isn't all I need.
Re:SQLite Is All You Need
by PUSH_AX on Friday July 17, 2026 @07:35AM
(#48946048)
We serve multi million MAU on sqlite orchestrated through durable objects. It's not the most complex thing in the world but it goes further than CRUD. It costs us such a small amount of money for what it does. Our PG cluster was orders of magnitude more expensive.
The above article was what convinced me to use SQLite in my new business. 5 years later, serving 120+ million requests per month and still working great. To be fair, most of those requests are served out of redis, but I’m still running off of cheap digital ocean droplets.
That gave it away for me. I still appreciate the information contained in the reply but it was obvious. FWIW I don’t mind LLM content as long as I’m learning something.
Your later advice about "VACUUM INTO (backupfile)" is good, though: the SQLite manual guarantees that that's safe. But it's not safe to back up with `cp` if there are transactions currently writing to the DB: that has a chance of copying files in an inconsistent state, resulting in a corrupt DB and data loss you don't realize has happened until you restore the backup and find out there are some rows missing, or some rows have an invalid mix of old and new data.
It really wouldn’t have taken much effort to cut out the worst of the AI fluff, and maybe add some human touches
* is in the article
It's Claude.
Inspired me to finally build (well, vibe code) a cliché detector https://tools.simonwillison.net/llm-cliche-highlighter
https://blog.osull.com/2026/07/06/cliches-in-the-age-of-the-...
apps appear much faster because db is on the same server
So lunchtime in America there will be multiple people posting comments at the same time
And Sqllite only allows one writer, so what happens if multiple people send their comments at once
So are they using ultra fast storage on the host or queues or other
That means you also don't apply updates to the server/kernel that require a reboot until then? Or you accept the downtime? And what happens if it doesn't boot properly?
Generally I target enterprise b2b customers, they use the application from 9-5 generally. Weekly scheduled downtime is not the end of the world.
If it doesn't boot properly, which has never happened, I build a new server - takes 10 minutes max. Litestream keeps database relatively fresh, so it gets pulled on boot. Floating IP points at new server. We do this in dev regularly, the only difference in prod is a few variables.
Even if your target is higher uptime or bigger scale, you can go far further than you think on sqlite - it's multitudes of magnitude quicker than postgres for most general use cases.
Most software projects go nowhere. YAGNI. Build something valuable and people will put up with bullshit for a while.
These posts need to stop comparing their contrived use-cases for SQLite to Postgres. Sure, SQLite is all you need if it really is all you need. But Postgres does so much more than just act as a data dump with an SQL engine on top.
Dr. Hipp himself even said that SQLite does not, and will never, compete with the likes of Postgres. It competes with fopen.
most use cases are really capable of being satisfied by sqlite, but the "architect" imagines they need more (or is preparing for the potential).
I guess I am one of those "architects" that imagines they need an actual date/time storage class instead of some stringly-typed text column that I hope will contain a parsable ISO8601 datetime string when I try to read it back.
Hipp said that it will never be added because it will bloat the size of the embedded object. Because that is what SQLite was designed for: single-user embedded databases. Like the address book on your phone.
To be honest if you're using JSON at any point in your stack you have the same issue.
SQLite will gladly store a u64::MAX as a "unix timestamp" despite it being about 300x larger than the number of seconds that the universe and everything in it has existed.
Try reading that back in any application date/time code and your app probably crashes immediately.
And if your app crashes on an input like that, you should pick a different date Library or stop and rethink your coding skills.
SQLite does not support unsigned integers.
> Try reading that back in any application date/time code and your app probably crashes immediately.
Postgres will happily ingest and produce dates in the 280th millenium, which will also crash your application if its datetime type can’t handle that shrug.
You can add a check constraint that your field passes through SQLite’s datetime functions and it’ll be clamped between the years 0 and 9999. Or you can put in your own limits matching your application layer, or your application’s business logic. That’s what check constrains are for (amongst other things).
omg you're right. Another example of SQLite's type-flimsyness.
> You can add a check constraint
So now we're just layering on our own brittle validation and runtime checks to make up for sqlite's woeful deficiency supporting even basic domain data types.
You're just firing on all the bullshit cylinders in your little motorised gish gallop aren't you?
The only RDBMS in widespread use which supports unsigned integers is mysql. Not postgres, not oracle, not sql server, not db2, not snowflake, not databricks.
> So now we're just layering on our own brittle validation and runtime checks to make up for sqlite's woeful deficiency supporting even basic domain data types.
Ah yes, the "brittle validation" of actually validating the thing you purported to care about two comments ago. Amazing.
So I had to migrate the production db under live load from sqlite to mysql which was a quite ...intense week. I still like sqlite but I'd be wary of using it again for a usecase like mine.
Sqlite does support multi-process access correctly, but the performance is abysmal as it locks the entire file for any write transaction. Client/server databases have much smarter concurrency.
No, it actually competes with Excel.
At least in the finance world, there are still a million small processes driven by an Excel spreadsheet put together in an afternoon by an intern 20 years ago. If it is a really business critical process, then the input is usually a csv file, read by an Excel macro.
Because Excel is user friendly, and "is good enough". Mostly...
But also also, if you have higher concurrency requirements - e.g. multiple servers, one database - or a more write-heavy use case, sqlite is no longer the right choice.
"SQLite works great as the database engine for most low to medium traffic websites (which is to say, most websites). The amount of web traffic that SQLite can handle depends on how heavily the website uses its database. Generally speaking, any site that gets fewer than 100K hits/day should work fine with SQLite. The 100K hits/day figure is a conservative estimate, not a hard upper bound. SQLite has been demonstrated to work with 10 times that amount of traffic.
The SQLite website (https://www.sqlite.org/) uses SQLite itself, of course, and as of this writing (2015) it handles about 400K to 500K HTTP requests per day, about 15-20% of which are dynamic pages touching the database. Dynamic content uses about 200 SQL statements per webpage. This setup runs on a single VM that shares a physical server with 23 others and yet still keeps the load average below 0.1 most of the time."
How are people solving that issue with SQLite? Everytime I’ve investigated it, it seems like the state of the art is not very battle tested WAL shipping solutions.
If I’m setting something like that up, suddenly running Postgres with its battle tested replication starts to look not so much more complicated in comparison.
"Backups are a file copy. [...] you can back up a live SQLite database, under write load, without stopping anything."
This is straight out of section 1.2 of https://www.sqlite.org/howtocorrupt.html. Yes, you can do that, and sometimes you will end up with a valid, non-corrupt backup. But it's timing-dependent: lose the race and you'll end up backing up a partially written transaction, making the backup corrupt. They didn't end up losing that race when they wrote the article, but that doesn't mean it is safe 100% of the time.
The section later on about running "VACUUM INTO backup-$(date +%F).db" is 100% safe, though: SQLite guarantees that you'll get consistent state if you do that.
Ran into 2.2. https://www.sqlite.org/howtocorrupt.html -- the backup was close()ing the database file descriptor and canceling the SQlite locks.
I use Litestream for offsite backups. SQLite also has a .backup command:
sqlite3 /path/to/db '.backup /path/to/backup'
or
sqlite3 /path/to/db "VACUUM INTO '/path/to/backup'"
Overall premise is wrong though. Moving the database out of process will change performance characteristics and data architecture too much and will cause massive headaches at exactly the time when you are trying to scale with success. You should have out of process performance tests early to catch these issues, even if you do deploy a single node.
If success can be satisfied with a single node and you are satisfied with availability and recovery that gives you then great, but it isn't all I need.
The above article was what convinced me to use SQLite in my new business. 5 years later, serving 120+ million requests per month and still working great. To be fair, most of those requests are served out of redis, but I’m still running off of cheap digital ocean droplets.
You are right to push back on that.