MFS401 : Table of Contents

Chapter 7

Lesson 2

Supabase Branching: Simplifying Development Across Multiple Environments

Foundational

Understanding Supabase Branching

The need for Branching

Setting Up Branching in Supabase

Quiz it to win it

Take the quiz

3 Questions
12 XP

Supabase's recently introduced Branching feature significantly improves managing multiple environments in projects. This feature allows us to create separate environments linked to their project's Git branches, simplifying the process of testing changes without impacting the production environment.

In the past, the management of multiple environments in Supabase was somewhat cumbersome. It involved setting up multiple Supabase projects and ensuring their synchronization through a combination of GitHub actions and database migration files. This method, while effective, was time-consuming and often led to a fragmented development workflow.

The new branching feature streamlines this process significantly. Now, we can create new branches within the same Supabase project. This integration not only simplifies the workflow but also maintains consistency across different development stages.

However, it's important to be mindful of the costs associated with creating new branches. While branching is undeniably useful, each new branch incurs additional costs. Therefore, it's recommended to use this feature judiciously – for instance, creating a 'dev' branch for major development work. For smaller, feature-specific branches, testing on a local Supabase instance might be more cost-effective. Additionally, regularly reviewing and deleting unused branches can help manage expenses.

Understanding Supabase Branching


Branching in Supabase is initiated by connecting the project with a Git repository. Currently, this feature supports GitHub, with plans to expand to other Git platforms. Once our Supabase project is linked with the GitHub repository, we can start creating Supabase branches that correspond to the Git branches. For example, we might have a 'dev' branch for development and a 'staging' branch for pre-production testing. Each Supabase branch is treated as an isolated instance, ensuring that the work done in these branches does not affect our main production environment.

Loading image...

Supabase Branching

Get started for free today!

No commitments. No contracts. Enjoy all features for a day — join in just three clicks!

No credit card required.

Quiz it to win it

Complete this quiz successfully to proceed to the next lesson and win upto 12XP.

Start quiz for this lesson

Completing this quiz will get you

+12 Experience Points

+5% course progress