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)

What this book covers

Chapter 1, Getting started With Reactive and Functional Programming, covers the FP, RP, and FRP paradigm in detail. It covers the Reactive Manifesto and explains how it solves most of the current systems' issues. It also discusses the Actor Model and the Shared-State Concurrency model. This chapter ends with Marble diagrams.

Chapter 2, Functional Scala, explains some of Scala's important Functional Programming features at a high level with some simple and useful examples.

Chapter 3, Asynchronous Programming with Scala, explains Scala's Future API, how it solves Concurrency issues, and how it supports asynchronous programming.

Chapter 4, Building Reactive Applications with Akka, explains about the Actor Model and Akka Toolkit concepts. It demonstrates how to develop Reactive applications using Akka's Actor Model and how it solves shared-state concurrency issues.

Chapter 5, Adding Reactiveness with RxScala, explains some basics of Reactive Extensions for Scala, that is, RxScala. Even though RxScala does not support full-fledged FRP functionality, it supports RP using Observables.

Chapter 6, Extending Applications with Play, introduces you to Play Framework, a full-stack web application framework. Even though Play Framework supports two separate APIs—one for Scala and another for Java, we will develop Reactive Web Applications using Play and Scala technologies.

Chapter 7, Working with Reactive Streams, explains the Akka Streams API, Akka's Reactive Streams implementations. It is a separate module or library from Akka Toolkit for developing streaming data applications using Akka's Actor model under the hood. We will develop a graph-based Streaming data application using Akka Streams Graph DSL.

Chapter 8, Integrating Akka Streams to Play Application, focuses on how to integrate the Akka Streams API into the Play web application and develop a multi-user chat application. It introduces you to Akka Stream’s dynamic streaming components.

Chapter 9, Reactive Microservices With Lagom, introduces Lightbend's new Reactive microservices framework, Lagom. It supports developing Reactive systems easily using Play, Akka, and Scala under the hood.

Chapter 10, Testing Reactive Microservices, explains what TDD is and its benefits. It's a good Agile practice to develop our application components by following the unit testing approach.

Chapter 11, Managing Microservices in ConductR, focuses on how to set up, deploy, and test our Reactive microservices locally using Lightbend's sandbox environment, ConductR.

Chapter 12, Reactive Design Patterns and Best Practices, explains Reactive design patterns and Reactive principles and best practices to develop Reactive systems easily.

Appendix A, Scala Plugin for IntelliJ IDEA, demonstrates how to install Scala Plugin for IntelliJ IDE and use it.

Appendix B, Installing Robomongo, shows a sequence of steps on how to setup and use Robo 3T or Robomongo tool to access our local MongoDB collections.