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

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

主站蜘蛛池模板: 保山市| 上饶市| 桦南县| 边坝县| 麦盖提县| 襄垣县| 澜沧| 芜湖市| 南安市| 韶山市| 咸宁市| 凭祥市| 清新县| 虞城县| 齐河县| 珲春市| 正阳县| 佛学| 武定县| 汕尾市| 菏泽市| 林西县| 改则县| 肥东县| 图木舒克市| 修文县| 阳春市| 大荔县| 腾冲县| 肥西县| 宁晋县| 蒙城县| 工布江达县| 瓮安县| 土默特右旗| 仁怀市| 定结县| 鄂托克旗| 天峻县| 乡宁县| 金湖县|