If you want to subscribe to changes in a Postgresql database, whether produced by your app or not, you can also use Hasura or PostGraphile:
https://docs.hasura.io/1.0/graphql/manual/subscriptions/inde...
https://docs.hasura.io/1.0/graphql/manual/subscriptions/inde...
For anyone who wants something similar that's not GraphQL, then I'm in the early stages of developing a Phoenix (Elixir) implementation which broadcasts changes over websockets: https://github.com/supabase/realtime
See comments here: https://news.ycombinator.com/item?id=21354039