Book Image

Scala Reactive Programming

By : Rambabu Posa
Book Image

Scala Reactive Programming

By: Rambabu Posa

Overview of this book

Reactive programming is a scalable, fast way to build applications, and one that helps us write code that is concise, clear, and readable. It can be used for many purposes such as GUIs, robotics, music, and others, and is central to many concurrent systems. This book will be your guide to getting started with Reactive programming in Scala. You will begin with the fundamental concepts of Reactive programming and gradually move on to working with asynchronous data streams. You will then start building an application using Akka Actors and extend it using the Play framework. You will also learn about reactive stream specifications, event sourcing techniques, and different methods to integrate Akka Streams into the Play Framework. This book will also take you one step forward by showing you the advantages of the Lagom framework while working with reactive microservices. You will also learn to scale applications using multi-node clusters and test, secure, and deploy your microservices to the cloud. By the end of the book, you will have gained the knowledge to build robust and distributed systems with Scala and Akka.
Table of Contents (16 chapters)

Getting Started with Reactive and Functional Programming

In recent times, the word Reactive has gained popularity far and wide. We can see this word in all IT books, magazines, blogs, tutorials, videos on YouTube, and so on.

Almost all programming languages, tools, IDEs, and platforms already support the Reactive architecture and the rest will move to it soon.

Here are some terms that are commonly heard in the Reactive world:

  • Reactive, Reactiveness, Reactive Manifesto, and Reactive Streams
  • Reactive programming (RP), Function Reactive Programming (FRP), OOP RP, Imperative RP, and Reactive Engine
  • Reactive system, Reactive applications, Reactive microservices, and Reactive Web Applications
  • Reactive Architecture, Reactive Design Patterns, and Reactive principles
  • Reactive tools, Reactive Platform, and Lightbend Reactive Platform
  • Reactive Extensions (Rx)—Rx Scala, Rx Java, Scala, Akka, Play Framework
  • Java Reactive API and Spring Reactor project

Are you really curious to know what Reactive is? Do you have the following questions and more in your mind—What is Reactive programming? Why do we need it? How do we write RP? Why is FP good for RP? What are the benefits of RP?

If yes, this book is for you. I'll introduce you to the Reactive World in a simple and easy way. I like a Diagram/Example-driven approach to learn new concepts and I feel you will like it too.

We can develop Reactive applications using a wide variety of languages or technologies. However, we will use Lightbend Reactive Platform in this book to develop our Reactive microservices.

Welcome to the Reactive World! Let's understand the Reactive World now. In this chapter, we will discuss the following topics:

  • What is Reactive? What is RP and FRP? What are the benefits of RP?
  • What is the Reactive Manifesto and what are its main goals?
  • Why is FP the best fit for RP?
  • What is the Java Reactive Streams API?
  • A discussion on the Flow API
  • What are Reactive Extensions?
  • What is the difference between Reactive and Observer Design Patterns?
  • What are RP Operators?
  • Marble diagrams for RP Operators