Live data from Hacker News

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

unixsheikh.com

221–230 of 378 posts

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

#221

Earlier quoted context omitted.

Distributed databases are rarely needed. I wouldn't call it an ordinary use case. The article isn't claiming Elon Musk can run Twitter off SQlite

It is honestly difficult for me to imagine what kind of applications people are working on that have these - to me - very lax reliability constraints. But we're just disagreeing over what "most" applications are like, based on our experiences, without any empirical data to say either way, so :shrug:.

WordPress is the obvious example of an application that can run like 99% of instances just fine with SQLite.

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

#222

Earlier quoted context omitted.

> It's not a good option for what you appear to want. Ok but the article you're replying in the comments to says "SQLite is all you need for nearly everything", and what the comment you're replying to is describing is, to use their very apt word choice, entirely ordinary . So how do we square this circle of somebody being told both "SQLite is all you need for everything" and "it is not a good option for your totally…

Distributed databases are rarely needed. I wouldn't call it an ordinary use case. The article isn't claiming Elon Musk can run Twitter off SQlite

you almost always need it if you don't want service interruption because server died.

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

#223

> In contrast to many other database management systems, SQLite is not a client-server database engine, but you actually very rarely need that. If your application software runs on the same physical machine as the database, which is what most small to medium sized web applications does, then you probably only need SQLite. Disagree. If you think about it from an attack surface perspective, there are numerous advantage…

> If you think about it from an attack surface perspective, there are numerous advantages to isolating the database.

The attack surface on PG or MySQL is a lot larger and there are a lot more moving parts than SQLite (which is just a file). Notably, there is no service exposed to the network that someone can attack, which is a huge attack vector with lots of different types of vulnerabilities that don't exist in SQLite.

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

#224

Earlier quoted context omitted.

Why do people use hosted databases instead of just installing them? I don’t understand it.

If you install your own copy, you are on call for it, and the colo is unlikely to offer much help. You also have to set up monitoring or you won’t even know when it fails. Then there’s replication. Backups. All this stuff is work that PaaS vendors are ready to automate away, if my time is expensive for the org. For fun, sure, dink around and learn as long as there are no customers to affect.

from another hand, vendor can screw things up and you don't have control over it.

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

#225
post #177
post #164

Earlier quoted context omitted.

Sure, you can do all that, but have you also written video games, UI frameworks, compilers, Twitter bots, localization tools, and web-based whiteboards? Have you ever made a music video or gotten a novel published? If not, why not? I'd say it's because you had different interests and spent your time elsewhere, which is completely fine and not a problem at all. People are allowed to have their own interests and explor…

No whiteboard, music video, or a published novel yet. But, come now, his point was he’d never worked with a full stack developer and that they don’t exist.

As the sibling comment notes, yes -- my point was that the 2023 version of a "full stack developer" is distressingly shallow in most of the individual skills.

I'll use myself as an example. I am a "full stack developer." I have fairly deep backend knowledge. But my React skills basically amount to the ability to make small JSX tweaks, and my sysadmin-y skills are also at roughly the same level.

Conversely, the folks who are really sharp at front end technologies tend to write some psychedelically bad backend code in terms of scalability and maintainability.

For some projects this admittedly doesn't matter. Some projects are simple and don't need to be wonders of engineering.

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

#226
post #49

I used to use SQL Server on a PC to deal with tables over 1 million rows. I'm on a Mac now... can I use SQL Lite? What is my best option? I am not a coder, I just know enough how to query SQL databases.

Check out: https://sqlitebrowser.org/

You may also need the SQLite command-line tools from the SQLite website; https://www.sqlite.org/download.html

Are you coming from using SQL Server Management Studio on a PC?

If yes, you may be better off using something like PostgreSQL on Mac OS X, and a PostgreSQL GUI browser tool, because it may be harder to use SQLite in this situation as you don't have the benefit of using a computer language to make up for the datatypes that SQLite does not have.

For example SQLite does not have a DateTime datatype. If you need to do a lot of date/time field manipulation in SQLite, this can be made easier when using a programming language like C#, because you can use a SQLite integer datatype to store the DateTime data, and then convert the integer to a C# DateTime datatype and do the DateTime manipulation in C#. But if you aren't a coder, then this option isn't available to you, and you will have to have other ways to manipulate DateTime data in SQLite like using the string datatype to store the date time values and then use corresponding SQL queries to handle the "DateTime stored as a string" situation.

(Maybe I've over-explained here. Sorry)

Here a PostgreSQL Mac OS X GUI browser download page: https://www.pgadmin.org/download/pgadmin-4-macos/

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

#227

I’ve argued this before and I’ll argue it here now: Modern computers are fast enough that in many cases “the only database you will ever need” can be files on the filesystem. For example “1 row = 1 file”. It brings additional benefits as well: for low-write applications you can use git to get a history (+transactions if you store them in the log), backups are super easy, replication is trivial. For higher-write appli…

I honestly can't tell if this is satire or not. But I think I'm curious either way: how do you index a column?

Store the index on the filesystem and populate it on write.

Not satire, though a bit sensationalistic to argue it’s a solid solution that’s usually overlooked because it’s “too slow”. I’m just pointing out it’s not actually slow any more.

Back in the days of scaled applications running on MySQL, DDR2 was 3200MB/s and people were so happy when their DB was small enough they could fit it in RAM.

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

#228
post #37

Why learn SQLite when you could just learn Postgres and have a database that is virtually guaranteed to be enough in almost all cases?

I'll bite, here are a few reasons:

- No N+1 query problems

- Far lower latency

- Easier to install, configure (you can issue a couple of special SQL statements, that's it), and maintain (no db service to monitor!)

- Better security (smaller attack surface with no service and no network access)

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

#229
post #64

Earlier quoted context omitted.

It would probably be harder to bend Django to use SQLite as a backend then it would be to just setup MySQL or PostGRES and use the existing Django tooling for it.

Doesn't django use sqlite by default?

Yes it does[0]. Which makes the parent comment even more hilarious.

> By default, the configuration uses SQLite.

--- 0: https://docs.djangoproject.com/en/4.1/intro/tutorial02/

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

#230
post #35

I would love to use SQLite for all my Django webapps that have only several simultaneous users, but this article suggests there are too many footguns for me to be able to do that. Is there a "using SQLite for a multi-threaded webapp for dummies" package that does all the config I need so I can just drop it in and go and not tune anything? Paging fly.io founders etc! If I have a persistent volume can my fly.io apps us…

It would probably be harder to bend Django to use SQLite as a backend then it would be to just setup MySQL or PostGRES and use the existing Django tooling for it.

Ignore this, I was wrong. Django supports sqlite just fine. Last time I did anything with django I was an intern and just copied the setup from the readme which happened to include a mysql setup. I have not touched django since.
Post reply on HN