Bidirectional interaction patterns under HTTP/2

From my personal perspective, it is only deliberate because it is running on top of HTTP 1.1, which is text centric. So I would not necessarily say it was done in interest to enforce a certain pattern but rather because anything else would be unnatural (and many things binary based in HTTP 1.1 have to be explicitly encoded as text somehow anyway). But of course, I am just guessing as well.

Unfortunately, once you go distributed (i.e. you have more than one node), this approach is very hard to pull off, as you effectively move the problem to the domain of unique registration. Now you need to be able to answer where the process identified by ABC is in the whole cluster and there is no tool I would recommend at the moment that can reliably or efficiently solve this problem.

So if you consider the three different solutions:

  1. Bidirectional and stateless with SSE + POST (watercooler)
  2. Bidirectional and stateful via sessions/connections (phoenix channels)
  3. Bidirectional and stateful in the cluster (what you proposed, which can be found in something like Microsoft Orleans)

Each is more complex than the previous and each is also strictly more powerful than the previous. Still I don’t believe there is anything reliable enough to implement 3 right now.*

*well, I would recommend :global but it does have scalability and performance bottlenecks. Everything else I tried has led to issues in terms of consistency, duplication and loss of data at some point down the road.

3 Likes