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

Usage of DigitalOcean Managed PostgreSQL with Supabase #48

Open
evereq opened this issue Sep 10, 2023 · 4 comments
Open

Usage of DigitalOcean Managed PostgreSQL with Supabase #48

evereq opened this issue Sep 10, 2023 · 4 comments

Comments

@evereq
Copy link

evereq commented Sep 10, 2023

Thank you for this repo!

I wonder if we can use the existing managed DO PostgreSQL cluster with Supabase services installed in the droplet using this repo? Running PostgreSQL inside a single droplet without replication looks like not the best idea for production (i.e. no HA), but if we can somehow use DO-managed PostgreSQL it will be totally different picture. I read in other places that some extensions are required in PostgreSQL to be running, otherwise, Supabase will not work with it (E.g. people tried to connect to AWS RDS and that did not work well). Do you know anything about it from managed DB on DO? Are there any other instructions/suggestions on how to run Supabase in DigitalOcean in "HA" mode?

Our requirement is simple: we run DO k8s and DO-managed PostgreSQL DB and we want to have Supabase running that utilize the SAME DO-managed PostgreSQL instance. We could be just using Supabase hosting of course with our existing k8s cluster in DO, but they setup DB itself in AWS, not in DO, so I assume it's going to be huge latency (between DO k8s and AWS Supabase infra) if we do it that way.... Thoughts?

@appinteractive
Copy link

appinteractive commented Nov 19, 2023

@evereq any updates on how you handled that issue? I'm in the same position, asking myself if it's wise to use Supabase with Digital Ocean in the first place.

@evereq
Copy link
Author

evereq commented Nov 19, 2023

@appinteractive Unfortunately no, we did not find any "easy" way to do it. It will require a lot of work to deploy Supabase manually with PostgreSQL installed in droplets/pods in HA mode, together with backups, etc.

We analyzed many options we found on how to install PostgreSQL in HA in k8s:

  1. https://github.com/zalando/postgres-operator  (3.5k ⭐ )
  2. https://github.com/CrunchyData/postgres-operator  (3.4k ⭐ )
  3. https://github.com/cloudnative-pg/cloudnative-pg  (1.7k ⭐ )
  4. https://github.com/ongres/stackgres  (637 ⭐ )
  5. https://github.com/bitnami/charts/blob/main/bitnami/postgresql-ha
  6. https://github.com/zalando/patroni (5.9k ⭐ )

None was "easy" to run and we gave up for now 😢

DigitalOcean provided us with huge free credits for running our open-source projects (http://github.com/ever-co) recently (https://www.digitalocean.com/open-source/credits-for-projects), so we will most probably return to this task again soon, unless Supabase will make it "natively" possible to deploy clusters into DO (in addition to AWS / Azure / GCP), that would be amazing!

@appinteractive
Copy link

@evereq thanks for sharing your research! Really appreciate it 🙏

@pmchung
Copy link

pmchung commented Jun 17, 2024

I surmise it depends on the component. Supabase does require the availability of custom pg extensions and cloud managed instances only support vetted ones. I suppose if one is only interested in self managing auth, for example, should be able to do so. (of course, without the support of pg_net, real time, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants