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

Best practices


Hardly any application has no storage, and it is always very inviting to use it indiscriminately. However, improper use of storage can be a problem for any type of application, including microservices.

When we think of the use of a pattern such as shared data, we have to adopt some good practices, which are listed as follows:

  • Databases are for storing data, not for business rules: Storing business rules in the database is a mistake, because it makes the application dependent on a structure, the implementation of caches, and hinders the process of data migration and distribution.
  • Databases are for storing data, not to communicate events: Some development teams adopt the process of triggers with their own database resources or workers observing changes to the information stored. The problem is that these triggers are difficult to monitor and debug, and are also a way to get business rules for storage.
  • Do not create entities with cyclic dependency: Without a doubt, this is one of...