Book Image

Microservices Deployment Cookbook

By : Vikram Murugesan
Book Image

Microservices Deployment Cookbook

By: Vikram Murugesan

Overview of this book

This book will help any team or organization understand, deploy, and manage microservices at scale. It is driven by a sample application, helping you gradually build a complete microservice-based ecosystem. Rather than just focusing on writing a microservice, this book addresses various other microservice-related solutions: deployments, clustering, load balancing, logging, streaming, and monitoring. The initial chapters offer insights into how web and enterprise apps can be migrated to scalable microservices. Moving on, you’ll see how to Dockerize your application so that it is ready to be shipped and deployed. We will look at how to deploy microservices on Mesos and Marathon and will also deploy microservices on Kubernetes. Next, you will implement service discovery and load balancing for your microservices. We’ll also show you how to build asynchronous streaming systems using Kafka Streams and Apache Spark. Finally, we wind up by aggregating your logs in Kafka, creating your own metrics, and monitoring the metrics for the microservice.
Table of Contents (15 chapters)
Microservices Deployment Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Scaling your microservice in Marathon


One of the most important design decisions in building a microservice is scalability. If your microservice is not scalable, there is no point in deploying it as a microservice; it could in fact be a huge monolithic application. There are several ways to scale a microservice. It also depends on the transport type your microservice uses. If your microservice uses HTTP, you should consider load-balancing your HTTP endpoints in various instances of your microservice. Another approach is using an asynchronous messaging system, such as ActiveMQ, Kafka, RabbitMQ, and ZeroMQ.

Getting ready

The geolocation microservice uses RESTful APIs to expose its endpoints. We should be considering load-balancing tools to load-balance the endpoints across instances of the geolocation application. In order to scale our application, let's first bring up the Marathon web interface.

How to do it...

  1. Once the Marathon web UI is up and running, deploy the application if it is not already...