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

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).

主站蜘蛛池模板: 屏边| 东莞市| 密山市| 普定县| 环江| 通州区| 双城市| 鄂尔多斯市| 松潘县| 攀枝花市| 合山市| 清丰县| 衡水市| 昭觉县| 锡林浩特市| 新巴尔虎右旗| 土默特左旗| 广西| 固始县| 木兰县| 唐河县| 康平县| 安多县| 通渭县| 满洲里市| 定日县| 南京市| 汕尾市| 巴中市| 沙河市| 梨树县| 长宁区| 弋阳县| 商城县| 璧山县| 驻马店市| 云阳县| 甘肃省| 遂溪县| 南江县| 大渡口区|