Too big a topic, it was largely done in the 1990s through lots of debates. Here is one output document, which has largely stood the test of time (except for maybe the content negotiation part). An important aspect is that connection oriented networks (such as websockets) carry a few overheads wrt scalability, but there's much more to it. https://www.w3.org/TR/webarch/