Summarizer

Embedded Database Benefits

Discussion of local databases without network overhead, caching implications, RAM management differences from server databases, and when to migrate to PostgreSQL

← Back to Databases in 2025: A Year in Review

Embedded databases like SQLite and DuckDB are increasingly celebrated for offering a streamlined "middle ground" that minimizes latency and simplifies architecture by keeping data on the same machine as the application. While modern hardware is powerful enough to support millions of users from a single machine, proponents argue that the "cloud" often overcomplicates deployments that could be handled more efficiently without network overhead. However, critics point out that this simplicity comes with trade-offs, such as the absence of a shared RAM cache, which can force developers to build manual caching layers or eventually migrate to PostgreSQL as they scale. Despite these hurdles, the rise of specialized backup tools and improved write concurrency has transformed embedded databases from mere replacements for local text files into sophisticated production tools that many "serious" database circles are only beginning to fully appreciate.

10 comments tagged with this topic

View on HN · Topics
From my perspective - do you even need a database? SQLite is kind-of the middle ground between a full fat database, and 'writing your own object storage'. To put it another way, it provides 'regularised' object access API, rather than, say, a variant of types in a vector that you use filter or map over.
View on HN · Topics
After 2 years in production with a small (but write heavy) web service... it's a mixed bag. It definitely does the job, but not having a DB server does have not only benefits, but also drawbacks. The biggest being (lack of) caching the file/DB in RAM. As a result I have to do my own read caching, which is fine in Rust using the mokka caching library, but it's still something you have to do yourself, which would otherwise come for free with Postgres. This of course also makes it impossible to share the cache between instances, doing so would require employing redis/memcached at which point it would be better to use Postgres. It has been OK so far, but definitely I will have to migrate to Postgres at one point, rather sooner than later.
View on HN · Topics
Thats basically how the web started. You can serve a ridiculous number of users from a single physical machine. It isn't until you get into the hundreds-of-millions of users ballpark where you need to actually create architecture. The "cloud" lets you rent a small part of a physical machine, so it actually feels like you need more machines than you do. But a modern server? Easily 16-32+ cores, 128+gb of ram, and hundreds of tb of space. All for less than 2k per month (amortized). Yeah, you need an actual (small) team of people to manage that; but that will get you so far that it is utterly ridiculous. Assuming you can accept 99% uptime (that's ~3 days a year being down), and if you were on a single cloud in 2025; that's basically last year.
View on HN · Topics
SQlite as a database for web services had a little bit of a boom due to: 1. People gaining newfound appreciation of having the database on the same machine as the web server itself. The latency gains can be substantial and obviously there are some small cost savings too as you don't need a separate database server anymore. This does obviously limit you to a single web server, but single machines can have tons of cores and serve tens of thousands of requests per second, so that is not as limiting as you'd think. 2. Tools like litestream will continuously back up all writes to object storage, so that one web server having a hardware failure is not a problem as long as your SLA allow downtimes of a few minutes every few years. (and let's be real, most small companies for which this would be a good architecture don't have any SLA at all) 3. SQLite has concurrent writes now, so it's gotten much more performant in situations with multiple users at the same time. So for specific use cases it can be a nice setup because you don't feel the downsides (yet) but you do get better latency and simpler architecture. That said, there's a reason the standard became the standard, so unless you have a very specific reason to choose this I'd recommend the "normal" multitier architectures in like 99% of cases.
View on HN · Topics
I’m a fan of SQLite but just want to point out there’s no reason you can’t have Postgres or some other rdbms on the same machine as the webserver too. It’s just another program running in the background bound to a port similar to the web server itself.
View on HN · Topics
Most of the usage was/is as a local ACID-compliant replacement for txt/ini/custom local/bundled files though.
View on HN · Topics
Only for large scale multiple user applications. It’s more than reasonable as a data store in local applications or at smaller scales where having the application and data layer on the same machine are acceptable. If you’re at a point where the application needs to talk over a network to your database then that’s a reasonable heuristic that you should use a different DB. I personally wouldn’t trust my data to NFS.
View on HN · Topics
What is a "local application"?
View on HN · Topics
Funny how people used to ask "what is a cloud application", and now they ask "what is a local application" :-) Local as in "desktop application on the local machine" where you are the sole user.
View on HN · Topics
Why does "database" is surveys like this not include DuckDB and SQLite, which are great [1] embedded answers to Clickhouse and PostgreSQL. Both are excellent and useful databases; DuckDB's reasonable syntax, fast vectorized everything, and support for ingesting the hairiest of data as in-DB ETL make me reach for it first these days, at least for the things I want to do. Why is it that in "I'm a serious database person" circles, the popular embedded databases don't count? [1] Yes, I know it's not an exact comparison.