News for hackers. Stuff that matters.
Re:Many Small Queries Are Efficient in SQLite by nchmy on Saturday January 24, 2026 @08:14AM (#46743255)
The article doesnt make it at all clear what it is comparing to - mysql running remotely or on the same server? I'm sure sqlite still has less "latency" than mysql on localhost or unix socket, but surely not meaningfully so. So, is SQLite really just that much faster at any SELECT query, or are they just comparing apples and oranges?

Or am i mistaken in thinking that communicating to mysql on localhost is comparable latency to sqlite?

Re:Many Small Queries Are Efficient in SQLite by Neywiny on Saturday January 24, 2026 @08:22AM (#46743309)
I think they're trying to not shame other services, but yes the comparison is vs networked whether that's local on loopback or not. For a small query, which is what they're talking about, it's not inconceivable that formatting into a network packet, passing through the userspace networking functions, into and through kernel, all back out the other side, then again for the response, is indeed meaningfully slower than a simple function call within the program.
Re:Many Small Queries Are Efficient in SQLite by nchmy on Sunday January 25, 2026 @03:42AM (#46752025)
Yes, I explicitly said localhost is slower. But the article doesn't say what it's comparing to nor provide any measurements.
Re:Many Small Queries Are Efficient in SQLite by wild_egg on Saturday January 24, 2026 @08:23AM (#46743315)
Connecting to localhost still involves the network stack and a fair bit of overhead.

SQLite is embedded in your program's address space. You call its functions directly like any other function. Depending on your language, there is probably some FFI overhead but it's a lot less than than an external localhost connection

Re:Many Small Queries Are Efficient in SQLite by Cthulhu_ on Saturday January 24, 2026 @08:26AM (#46743335)
Even if you're on the same local server, you're still going over a socket to a different service, whereas with sqlite you remain in the same application / address space / insert words I don't fully understand here. So while client/server SQL servers are faster locally than on a remote server, they can (theoretically) never be as fast as SQLite in the same process.

Of course, SQLite and client/server database servers have different use cases, so it is kind of an apples and oranges comparison.

Re:Many Small Queries Are Efficient in SQLite by nchmy on Sunday January 25, 2026 @03:40AM (#46752003)
Yes, I already said all of this. But you haven't clarified what the article is saying
Re:Many Small Queries Are Efficient in SQLite by zffr on Saturday January 24, 2026 @08:27AM (#46743338)
I think the most common set up is to have your application server and DB on different hosts. That way you can scale each independently.
Re:Many Small Queries Are Efficient in SQLite by nchmy on Sunday January 25, 2026 @03:43AM (#46752029)
Quite likely! But the article doesn't say this