Book Image

Scala Microservices

By : Selvam Palanimalai, Jatin Puri
Book Image

Scala Microservices

By: Selvam Palanimalai, Jatin Puri

Overview of this book

<p>In this book we will learn what it takes to build great applications using Microservices, the pitfalls associated with such a design and the techniques to avoid them. </p><p>We learn to build highly performant applications using Play Framework. You will understand the importance of writing code that is asynchronous and nonblocking and how Play leverages this paradigm for higher throughput. The book introduces Reactive Manifesto and uses Lagom Framework to implement the suggested paradigms. Lagom teaches us to: build applications that are scalable and resilient to failures, and solves problems faced with microservices like service gateway, service discovery, communication and so on. Message Passing is used as a means to achieve resilience and CQRS with Event Sourcing helps us in modelling data for highly interactive applications. </p><p>The book also shares effective development processes for large teams by using good version control workflow, continuous integration and deployment strategies. We introduce Docker containers and Kubernetes orchestrator. Finally, we look at end to end deployment of a set of scala microservices in kubernetes with load balancing, service discovery and rolling deployments. </p><p></p>
Table of Contents (12 chapters)

Minimized chirper application

In this section, we will build a tiny Twitter-like application using Play and Lagom, which will contain the following features:

  • Simple signup, login, and logout pages
  • Ability to tweet
  • Ability to follow friends
  • A feed page containing our own tweets as well as our friends, this page is updated in real time when our friends tweet

The following diagram is a small overview of our desired application.

A couple of components are missing in the image and we will introduce them at a later stage. A quick summary of each microservice is as follows:

  • front-end: This is a Play-based web application. It contains all our UI code. In this example, we are not doing server-side session management.
  • friend: The friend microservice takes care of all the users in our system. It also contains information about the friends a user follows.
  • chirp: The chirp, or tweet ...