3 ms·
Why learn SQLite when you could just learn Postgres and have a database that is virtually guaranteed to be enough in almost all cases?
by xwdv 4y ago
Why learn SQLite when you could just learn Postgres and have a database that is virtually guaranteed to be enough in almost all cases?
- Gigachad 4y agoHN users pride themselves on finding the least capable tool for the job that only just works for the task but no more. It’s not about logic or practicality. It’s that they feel some kind of mental pain using Postgres as it is too “bloated”.
- doodlesdev 4y agoTo be fair, if you were to consider yourself an engineer (which I imagine many of HNers would) that's essentially your whole job, overall what you want is to get the requirements fulfilled with the least complexity, cost, time, etc. If deployment difficulty or hardware usage is a consideration in the requirements then it makes sense to try and use a lighter-weight "serverless" database (SQLite doesn't use a client-server model, so it's serverless, got it??? I'll see myself out).
- throwawaylinux 4y ago"Anybody can organize their data, but it takes an engineer to barely organize their data."
- russelg 4y agoOr maybe its because SQLite is just... easier to deploy? Cheaper? There are many reasons to choose it over a "fatter" solution.
- somsak2 4y agodefinitely not easier to deploy, at least if you're talking about how most people build software these days (what sqlite managed service are you familiar with? for mysql or postgres there's hundreds of companies offering this)
- deathclassic 4y agoSQLite has other advantages over larger db systems. - By far easiest db to install. - Really go to learn database fundamentals with. If you have no experience with databases and are just starting out programming, PG is going to steepen the learning curve substantially.
- xenator 4y ago> By far easiest db to install. The difference between installation for sqlite and postgres is the difference between typing `apt install sqlite3` and `apt install postgres`. The actual learning curve for sqlite is more complex because picking random sql queries on the internet will end in misunderstanding in underlying types in sqlite and broken data. Postgres tools ecosystem is much more expressive, because more people think about Postgres as about "real" database.
- giobox 4y agoI'd go further and just point out the obvious - all DBs have incredibly well supported container run options in 2023, that mean you don't have to install the DB at all. I know of no DB that cannot be easily learned or deployed this way - even Microsoft SQLServer has a Linux image these days. Since the advent of containers for running software, deploying any DB software is largely as easy as any other with a one line run statement, and if container image is cached you are getting a new DB in seconds. If just starting out, running PG from a container is exactly how I would tell someone to learn today, and the process is largely identical whether they learn on windows, linux or a mac. I haven't natively installed a DB since probably 2015 for any kind of local development use, its just a waste of your time more often than not now. > https://hub.docker.com/_/postgres https://hub.docker.com/_/postgres
- deathclassic 4y agoYeah docker is great and I've done the exact same as you for a few years. But, I don't think I even knew what a docker container was until 2018, and again, as an intern or college kid with a school/work windows workstation telling them to run it in a container is a non starter.
- acuozzo 4y agoEmbedded? IoT?
- chillfox 4y agoDepends upon what you are optimizing. If you are optimizing for learning as few tools as possible then yes, learning PostgreSQL as your one database is a good idea. Personally I use both PostgreSQL and SQLite. I like SQLite because it's a lot nicer to work with, it's easier to quickly develop for and the ease of deployment and operations can't be beat. I use PostgreSQL when working with other people mostly because it's what everyone else knows and it's great for large systems.
- kcb 4y agoYea that is my thought as well. With how easy it is these days to spin up managed Postgres or compatible DB services it really seems unnecessary to not just start with that.
- infamia 4y agoI'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)
- srcreigh 4y agoWhy learn Postgres when you could just learn SQLite and have a database that is virtually guaranteed to be enough in almost all cases (and as sister comment says, is more efficient and more secure)?