0
0
Supabasecloud~10 mins

Why Supabase is the open-source Firebase alternative - Visual Breakdown

Choose your learning style9 modes available
Process Flow - Why Supabase is the open-source Firebase alternative
Start: Need backend for app
Choose Firebase?
NoChoose Supabase
Yes
Firebase: Proprietary, closed source
Supabase: Open-source, Postgres-based
Supabase provides Realtime DB, Auth, Storage
Developers build apps with Supabase backend
Community contributes to Supabase code
More features and transparency
End: Open-source Firebase alternative
This flow shows the decision and benefits of choosing Supabase as an open-source alternative to Firebase for app backend needs.
Execution Sample
Supabase
import { createClient } from '@supabase/supabase-js';

const supabase = createClient('https://xyz.supabase.co', 'public-anon-key');

const { data, error } = await supabase.from('todos').select('*');
This code connects to Supabase and fetches all rows from the 'todos' table.
Process Table
StepActionInput/QuerySupabase ResponseResult
1Initialize clientURL and anon keyClient object createdReady to query
2Send querySelect all from 'todos'Returns list of todosData received
3Check errorError objectnull (no error)Proceed with data
4Use dataData arrayArray of todo itemsDisplay or process todos
5EndNo more queriesN/AApp backend working with Supabase
💡 All steps completed successfully, data fetched from Supabase database.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
supabaseundefinedClient objectClient objectClient objectClient object
dataundefinedundefinedArray of todosArray of todosArray of todos
errorundefinedundefinednullnullnull
Key Moments - 3 Insights
Why do we need to check the 'error' after querying?
Because the query might fail due to network or permission issues. Checking 'error' (see step 3 in execution_table) ensures we only use valid data.
What makes Supabase different from Firebase in terms of source code?
Supabase is open-source, meaning anyone can see and contribute to its code, unlike Firebase which is closed-source. This is shown in the concept_flow where Supabase encourages community contributions.
How does Supabase provide realtime features?
Supabase uses Postgres with realtime subscriptions, allowing apps to listen to database changes instantly. This is part of the 'Supabase provides Realtime DB' step in the concept_flow.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the value of 'error' after Step 3?
Aundefined
Bnull
CAn error message string
DAn empty array
💡 Hint
Check the 'error' column in row for Step 3 in execution_table.
At which step does the Supabase client get created?
AStep 2
BStep 3
CStep 1
DStep 4
💡 Hint
Look at the 'Action' column in execution_table for client initialization.
If the query returned an error, what would change in the execution_table?
A'error' would contain error details
B'data' would be an array
C'error' would be null
DClient object would be undefined
💡 Hint
Refer to the 'Supabase Response' and 'Result' columns in execution_table Step 3.
Concept Snapshot
Supabase is an open-source backend platform like Firebase.
It uses Postgres for database and supports realtime updates.
Developers connect using a client with URL and anon key.
Queries return data and error objects to handle results.
Open-source means community can contribute and inspect code.
Ideal for apps needing transparent, flexible backend services.
Full Transcript
Supabase is a backend platform that developers use to build apps. It is open-source, unlike Firebase which is closed-source. This means anyone can see and improve Supabase's code. Developers start by creating a client with a URL and a public key. Then they send queries to the database, like selecting all items from a table. Supabase responds with data and an error object. If there is no error, the app uses the data. Supabase also supports realtime updates and storage. This makes it a powerful and transparent alternative to Firebase for app backends.