Live data from Hacker News

SQLite Is All You Need

dbpro.app

31–40 of 66 posts

Re: SQLite Is All You Need

#31

Earlier quoted context omitted.

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.

https://lobste.rs/s/ko1ji1/lobste_rs_is_now_running_on_sqlit...

That site is hard on my eyes

Re: SQLite Is All You Need

#34
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

#35
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.

Re: SQLite Is All You Need

#36
post #21
post #18

Earlier quoted context omitted.

> SQLite is all you need if it really is all you need. most use cases are really capable of being satisfied by sqlite, but the "architect" imagines they need more (or is preparing for the potential).

> 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…

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

#37
post #2

Author here. This started because I read Evan Hahn's STRICT tables post [1] last week and got curious how far "just use SQLite" actually holds up under real load, not toy benchmarks. So I built a small social app (Chirp: 50k users, 1M posts, ~2.5M follows) in one SQLite file, put it behind a plain Node server, and load tested it properly: real HTTP, real JSON serialization, autocannon hammering it over sockets. The w…

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

#38
post #16

Earlier quoted context omitted.

How are lobster.rs handling writes? Are they queuing them synchronously?

https://sqlite.org/wal.html presumably.

But like any message board it will get peak time hits

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

Re: SQLite Is All You Need

#40
post #21

Earlier quoted context omitted.

> 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…

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.

so now we've traded a text column for an int column that still can't validate that the number is actually externally consistent with the real world.
Post reply on HN