hey hn, supabase ceo here
we're excited about this release - it adds a few neat features to our Realtime server[0]. For those who don't read the post (it's quite long), our Realtime server was initially built for subscribing to Postgres changes via websockets. We've added Broadcast functionality (for "ephemeral" messages that don't need to be persisted to Postgres) and Presence (similar to Broadcasts, but it retains an eventually-consistent state between users).
We were planning a larger write-up with all the technical details but it became a bit long. Some highlights:
- Realtime is built with Elixir an Phoenix[1]
- We've moved to a single, global cluster - We're using `Phoenix.Tracker` to globally distribute the Erlang PIDs of all of our Postgres connections. This guarantees there is only a single connection to each database.
- We've implemented a "leaky-bucket" rate-limiter using Erlang's `:counters` module[3] for "per tenant" rate-limiting. We'll move this to a global rate-limiter in the future
- We're currently seeing ~2000 concurrent connected users - it will be interesting to see what this spikes up to now that this is on HN
It's still in heavy development, and we'll make sure to detail all the choices we take as we continue solve problems. A few of the Realtime team will be here answer questions - @chasers, @wenbo, @abc3erl.
[0] Realtime: https://github.com/supabase/realtime
[1] Phoenix Framework: https://www.phoenixframework.org/
[2] rate limiter: https://en.wikipedia.org/wiki/Leaky_bucket
[3] :counters: https://www.erlang.org/doc/man/counters.html
Any chance of open sourcing the rate limiter bit for Elixir?