Supabase Realtime Deep Dive — Postgres Changes, Broadcast, and Presence
Supabase Realtime gives you WebSocket-based push for three distinct use cases. Picking the wrong subsystem wastes messages and adds complexity, so this guide covers all three with Flutter code you can drop straight into production.
The Three Subsystems at a Glance
Feature Best for Persisted? Scale concern
Postgres Changes DB row events Yes — in PostgreSQL Messages/month
Broadcast Ephemeral signals No — fire-and-forget Messages/month
Presence Online state sync No — auto-clean on disconnect Presence events
Project Setup
# pubspec.yaml dependencies : supabase_flutter : ^2.5.0
Enter fullscreen mode
Exit fullscreen mode
// main.dart import 'package:supabase_flutter/supabase_flutter.dart' ;
Future < void > main () async { WidgetsFlutterBinding . ensureInitialized (); await Supabase . initialize ( url: const String . fromEnvironment ( 'SUPABASE_URL' ), anonKey: const String .…