0
0
Supabasecloud~10 mins

Supabase architecture (Postgres, Auth, Storage, Realtime, Edge Functions) - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Supabase architecture (Postgres, Auth, Storage, Realtime, Edge Functions)
Client Request
Auth Service
Postgres Database
Realtime Server
Storage Service
Edge Functions
Response to Client
Client sends request which first goes to Auth for verification, then interacts with Postgres. Postgres connects to Realtime, Storage, and Edge Functions to handle data, live updates, files, and custom logic.
Execution Sample
Supabase
1. Client sends login request
2. Auth verifies credentials
3. On success, client queries Postgres
4. Postgres triggers Realtime updates
5. Client uploads file to Storage
6. Edge Functions run custom logic
This flow shows how a client interacts with Supabase services step-by-step.
Process Table
StepActionService InvolvedState ChangeClient Impact
1Client sends login requestClient -> AuthAuth receives credentialsWaiting for auth result
2Auth verifies credentialsAuthUser authenticated or rejectedReceives auth token if success
3Client queries databaseClient -> PostgresPostgres processes queryReceives requested data
4Postgres triggers realtime updatePostgres -> RealtimeRealtime broadcasts changesClient UI updates live
5Client uploads fileClient -> StorageFile stored securelyFile available for access
6Edge Functions executeEdge FunctionsCustom logic runs on eventsClient gets processed results
7End of flow--Client interaction complete
💡 All steps complete; client has authenticated, accessed data, received live updates, stored files, and used custom logic.
Status Tracker
VariableStartAfter Step 2After Step 3After Step 4After Step 5After Step 6Final
Auth TokenNoneValid token or NoneValid tokenValid tokenValid tokenValid tokenValid token
Database DataEmptyEmptyQueried dataQueried dataQueried dataQueried dataQueried data
Realtime StateIdleIdleIdleBroadcasting updatesBroadcasting updatesBroadcasting updatesBroadcasting updates
Storage FilesEmptyEmptyEmptyEmptyFile storedFile storedFile stored
Edge Function ResultNoneNoneNoneNoneNoneProcessed resultProcessed result
Key Moments - 3 Insights
Why does the client need to authenticate before accessing the database?
Authentication ensures only authorized users can query the database, as shown in step 2 of the execution_table where Auth verifies credentials before Postgres processes queries in step 3.
How does realtime update the client interface?
Postgres triggers Realtime to broadcast changes (step 4), which updates the client UI live without needing manual refresh, as seen in the 'Client Impact' column.
What role do Edge Functions play in this architecture?
Edge Functions run custom logic on events (step 6), allowing the client to get processed results beyond simple database queries, enhancing flexibility.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what service verifies user credentials?
APostgres Database
BRealtime Server
CAuth Service
DStorage Service
💡 Hint
Check step 2 in the execution_table where authentication happens.
At which step does the client receive live updates?
AStep 3
BStep 4
CStep 5
DStep 6
💡 Hint
Look at the 'Client Impact' column for live UI updates in the execution_table.
If the client skips authentication, what happens to the database query step?
ADatabase query is rejected or blocked
BRealtime broadcasts updates anyway
CPostgres processes query normally
DEdge Functions run without data
💡 Hint
Refer to the key_moments about why authentication is needed before database access.
Concept Snapshot
Supabase architecture includes:
- Auth for user verification
- Postgres as the main database
- Realtime for live data updates
- Storage for file management
- Edge Functions for custom backend logic
Client requests flow through Auth, then Postgres, triggering Realtime, Storage, and Edge Functions as needed.
Full Transcript
Supabase architecture works by first having the client send a request that goes to the Auth service to verify the user. Once authenticated, the client can query the Postgres database. Postgres can trigger Realtime to send live updates to the client interface. Clients can upload files to Storage, which securely stores them. Edge Functions run custom backend logic on events to extend functionality. This flow ensures secure, real-time, and flexible cloud services for applications.