What database does Supabase use under the hood?
Supabase is built on PostgreSQL, giving you full SQL capabilities and relational data modeling.
Use Supabase as an open-source Firebase alternative
You can read this lesson publicly. Sign in to unlock exercises, quiz, and FX progress tracking.
Having trouble? AI is here to help
Ask context-aware questions about this lesson. Free plan: 5 questions/day. Upgrade to Premium for higher daily limits.
Use the AI button at the bottom of the screen
Supabase is an open-source Firebase alternative powered by PostgreSQL. It provides authentication, database, storage, and real-time capabilities with a generous free tier. Supabase gives you full SQL power with a developer-friendly API, making it an excellent choice for apps that need relational data modeling and row-level security.
1// pubspec.yaml: supabase_flutter: ^2.0.02import 'package:supabase_flutter/supabase_flutter.dart';34// ── Initialize ──5void main() async {6await Supabase.initialize(7url: 'https://your-project.supabase.co',8anonKey: 'your-anon-key',9);10runApp(const MyApp());11}1213final supabase = Supabase.instance.client;1415// ── Auth ──16await supabase.auth.signUp(email: 'user@email.com', password: 'pass123');17await supabase.auth.signInWithPassword(email: 'user@email.com', password: 'pass123');18await supabase.auth.signOut();19final user = supabase.auth.currentUser;2021// ── Database (PostgreSQL) ──22// INSERT23await supabase.from('todos').insert({'title': 'Learn Supabase', 'done': false});2425// SELECT26final todos = await supabase.from('todos')27.select()28.eq('done', false)29.order('created_at', ascending: false);3031// UPDATE32await supabase.from('todos').update({'done': true}).eq('id', 1);3334// DELETE35await supabase.from('todos').delete().eq('id', 1);3637// ── Real-time ──38supabase.from('todos').stream(primaryKey: ['id']).listen((data) {39print('Todos updated: $data');40});4142// ── Storage ──43await supabase.storage.from('avatars').upload('user123.jpg', file);44final url = supabase.storage.from('avatars').getPublicUrl('user123.jpg');
Firebase: NoSQL (Firestore), Google ecosystem, great for real-time. Supabase: PostgreSQL, open-source, SQL queries, Row Level Security, great for relational data.
Supabase works best when schema and security are designed together:
Strong schema plus policy design prevents both data leaks and query complexity drift.
Use Supabase as an open source Firebase alternative. Backend integration connects app actions to real user data and secure business workflows.
Operate with production and interview-level clarity.
Define data model and access rules before writing convenience helper methods.
Security and data integrity issues can damage user trust faster than UI bugs.
Security rules are part of architecture, not optional deployment polish.
As your app grows, keep UI, state, and data responsibilities separate so each part stays testable and easier to modify.
Supabase is built on PostgreSQL, giving you full SQL capabilities and relational data modeling.
Supabase uses chained methods like .eq(), .neq(), .gt(), .lt() for filtering, similar to PostgREST.
The .stream() method creates a real-time listener for a table, similar to Firestore's snapshots().
Something seems incorrect, unclear, or missing? Let us know.
FlutterCraft editorial lessons are reviewed by experienced Flutter developers and updated to stay aligned with modern Flutter and Dart best practices.
Reference docs: Flutter Documentation, Dart Language Tour, and official package documentation where relevant.
Sign in to continue with exercises and quiz for this lesson.
Sign In to Continue