4 ms·
This is amazing. I’ve been wondering more and more myself why it’s always “proper” to run your backend code on separate servers from your database. Like this is
by rco8786 5y ago
This is amazing. I’ve been wondering more and more myself why it’s always “proper” to run your backend code on separate servers from your database. Like this is considered a must have for even the most basic architectures. No cloud provider or PaaS has real support for running your app code and your database on the same machine, but that should be the default for a huge majority of apps out there that don’t need the scalability beyond a single server.
- nileshtrivedi 5y agoAbsolutely. Also, somehow, the ability to write postgresql triggers and functions in standard languages (Python, Javascript) seems to be vastly underutilized. The times are changing though. If there's anybody here from Supabase team, would love to chat about these topics.
- kiwicopple 5y agoSupabase ceo here. Your article is very cool. > write postgresql triggers and functions in standard languages (Python, Javascript) seems to be vastly underutilized. This is definitely something we provide tooling for over time. We have plv8 installed on all databases so it should be simple enough
- mbreese 5y agoI’m confused. You can always run your backend code on the same machine as your database. It’s a good idea to keep the code decoupled (so when you get popular, you could move the database to a bigger box). But you have to maintain/install those things yourself. If you’re using a PaaS vendor, they will use specific instances or installations for your database to help make your setup more scalable. In reality, it is to make your code and all of their other customers code more scalable as a whole. But, the first step in developing an MVP should probably be running all of the code on a single server. But again, that assumes you’re the one setting up the server.
- rco8786 5y ago> You can always run your backend code on the same machine as your database. What I am saying is that nobody ever, ever does this. It’s considered a strict antipattern for any app, even dopey internal MVPs. And I think it should be the default pattern until you need to scale.
- e12e 5y agoSure people do. Trivially you have to do this when using sqlite - but for small number of users, postgres and an application server and a reverse proxy will run fine on a small vm.
- rco8786 5y agoWhere is this magical land? I remember trying to ship an internal tool with SQLite several years ago and getting admonished by a senior dev for it. Haven’t seen it since across 4 different companies and and additional 8 years of coding.
- zaphirplane 5y agoProper or best practise is a short hand. Think thru these 10 points or apply this best practise.