Hacker News new | ask | show | jobs
by Thaxll 13 days ago
SQLite gets so much praise here but when you start using it, you realize quickly how bad it is, the type system is by default very limited and dangerous.

It's like comparing old php with a strongly typed language.

There is not even a date type...

3 comments

SQLite competes with fopen. Not Postgres
It’s curious how many people don’t understand what SQLite is and its intended feature set. They get huffy that it’s not a full client server model with multimaster clustering across 8 data centers on 12 continents plus New Zealand with realtime synchronous replication.

It’s a product that allows you to do sql like things without a database server. If you need to have database server behavior, you’re using the wrong product.

Well, it goes both ways. You'll see articles saying essentially "you don't need Postgres or any other fancy database, SQlite is enough" while ignoring the fact that some use-cases warrant a more conventional DB server.

Different tools for different situations!

I think this critique was traditionally about the LAMP stack. Imagine how many engineering years would have been saved if Wordpress ran on SQLite,

- no db user configuration - no installing multiple tenants in the same db - no phpmyadmin (ftp db files) - no remote database hacks - no backup tools

I agree with you. There are 2 dozen foot-guns to be kept in mind. And discovered a new footgun regarding multi-byte strings and NUL handling today on HN. SQLite became popular because it was the only free and open-source choice 2 decades ago. Now there are other type-safe and robust choices.
It is very simple. Which means fast to setup in dev environment for local testing. Which makes first version very easy. And then people just keep fixing that one.

Still I quite a lot of question the use on servers if you have decided that I need a database.

Not that there isn't more valid use cases like local storage or self-contained information transfer for specific use.

What are other choices for FOSS serverless relational databases? I’ve been looking everywhere and couldn’t find anything.
Firebird can be embedded, although neither the database itself, nor the embedded mode are as popular as they once were.

It's a fully featured database though, with everything you expect from one, including actually working ALTER TABLEs.

DuckDB ? Strict by default and excellent for logs, telemetry, dashboard apps, etc.
From what I can tell, DuckDB is more focused on huge-scale data analysis than simple data persistence, so I’m not sure if it fits my use cases. Otherwise, it looks good.
It’s not as bad since you can always use a powerful programming language with a good type system that avoids type errors at the SQL level. You can build good abstractions in your programming language.