7 ms·
Ask HN: Moving from Cloud to Self-Hosted
My business partner and I are building a bootstrapped B2B SaaS, and designed it from the start with the intention of running it on Azure (or AWS).
The use of Postgres and TimescaleDB is core to the product. But now we discover that Azure's managed Postgres is still stuck on an antiquated version of TimescaleDB, and we've also realised that our compute requirements are much greater than originally anticipated. Aside from the managed Postgres issue, it would cost too much to host at a cloud provider, so we're now considering self-hosting.
The components we need are fairly modest, but we need everything to be highly-available and backed up:
- Postgres
- Blob storage
- Message queue
- Compute
We're struggling with HA for Postgres in particular. I'm looking for advice and OSS solutions that would simplify and give more of a "semi-managed" feel, to help us deploy our own HA stack somewhere like Hetzner.
- verdverm 6y agoYou could try Google Cloud and you may realize here are a lot more costs you haven't considered which make self hosting more expensive (maintenance and your time). Most SaaS and EE companies are running in the cloud, so why do you think cloud is cost prohibitive? What would happen if 200 people wanted to use your service tomorrow?
- tarun_anand 6y agoThere are a lot more costs in Cloud that you haven't considered either. And hey you end up optimizing costs which is a maintenance cost in itself!
- GordonS 6y agoThis last part is definately true. I've been working with cloud for years, and spend a lot of time building around limitations and trying to get creative to minimise costs.
- GordonS 6y agoI'm aware of the convenience of cloud, and I've been using both Azure and AWS for some years - it's very true that it can save you a lot of time and headache. I love working with Azure in particular. But it's also very true that it's expensive - compute and bandwidth costs elsewhere are a fraction of the cost. Fact is, we're just 2 blokes bootstrapping a new small business with no guarantee of success - no VC funding or massive AWS credit here! Given the current climate, it's also risky timing to spend a small fortune on cloud every month. And on the Postgres side, it would be wonderful to have full control over extensions (we really kind of need this).
- verdverm 6y agoI run a fully capable system on GCloud for less than $200 a month. It can scale quite readily if things take off and fits within budget as I too bootstrap. I'm working on https:/github.com/hofstadter-io What are you working on? Anything we can check out?
- GordonS 6y agoStill in stealth mode I'm afraid. I've worked mainly with Azure, a bit with AWS, but never with GCP. Just had a quick look at Postgres pricing on GCP. Not sure if I'm pricing it wrong, but it looks like a very modest HA setup with 16GB RAM, 2vCPUs and 1TB of storage would run to almost $600/m. They have "shared CPU" instances too, but they max out at 1.7GB of RAM and aren't covered by SLA. The pricing is also confusing, as it's not clear of the "HA" editions include the secondary instance or not, and HA SSD storage prices seem very expensive. And the real killer, they don't support TimescaleDB at all :(
- verdverm 6y agoIf you use k8s, you might have a look at the Zolando Postgres operator. Not sure if it supports TimescaleDB, but it should cover the rest of your needs.
- tarun_anand 6y agoWe use pg replication and Kafka for message queues - ie streaming data. An alternative is pulsar which has less management overhead. Haven't found a good alternative to blob but consider minion
- GordonS 6y agoI use minio elsewhere and it's been rock solid (altho it's for personal use, so only on a single node), so it would be my first choice for blob storage assuming it supports HA.
- ants_a 6y agoPatroni is a good choice for fully automated PostgreSQL HA. Depending on what you are comfortable with, you could either deploy it using something like Ansible on bare-metal or VMs, or with Spilo and postgres-operator on Kubernetes.
- avivallssa 6y agoInteresting. Would try to answer in short but rather ask you go through this webinar video i have given sometime back. https://www.percona.com/resources/webinars/enterprise-grade-postgresql-built-open-source-tools https://www.percona.com/resources/webinars/enterprise-grade-... Like some people mentioned - you could Patroni for HA. It is a template that could be configured with etcd like distributed consensus key value stores for leader election using the world famous RAFT algorithm. Could use Watchdog/Softdog for avoiding split-brain. Now, we could also do some actions before and after failover which can be scripted. Regarding HA on other pieces such as Blob store, you could use CRR using the AWS S3. You could just mount the S3 via NFS Gateway to DB servers and let the job be done in a more simpler way. Similarly, all the problems you mentioned are solved, however, anything you feel is still challenging after going through the webinar recording, please reply back here.