Supabase Branching
Hello !
I have a few questions about Supabase Branching, it turns out to be a great alternative to creating a new project to set up a staging, however, I am faced with a problem, I saw that using Supabase Branching, it creates new login credentials, but in my case, I use Vercel for my front-end, for my backend that manages the connection to the database, it is on DigitalOcean, how in an architecture like mine Supabase Branching can be used?
In my case, what would be the best solution for staging with this architecture? I'd like to avoid deploying directly to production and have a staging environment.
Thanks for your feedback!
9 Replies
In DigitalOcean you have also a staging environment?
Yep
In digital Ocean i have 2 servers running : Staging | Production
In Vercel, when i pushed to the Dev branch it create my front-end in my staging url
And I imagine you have 1 branch called staging right? If thats the case, and from what I understand, if you use persistent branching you should be ok reusing the initial key created... So you set up you branch, end then use the credentials on your staging in DO and Vercel... have you tested that?
Oh yes, you're right, my staging branch, whether on Github or Supabase, isn't supposed to be deleted.
But given that it costs money to have a branch open on Supabase, is it good practice to have a staging branch open all the time?
I haven't activated the branching option yet, I was waiting to be sure that my use case was going to be relevant.
Personally I can't tell if is a good practice or not, I think it depends on the team... the development/git flow and so on... Is 100% up to you, whatever works best for you after considering trade off (like money)
I imagine you can set everything dynamically, but it will require a good amount of work with something like github actions and DO API
Yes, to be honest it's going to be a lot of work to have the environments set automatically on DO, for such a small team like mine, I just wanted to have permanent staging and not have an environment created for each branch.
I'm going to try and dig into the subject of persistent branching (as described in the documentation) in the end, it may be cheaper over time to have a staging branch at 0.32$ per day than an instance at a higher price.
yeah... having a permanent staging env means having fixed costs most of the time...
I imagine DO will charge for the resources too
Maybe @garyaustin (Sorry for the mention, but I know you've had a lot of experience with Supabase)
Do you have any ideas about best practice in relation to branches? Having a staging branch permanently activated?
Yes, there is the price of the Supabase pro subscription (to activate the branches), the cost of the branches and the cost of the front-end server on Vercel and the back-end server on DO.
Please don't shout mods or employees unless you are in a convo with them already. I try to look at every post here and only jump in quickly if I know the answer (or think I do). If I'm not sure I wait awhile for hoping others who do can jump in. In this case I know nothing about branching beyond docs.
You might look here https://github.com/orgs/supabase/discussions?discussions_q=is%3Aopen+branching
And in particular there is a long branching thread with a dev on it sometimes.