Book Image

Embracing Microservices Design

By : Ovais Mehboob Ahmed Khan, Nabil Siddiqui, Timothy Oleson
Book Image

Embracing Microservices Design

By: Ovais Mehboob Ahmed Khan, Nabil Siddiqui, Timothy Oleson

Overview of this book

Microservices have been widely adopted for designing distributed enterprise apps that are flexible, robust, and fine-grained into services that are independent of each other. There has been a paradigm shift where organizations are now either building new apps on microservices or transforming existing monolithic apps into microservices-based architecture. This book explores the importance of anti-patterns and the need to address flaws in them with alternative practices and patterns. You'll identify common mistakes caused by a lack of understanding when implementing microservices and cover topics such as organizational readiness to adopt microservices, domain-driven design, and resiliency and scalability of microservices. The book further demonstrates the anti-patterns involved in re-platforming brownfield apps and designing distributed data architecture. You’ll also focus on how to avoid communication and deployment pitfalls and understand cross-cutting concerns such as logging, monitoring, and security. Finally, you’ll explore testing pitfalls and establish a framework to address isolation, autonomy, and standardization. By the end of this book, you'll have understood critical mistakes to avoid while building microservices and the right practices to adopt early in the product life cycle to ensure the success of a microservices initiative.
Table of Contents (16 chapters)
1
Section 1: Overview of Microservices, Design, and Architecture Pitfalls
6
Section 2: Overview of Data Design Pitfalls, Communication, and Cross-Cutting Concerns
10
Section 3: Testing Pitfalls and Evaluating Microservices Architecture

What this book covers

Chapter 1, Setting Up Your Mindset for Microservices Endeavor, teaches you about the role of different individuals while initiating a microservices endeavor, understanding the importance of building teams, and investing in your learning to execute the microservices adoption strategy according to the defined charter. This chapter also discusses the guidelines for building scalable, maintainable, and portable applications while adopting the 12-Factor App methodology.

Chapter 2, Failing to Understand the Role of DDD, teaches you about the importance of understanding domain-driven design to build cohesive services with bounded context. This chapter will re-examine the characteristics and properties of microservices with respect to domain-driven design and how it relates to building microservices. You will also learn about the importance of team building, governance, and the awareness of stakeholders.

Chapter 3, Microservices Architecture Pitfalls, teaches you about various architecture pitfalls while building microservices. It covers the complexities and benefits of microservices by relating them to various architecture practices and how they can be improved by using different patterns. Furthermore, it discusses the importance of understanding the pros and cons of various frameworks and technologies. Finally, it emphasizes the benefits of abstracting common microservices tasks and the drawback of a monolithic frontend.

Chapter 4, Keeping the Replatforming of Brownfield Applications Trivial, teaches you the techniques of replatforming brownfield applications followed by some patterns that can be used. Transitioning from a monolithic to a microservices architecture is not a straightforward process and there are many factors to consider, such as availability, reliability, and scalability, which are also discussed later in this chapter. Finally, it discusses some of the drawbacks of reusing monolithic application components rather than rewriting them to take advantage of emerging technologies that may offer better alternatives.

Chapter 5, Data Design Pitfalls, teaches you the importance of decomposing the database of a monolithic application into a set of microservices where each microservice manages its own database. Normalizing data in microservices could be an anti-pattern in many scenarios and this chapter discusses the reasons this should be avoided. This chapter covers strategies to break data out of monolithic databases and examines the pitfalls of not knowing how to handle transactions. You will also learn about atomic transactions across a distributed architecture using sagas. Finally, this chapter covers the pitfalls of not knowing how to perform reporting by implementing an API that is responsible for building complex reports for business analysis.

Chapter 6, Communication Pitfalls and Prevention, teaches you about various communication styles for microservices architecture, their challenges, and potential solutions. You will also learn about different techniques to enable resilient inter-process communication between microservices. Furthermore, it discusses the challenges of event-driven architecture and how they can be addressed using different approaches. Finally, you will learn about service meshes and how they compare to Dapr.

Chapter 7, Cross-Cutting Concerns, teaches you about the importance of the microservices chassis pattern and its use cases. This chapter starts with discussing some common needs for every microservices-based application and the pitfalls when addressing these concerns.

Chapter 8, Deployment Pitfalls, teaches you about various deployment pitfalls by starting with the necessity of having different deployment techniques. This chapter discusses the importance of using the right and dated tools and technologies to avoid failures. After that, you will learn about DevOps practices and factors to be considered, such as feature management, agile practices, a rollback strategy, approvals, and gates, when implementing it. Finally, this chapter covers various deployment patterns, such as deployment stamps, deployment rings, and geodes, and where they can be applied.

Chapter 9, Skipping Testing, teaches you about the importance of testing to the development and deployment of microservices. Skipping testing is not a good practice and can lead to failure. However, this can be avoided by shifting your testing to the left of your development life cycle. This chapter covers some strategies related to shift-left testing and the types of testing that support this approach.

Chapter 10, Evaluating Microservices Architecture, teaches you about some essential factors to consider while evaluating a microservices architecture. Giving these factors high priority while developing or replatforming an app will help you identify areas where improvement needs to happen.