Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I don't doubt the power of SQLite, but its difficult to see why its worth using over Postgres anyways.

This is what it takes to run a basic postgres database on my own PC (in a docker compose file):

  postgres: 
     image: postgres:12.7
     container_name: postgres
     environment:
       - PGDATA=/var/lib/postgresql/data/pgdata
       - POSTGRES_PASSWORD=<pw>
     volumes:
       - ./volumes/postgres/:/var/lib/postgresql/data/

For someone who's completely allergic to SSH and linux, a managed Postgres service will take care of all that too.

SQLite seems simple in that its "just a file". But its not. You can't pretend a backup is just copying the file while a DB is operating and expect it to be consistent. You can't put the file on NFS and have multiple writers and expect it to work. You can't use complex datatypes or have the database catch simple type errors for you. Its "simple" in precisely the wrong way - it looks simple, but actually using it well is not simple. It doesn't truly reduce operational burden, it only hides it until you find that it matters.

Similarly postgres is not automatically complex simply because it _can_ scale. It really is a good technology that can be simple at small scale yet complex if you need it.



I'm not really sure why this post has downvotes. docker-compose dramatically lowers the barrier for setting up a single machine with multiple services (your service, db, etc). For a similar experience you do the same with AWS RDS or equivalent. Performance will be better and worse in various situations but if your software still fits in one machine you're largely going to be "ok." Backups, restore, monitoring, etc are all important for running software and that's something an sqlite file doesn't really offer the best solutions for. It works great for some things (I've used it many many times) but it's not perfect for everything.


I call this trend "tech hipster"-ism. Part of the motivation is just to do something different just for the sake of being different. Maybe part of it is a perception that Postgres or Linux are oh-so-scary and difficult things or that using the same technology that Amazon uses makes you evil. ¯\_(ツ)_/¯.


It's unfortunate you are getting downvoted. Nobody in this thread has given clear solutions for addressing issues like fault-tolerance, failover, backup and all the managed goodness you can get from choosing Postgres.


I believe the addressed backups in the article with litestream.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: