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)

Project structure

One can have an individual microservice as a standalone project with a distinct deployment/development process for each. This usually works in larger teams, but seldom in smaller teams. For this application, I have organized the code base as a collection of subprojects under one umbrella. Each subproject in a build has its own source directories, generates its own JAR file when you run packages, and, in general, works like any other project.

This setup is convenient in the sense that each project still has its own independence and is not impacted by the setup and dependencies of other projects in the build so it provides a good degree of independence and yet one could share common build-related files and common projects across projects if needed. For example, for maintenance purposes, we wish to use the same Play version across all our projects. In which case...