by stavros · 3y ago · 0 comments
If what you need can suffice with SQLite, then Postgres will work too.
If you're running an app on a VM, running Postgres on it too is easy and isn't "big". It's easy to install and set up, and you're set up for all the features you may want later. Plus you avoid having to refactor for a different database later on.
If you're running your app in a serverless context, or on a PaaS/SaaS, etc, then SQLite might be easier. But maybe you want horizontal scalability with a shared dataset and then you're back at Postgres.
Just picking one thing "because everybody does" or "because it's lightweight" or "it works in most cases" etc aren't good reasons to pick technology. Look at your actual application, make a list of pros and cons, and choose based on your situation, not the cargo cult answer from the HN hive mind.
Nothing big, but I do appreciate being able to trial a tool or service on a test machine with a simple `docker run`.
Going by https://github.com/pgrok/pgrok/blob/main/internal/database/d... I don't think adding SQLite support should be that difficult. The ORM used (gorm) has SQLite support already.
Edit: this seems to be intentional to keep maintenance cost down: https://github.com/pgrok/pgrok/pull/11
>Generally, if your data is separated from the application by a network, you want to use a client/server database. This is due to the fact that the database engine acts as a bandwidth-reducing filter on the database traffic ... Use a client/server database engine. PostgreSQL is an excellent choice.
You can also see that the pgrokd.yml config example is connecting to the database via localhost, so running on the same machine as "pgrokd" (the server part of pgrok).