The Reactive Streams Difference

The Reactive Streams Difference

Overview

As the world continues to shift towards online-first data, for everything from their remote workplace to streaming their favorite shows on Netflix, it’s become more imperative to recognize that “live” data needs to be handled with extra special care in an asynchronous system.?

No alt text provided for this image

Asynchrony is needed in order to enable the parallel use of computing resources, on collaborating network hosts with a single streamline data engine.?

The primary goal of Reactive Streams is to govern the exchange of stream data across an asynchronous boundary – similar to passing elements on to another thread or thread-pool in traditional transfer – while ensuring that the receiving side isn’t forced to buffer arbitrary data.?

Meaning… Reactive Streams allow for MULTIFOLD data processing, as opposed to traditional models, leaving more room for faster response times and a smoother UX experience.

In Hirav Oza ’s Lightning Talk session, we will breaking down the following topics:

  • Functional Style Programming
  • Reactive Streams And Backpressure
  • Popular Reactive Libraries
  • Test Your Skills
  • Closing Thoughts

Functional Style Programming

Functional Programming languages are specially designed to handle symbolic computation and list processing applications. It is a declarative type of programming style with a main focus on “what to solve” in contrast to “how to solve” (an imperative style).?

Reactive Programming by nature embraces a functional programming style. It functions similarly to common programmer staples such as Steams API and Lambdas, making it a smooth integration curve.?

Reactive Streams And Backpressure

Backpressure happens when data can’t render as fast as it needs to. This can cause a “buildup” of data at the I/O Switch when buffers are full and cannot receive additional data. At this point, no additional data packets can be transferred until the bottleneck of data has been eliminated or the buffer has been emptied.

Reactive Streams disrupt buildup by supporting the back-pressure so they can signal the database to “hold off” on producing more output, or in other words– “buffer” until the remaining data is processed… Making for a smoother UX? experience for the interface user and a more cohesive data transfer for the programming system.?

No alt text provided for this image

Popular Reactive Libraries?

RxJava

No alt text provided for this image

RxJava is a specific implementation of reactive programming for Java and Android that is influenced by functional programming. It favors function composition, avoidance of global state and side effects, and thinking in streams to compose asynchronous and event-based programs.

Project Reactor

No alt text provided for this image

Reactor Core is a Java 8 library that implements the reactive programming model. It’s built on top of the Reactive Streams specification, a standard for building reactive applications.?

Flow API

No alt text provided for this image

Flow API is the official support for reactive streams specification since Java 9. It is a combination of both Iterator and Observer patterns.?

Flow API consists of four basic interfaces:

  • Subscriber: The Subscriber subscribes to Publisher for callbacks.
  • Publisher: The Publisher publishes the stream of data items to the registered subscribers.
  • Subscription: The link between publisher and subscriber.
  • Processor: The processor sits between Publisher and Subscriber, and transforms one stream to another.

Test Your Skills?

You’ve unpacked quite a few introductory principles – think you’re up to exploring a live demonstration of these concepts in play??

Hirav Oza has crafted an intuitive demonstration to help guide you through these principles in practicum:?

No alt text provided for this image

Be sure to follow Oza’s entire Lightning Talk to view this impressive demonstration in real time.

Closing Thoughts

All programs should always be designed with performance and the user experience in mind. The properties explored above are the primary stepping stones to exploring the basic components needed to test how Reactive Streams can improve your personal data application. Be sure to explore, have fun, and match up the components that work best for your project!

Happy coding!

To learn more about Reactive Streams in web development and to experience Hirav Oza’s full Lightning Talk session, watch here.

This article was originally published as a part of the Learning and Growth series on the InRhythm blog.?

This newsletter was curated by Kaela Coppinger. Thoughts or questions? Sound off in the comments section below.

要查看或添加评论,请登录

InRhythm的更多文章

社区洞察

其他会员也浏览了