Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy Managed Postgres on DigitalOcean :shipit: #90

Open
8 tasks
nelsonic opened this issue May 5, 2024 · 5 comments
Open
8 tasks

Deploy Managed Postgres on DigitalOcean :shipit: #90

nelsonic opened this issue May 5, 2024 · 5 comments

Comments

@nelsonic
Copy link
Member

nelsonic commented May 5, 2024

In light of Fly.io losing all our data for both Auth dwyl/auth#325 and the MVP dwyl/mvp#449 (comment)
I've decided we won't be using their platform anymore. EVER!! 😡

Instead, going to use https://www.digitalocean.com/products/managed-databases-postgresql
Because we can have an unlimited databases (with small amounts of data) in the same cluster:
https://www.digitalocean.com/community/questions/how-many-databases-can-i-create-for-15
image

Pricing: https://www.digitalocean.com/pricing/managed-databases at the time of writing $15/month
image

Todo

  • Record Screen while doing all the setup!
  • Setup the DB!
  • Create a Test DB
  • Add some data
  • Retrieve the data
  • Explore the point-in-time recovery

Next

@nelsonic
Copy link
Member Author

For the record: before embarking on this, we did a quick check of the Fly.io docs:
https://fly.io/docs/postgres/advanced-guides/high-availability-and-global-replication
To confirm they haven't changed their stance on having managed Postgres ...
Sadly, they haven't changed their stance on managed service:
https://fly.io/docs/postgres/getting-started/what-you-should-know/

image

It's still very much a "manage you own with our tools" ...
And as we've experienced, that's not fun when the machine crashes.

Their approach to high availability is still manual:
https://fly.io/docs/postgres/advanced-guides/high-availability-and-global-replication/
image

They are open about this approach not being good for write-heavy apps and those with long-lived connections:
https://fly.io/docs/postgres/advanced-guides/high-availability-and-global-replication/#this-is-wrong-for-some-apps
image

Doc snapshot: eb45cbf/postgres/advanced-guides/high-availability-and-global-replication.html.markerb

So with that, I feel like I'm left with no choice but to switch (the DB) to DigitalOcean Managed Postgres.

@nelsonic
Copy link
Member Author

The "problem" with DigitalOcean Managed Postgres: https://www.digitalocean.com/pricing/managed-databases#postgresql is that the cheapest instance $15/month is a total bait-and-switch!
image
The moment you want multiple instances for failover, they bump the instance from 1GB RAM to 2GB RAM and 10GB SSD to 30GB SSD i.e. not even "high availability", just a backup instance, quadruples the price!!

image

We only care about this while developing an App because it's $60/month x 12 month = $720/year ... 💸

And if/when you need to scale (vertically) the max is: 256 GiB RAM and 15TB SSD for $16,494/month:
image

Nobody is going to spend this much without having the revenue to cover it. 💰
Cough-cough except every "AI" company spending 100x this on training models with no path to profitability ... 😜
That's "VC Money" it's not real. Anyway ... 🤐

@nelsonic
Copy link
Member Author

PR in-progress: #92 🧑‍💻 ⏳

@nelsonic
Copy link
Member Author

GOTO: #93

@nelsonic
Copy link
Member Author

Given that connecting from Fly.io to DigitalOcean was a dead-end #93 (comment) we need to decide if we are going to use DigitalOcean for our Apps or if we should consider something more self-managed e.g: Hetzner #97 💭

The "hard" part is the Postgres, we need High Availability (continuous backups) and ideally fast/cheap storage.
DigitalOcean is silly expensive as noted above #90 (comment) the price accelerates rather than passing economies of scale back to the customer. 📈 💸
Obviously reaching the sort of scale where paying for serious Postgres resources are champagne problems.
but I still find it absurd to pay $16k/month for something that would cost ~€2k on Hetzner! 🤯 💰 🔥
https://www.hetzner.com/dedicated-rootserver

image

This is still an expensive machine! But there is simply no comparison! it's 1/8 the price!!
Sooooo ... this is what I'm thinking: dwyl/mvp#488 (comment)

nelsonic added a commit that referenced this issue Nov 22, 2024
asntc added a commit that referenced this issue Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Status: 🔖 Ready for Development
Development

No branches or pull requests

1 participant