Live data from Hacker News

SQLite the only database you will ever need in most cases (2021)

unixsheikh.com

1–10 of 378 posts

Re: SQLite the only database you will ever need in most cases (2021)

#3
> I have run SQLite as a web application database with thousands concurrent writes every second, coming from different HTTP requests, without any delays or issues.

Is this with nodejs or something single threaded as the webserver?

I would kind of assume you'd run into issues with something like PHP.

Re: SQLite the only database you will ever need in most cases (2021)

#4

> I have run SQLite as a web application database with thousands concurrent writes every second, coming from different HTTP requests, without any delays or issues. Is this with nodejs or something single threaded as the webserver? I would kind of assume you'd run into issues with something like PHP.

Why do you believe that PHP would cause issues that Nodejs would not?

Re: SQLite the only database you will ever need in most cases (2021)

#5

> I have run SQLite as a web application database with thousands concurrent writes every second, coming from different HTTP requests, without any delays or issues. Is this with nodejs or something single threaded as the webserver? I would kind of assume you'd run into issues with something like PHP.

Maybe very small, quick writes, or a workload where modest blocking isn't a problem. Curious what the IOPs look like.

Re: SQLite the only database you will ever need in most cases (2021)

#6
post #4

> I have run SQLite as a web application database with thousands concurrent writes every second, coming from different HTTP requests, without any delays or issues. Is this with nodejs or something single threaded as the webserver? I would kind of assume you'd run into issues with something like PHP.

Why do you believe that PHP would cause issues that Nodejs would not?

PHP is usually run multi-process, so may have more parallel activity than a single Node instance running single threaded

Re: SQLite the only database you will ever need in most cases (2021)

#8
post #7
post #2

I love sqlite but can't hold myself from saying: another day, another sqlite post on HN :-)

HN needs a bingo card with this and rust on it.

At least Rustaceans are a bit more pragmatic and don't try to tell you that Rust is the only programming language you will ever need.

Re: SQLite the only database you will ever need in most cases (2021)

#9
post #4

Earlier quoted context omitted.

Why do you believe that PHP would cause issues that Nodejs would not?

PHP is usually run multi-process, so may have more parallel activity than a single Node instance running single threaded

Your mental model of concurrency is not correct.

Node.js uses non-blocking IO to achieve massive amounts of concurrency on a single thread, while one-thread-per-request models such as PHP rely on OS threading to do the exact same thing.

If anything, the node.js model is often capable of more concurrency because of the inefficiencies involved in OS threading and context switching.

EDIT: of course, event driven PHP exist. I don't know much about the current state of it.

Re: SQLite the only database you will ever need in most cases (2021)

#10
>The only time you need to consider a client-server setup is: Where you have multiple physical machines accessing the same database server over a network. In this setup you have a shared database between multiple clients.

This caveat covers "most cases". If there's only a single machine, then any data stored is not durable.

Additionally, to my knowledge SQLite doesn't have a solution for durability other than asynchronous replication. Arguably, most applications can tolerate this, but I'd rather just use MySQL with semi-sync replication, and not have to think through all of the edge cases about data loss.

Post reply on HN