Why are RESTful Applications easier to scale

前端 未结 5 1409
半阙折子戏
半阙折子戏 2020-12-30 06:58

I always read that one reason to chose a RESTful architecture is (among others) better scalability for Webapplications with a high load.

Why is that? One reason I ca

5条回答
  •  春和景丽
    2020-12-30 07:48

    A part of REST is indeed the URL part (it's the R in REST) but the S is more important for scaling: state.

    The server end of REST is stateless, which means that the server doesn't have to store anything across requests. This means that there doesn't have to be (much) communication between servers, making it horizontally scalable.

    Of course, there's a small bonus in the R (representational) in that a load balancer can easily route the request to the right server if you have nice URLs, and GET could go to a slave while POSTs go to masters.

提交回复
热议问题