Book Image

Microservice Patterns and Best Practices

By : Vinicius Feitosa Pacheco
Book Image

Microservice Patterns and Best Practices

By: Vinicius Feitosa Pacheco

Overview of this book

Microservices are a hot trend in the development world right now. Many enterprises have adopted this approach to achieve agility and the continuous delivery of applications to gain a competitive advantage. This book will take you through different design patterns at different stages of the microservice application development along with their best practices. Microservice Patterns and Best Practices starts with the learning of microservices key concepts and showing how to make the right choices while designing microservices. You will then move onto internal microservices application patterns, such as caching strategy, asynchronism, CQRS and event sourcing, circuit breaker, and bulkheads. As you progress, you'll learn the design patterns of microservices. The book will guide you on where to use the perfect design pattern at the application development stage and how to break monolithic application into microservices. You will also be taken through the best practices and patterns involved while testing, securing, and deploying your microservice application. At the end of the book, you will easily be able to create interoperable microservices, which are testable and prepared for optimum performance.
Table of Contents (20 chapters)
Title Page
Dedication
Packt Upsell
Contributors
Preface
Index

Chaos Monkey


Chaos Monkey (https://github.com/Netflix/chaosmonkey) was created by the Netflix engineering team, and as its name suggests, it is intended to generate chaos in a random manner. The process will randomly choose servers in their production environment and deactivate them during business hours in order to measure application resiliency.

With Chaos Monkey, we can identify how to better distribute servers, look for more efficient monitoring systems, and develop resilient patterns.

Imagine an application that implements CQRS. Imagine what would happen if a Chaos Monkey test shut down the server from the writing database, as shown in the following diagram:

The answer is nothing serious. The process of writing the information will be interrupted, but the reading process will not be interrupted. If the queue used is transactional, the information consumed by the domain that is not registered will return to the queue until the CommandStack database instance is restored. With a good monitoring...