top | item 36453273

(no title)

pipe_connector | 2 years ago

Lots of people being negative about this, but if you've ever implemented anything that works in near-real-time at wide scale, most of this design makes sense and it works great.

One thing interested me: Why the difference in pathing between events and messages? I think the event flow makes sense, but why not have messages also go through your gateway server instead of through webapp? Surely there is needless latency there when you already have an active websocket open to gateway? I thought perhaps it was because your gateway was for egress-only, but then the events section made it clear you also handle ingress there.

discuss

order

klabb3|2 years ago

My guess: it’s persisted mutations that need their own retry- and deduplication logic, as well as user facing error handling. Since it hits the db in the main region anyway latency is similar.

jhgg|2 years ago

Yeah it's a pretty cool design. Discord's real time system operates on a similar (although much more complicated system) on top of hash rings as well.