[–] MrKequc 0 points 0 points (+0|-0) ago  (edited ago)

Realtime is the future of stuff, it's being built into HTTP 3 (many websites and your browser use HTTP 2). But this article is too complicated. All you need to learn are the fundamentals, which are.

  1. Forget about request/response. It doesn't exist. A connection occurs and from that point on the client can send information to the server and the server can send information to the client.

  2. Reinvent request/response. Request/response is still very very useful. If I as a user want data from the server, I need to request it and I expect a response. Do this via transport ids. A very basic and good model is JSON-RPC but you can use whatever you want to honestly.

  3. Forget about REST. Every connection exists at a single api endpoint, data is streamed in both directions from there. Think in terms of "I want to run this function on the server."

  4. Start designing architectures that branch out from entry points. If the server sends you a message (at absolutely any time) that specifies { method: "article.created" } you need to know what to do with it and why your server thought it was important to tell you that.

  5. Learn pub/sub for the above. You want to subscribe to notifications about certain things and the server wants to publish notifications about certain things.

  6. Get used to single page web apps because they aren't going away. Old style websites are still desperately useful, but for complex realtime apps, it's all single page.