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

Benefits of Reactive programming

Let's assume we have one million user transactions happening in our application. Next year, it is going to increase to 10 million, so we need to scale it. The traditional method of doing this is to add enough servers (horizontal scaling).

Instead of doing horizontal scaling, what if we get an option to scale with the same servers? Yes, Reactive programming will help us to do that. Reactive programming is all about non-blocking applications that are synchronous and event-driven, and it doesn't require a lot of threads to scale vertically (within the JVM) rather than horizontally (through clustering).

Reactive types are not intended to process requests faster. However, they focus more on request concurrency, especially requesting data from a remote server efficiently. With Reactive type support, you will get higher-quality service. While comparing traditional processing, which blocks the current thread while waiting for a result, a Reactive API requests only the amount of data that can be consumed. Reactive APIs deal with streams of data, not only with individual elements one by one.

Overall, Reactive programming is about non-blocking, event-driven applications that can be scaled with a small number of threads, with back pressure as a main component to make sure the producers (emitters) do not overwhelm consumers (receivers).

主站蜘蛛池模板: 祥云县| 历史| 台中县| 宜宾市| 咸宁市| 阿合奇县| 洛扎县| 庄浪县| 广元市| 平远县| 芜湖县| 海宁市| 东海县| 南漳县| 郎溪县| 长春市| 安平县| 塘沽区| 托克逊县| 华容县| 安远县| 潞西市| 阆中市| 汤阴县| 永吉县| 资兴市| 武清区| 扶余县| 云霄县| 从江县| 抚松县| 墨竹工卡县| 紫阳县| 盖州市| 弥渡县| 宁武县| 余干县| 柳州市| 周至县| 渝北区| 绵竹市|