5 ms·
You can LISTEN/NOTIFY. Or you can use logical replication and a custom subscriber.[1] Supabase uses the latter.[2] [1]: https://www.postgresql.org/docs/current
by devbug 3y ago
You can LISTEN/NOTIFY. Or you can use logical replication and a custom subscriber.[1] Supabase uses the latter.[2]
[1]: https://www.postgresql.org/docs/current/logical-replication.html https://www.postgresql.org/docs/current/logical-replication....
[2]: https://github.com/supabase/realtime https://github.com/supabase/realtime
- mritchie712 3y agowe use this feature in Supabase, works great.
- dventimi 3y agoSupabase has arguably a better alternative, which uses logical replication and can be used outside of Supabase. https://github.com/supabase/realtime https://github.com/supabase/realtime
- jacobprall 3y agoSupabase realtime (especially if you want a managed backend) or other streaming CDC setups (like Decodable, which is Flink/Debezium under the hood) are also great choices for logical replication. Streaming tech will continue to get more cost-effective and simpler to implement in the coming year(s). I should note: I haven't used Decodable in production yet, I'm just a fan of Flink :)
- cryptonector 3y agoOne caveat about LISTEN/NOTIFY is that channels are not first-class objects, so there's no authorization associated with them, thus anyone who can login can also NOTIFY any payload to any channel.