官术网_书友最值得收藏!

Scalability and performance

So far, we stressed the importance of having stateless behavior for a RESTful web application. The World Wide Web (WWW) is an enormous universe, containing huge amount of data and a lot of users, eager to get that data. The evolution of the WWW has brought the requirement that applications should scale easily as their load increases. Scaling applications that have a state is difficult to achieve, especially when zero or close-to-zero operational downtime is expected.

That's why staying stateless is crucial for any application that needs to scale. In the best-case scenario, scaling your application would require you to put another piece of hardware for a load balancer, or bring another instance in your cloud environment. There would be no need for the different nodes to sync between each other, as they should not care about the state at all. Scalability is all about serving all your clients in an acceptable amount of time. Its main idea is to keep your application running and to prevent Denial of Service (DoS) caused by a huge amount of incoming requests.

Scalability should not be confused with the performance of an application. Performance is measured by the time needed for a single request to be processed, not by the total number of requests that the application can handle. The asynchronous non-blocking architecture and event-driven design of Node.js make it a logical choice for implementing an application that scales and performs well.

主站蜘蛛池模板: 遵义县| 南投县| 昆山市| 山西省| 神木县| 五河县| 徐闻县| 合水县| 乐清市| 富源县| 千阳县| 承德县| 宕昌县| 石渠县| 八宿县| 凤凰县| 海原县| 玉屏| 保亭| 新河县| 乡宁县| 海丰县| 营口市| 徐闻县| 金堂县| 阿图什市| 肥城市| 淅川县| 铜鼓县| 岳西县| 九龙县| 卫辉市| 阿拉善盟| 隆尧县| 永川市| 长海县| 中西区| 佛山市| 晋州市| 车致| 永城市|