0
0
Supabasecloud~10 mins

Why Postgres powers Supabase - Visual Breakdown

Choose your learning style9 modes available
Process Flow - Why Postgres powers Supabase
User sends request to Supabase
Supabase receives request
Supabase queries Postgres database
Postgres processes query
Postgres returns data to Supabase
Supabase sends response to user
This flow shows how Supabase uses Postgres to handle user requests by processing queries and returning data.
Execution Sample
Supabase
SELECT * FROM users WHERE id = 1;
This SQL query asks Postgres to find the user with id 1 in the users table.
Process Table
StepActionInputPostgres BehaviorOutput
1Receive querySELECT * FROM users WHERE id = 1;Parse SQL queryParsed query plan
2Execute queryParsed query planSearch users table for id=1User record with id=1
3Return resultUser recordSend data back to SupabaseUser data sent
4Send responseUser dataSupabase formats responseResponse sent to user
💡 Query completed and user data returned to client
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
querynullSELECT * FROM users WHERE id = 1;Parsed query planUser record with id=1User data sent
responsenullnullnullFormatted responseResponse sent to user
Key Moments - 2 Insights
Why does Supabase rely on Postgres instead of another database?
Postgres offers powerful features like SQL support, reliability, and extensions that Supabase uses to provide a full backend service, as shown in the execution_table steps 2 and 3.
How does Postgres handle the SQL query sent by Supabase?
Postgres parses and plans the query first (step 1), then executes it to find the data (step 2), ensuring efficient and accurate results.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the output after Step 2?
AParsed query plan
BUser record with id=1
CResponse sent to user
DFormatted response
💡 Hint
Check the 'Output' column in row for Step 2 in execution_table
At which step does Supabase format the response before sending it to the user?
AStep 4
BStep 2
CStep 3
DStep 1
💡 Hint
Look at the 'Action' and 'Postgres Behavior' columns in execution_table for Step 4
If the query was changed to request all users, how would the output at Step 2 change?
AIt would return a single user record
BIt would return an error
CIt would return all user records
DIt would return no data
💡 Hint
Consider how SQL SELECT * FROM users works compared to WHERE id=1 in execution_table Step 2
Concept Snapshot
Supabase uses Postgres as its database engine.
Postgres processes SQL queries sent by Supabase.
It parses, executes, and returns data efficiently.
Supabase formats and sends this data back to users.
This setup provides a reliable backend service.
Full Transcript
Supabase works by receiving user requests and sending SQL queries to a Postgres database. Postgres parses these queries, executes them by searching the database, and returns the requested data. Supabase then formats this data and sends it back to the user. This process ensures fast and reliable data handling, making Postgres a powerful choice for Supabase's backend.