Embracing Microservices Design: A practical guide to revealing anti-patterns and architectural pitfalls to avoid microservices fallacies
- Length: 306 pages
- Edition: 1
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2021-10-29
- ISBN-10: 180181838X
- ISBN-13: 9781801818384
- Sales Rank: #500941 (See Top 100 Books)
Develop microservice-based enterprise applications with expert guidance to avoid failures and technological debt with the help of real-world examples
Key Features
- Implement the right microservices adoption strategy to transition from monoliths to microservices
- Explore real-world use cases that explain anti-patterns and alternative practices in microservices development
- Discover proven recommendations for avoiding architectural mistakes when designing microservices
Book Description
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.
What you will learn
- Discover the responsibilities of different individuals involved in a microservices initiative
- Avoid the common mistakes in architecting microservices for scalability and resiliency
- Understand the importance of domain-driven design when developing microservices
- Identify the common pitfalls involved in migrating monolithic applications to microservices
- Explore communication strategies, along with their potential drawbacks and alternatives
- Discover the importance of adopting governance, security, and monitoring
- Understand the role of CI/CD and testing
Who this book is for
This practical microservices book is for software architects, solution architects, and developers involved in designing microservices architecture and its development, who want to gain insights into avoiding pitfalls and drawbacks in distributed applications, and save time and money that might otherwise get wasted if microservices designs fail. Working knowledge of microservices is assumed to get the most out of this book.
Table of Contents
- Setting up the mindset for Microservices endeavour
- Failing to understand the role of DDD
- Microservices Architecture Pitfalls
- Keeping re-platforming of brownfield applications trivial
- Data Design Pitfalls
- Communication pitfalls and prevention
- Cross Cutting Concerns
- Deployment Pitfalls
- Skipping Testing
- Evaluating Microservices Architecture
Embracing Microservices Design Foreword Contributors About the authors About the reviewers Preface Who this book is for What this book covers Download the color images Conventions used Get in touch Share Your Thoughts Section 1: Overview of Microservices, Design, and Architecture Pitfalls Chapter 1: Setting Up Your Mindset for a Microservices Endeavor Philosophy of microservices Microservice design principles Single responsibility principle and domain-driven design Encapsulation and interface segregation Culture of autonomy, ownership, and shared governance Independently deployable Culture of automation Designing for failures Observability Building teams to deliver business value faster Benefits of microservices Agility Maintainability Scalability Time to market Technology diversity Increased reliability Challenges of microservices Organizational culture Adoption of DevOps practices Architectural and operational complexity Service orchestration and choreography Observability End-to-end testing Double mortgage period Platform investment Microservice architecture components Messages Persistence and state management Orchestration Service discovery API gateway Reviewing leadership responsibilities What business/technology leaders must know What architects must know The role of the product manager, product owner, and scrum master Defining core priorities for a business Using the twelve-factor app methodology Code base Dependencies Config Backing service Build, release, and run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes Additional factors for modern cloud-native apps API first Telemetry Security Summary Questions Further reading Chapter 2: Failing to Understand the Role of DDD What are microservices and how do they align with DDD? Autonomous Independently deployable Data ownership Communication Technology-agnostic Gateway pattern service discovery Benefits and challenges of microservices as compared to DDD Lack of team alignment Lack of governance The whole is greater than the sum of its parts Autonomy What comes first – the data or the events? Microservices are based on science Complex or not complex – that is the question Obvious contexts – "the domain of best practice" Snowden's complicated contexts – "the domain of experts" Snowden's complex contexts – "the domain of emergence" A thin line between complicated and complex Snowden's chaotic context – "the domain of novel solutions" Snowden's disorder contexts – "the space in the middle" Our path is clear Event storming DDD A lack of awareness of stakeholder needs A knowledge-crunching domain model UL Binding the model to the implementation of our services Not a silver bullet Boundaries are important Bounded contexts Context maps Relationships between teams Anti-corruption layer Open host Aggregates Transactional boundary Aligned teams Iterative process Summary Questions Further reading Chapter 3: Microservices Architecture Pitfalls Layered architecture and its challenges Microservice architecture Over-architecting microservices Entity microservices The aggregator microservice Nanoservices Overusing frameworks and technologies Not abstracting common microservice tasks Dapr – LEGO® for microservices Lack of knowledge about the microservice platform Embracing containers Embracing the cloud-native approach Embracing micro platforms Neutralizing the benefits of microservices by adopting a frontend monolithic architecture Micro frontends Summary Questions Further reading Chapter 4: Keeping the Replatforming Brownfield Applications Trivial Not knowing the fundamentals when replatforming brownfield applications Why we should go for a microservice architecture Factors to consider when replatforming monolithic to a microservices architecture The decoupling approach Overlooking availability, reliability, and scalability when designing a microservices architecture Availability Reliability Scalability Sharing dependencies using older techniques Building self-contained services Reinventing is not an anti-pattern in microservices Summary Questions Further reading Section 2: Overview of Data Design Pitfalls, Communication, and Cross-Cutting Concerns Chapter 5: Data Design Pitfalls The pitfalls of keeping a single shared database Embracing polyglot persistence Normalizing read models Denormalizing read operations or keeping flat tables Understanding the CQRS principle Types of CQRS CQRS and microservices The problem we are trying to solve with CQRS The solution Challenges when implementing the CQRS pattern in our microservices The pitfalls of not knowing how to handle transactions Not choosing the right consistency and concurrency The choreography implementation of a saga The orchestration implementation of a saga Knowing how to perform reporting The API composition pattern Summary Questions Chapter 6: Communication Pitfalls and Prevention The fundamentals of microservices communication Synchronous versus asynchronous communication Messages and message types Asynchronous message-based communication Different architectures and their communication styles Direct client-to-microservice communication The API gateway pattern The overly complicated API gateway Multiple gateways – backends for the frontends Materialized view patterns Request timeout Retry patterns Circuit breaker patterns Long chains of synchronous calls – the retry storm Scalable infrastructure Load balancing, throttling, and request classifications Exponential backoff, jittering, and circuit breakers Only allowing the immediate layer to retry The dark side of event-driven microservices Event design pitfalls Avoiding service versioning Semantic versioning HTTP/REST API versioning approaches gRPC service versioning Event versioning Service meshes Dapr versus service meshes Summary Questions Further reading Chapter 7: Cross-Cutting Concerns Microservices chassis patterns Microservices application needs Cross-cutting pitfalls Embedding security handling inside microservices Not considering resiliency when building microservices Not considering idempotency when building microservices Embedding protocol translation inside microservices Message transformation coupling with microservices Directly exposing microservices to consumers Keeping configuration inside microservices Undiscoverable microservices Not maintaining a service template or framework Not paying attention to logging and monitoring Summary Questions Section 3: Testing Pitfalls and Evaluating Microservices Architecture Chapter 8: Deployment Pitfalls Failing to establish a deployment strategy Rolling deployment Canary deployment strategy A/B testing deployment strategy Blue/green deployment strategy Traffic shadowing deployment strategy Deploying Pods in Kubernetes Using outdated tools and technologies Failing to obtain cooperation from all teams Not considering Infrastructure as Code (IaC) for environment setup Not knowing the core principles of DevOps Feature management Agile practices Rollback strategy Using gates and approvals in Azure DevOps Deployment stamps pattern Deployment rings Geode pattern Summary Questions Chapter 9: Skipping Testing The shift-left testing strategy The testing pyramid Unit testing The unit testing life cycle Types of unit testing Scope of units Strategy Tools Frameworks and test maintenance End-to-end testing The two types of end-to-end testing White box and black box environments Journey testing Tools Integration testing Strategy Contract testing Tools Load testing Strategy Tools Summary Questions Further reading Chapter 10: Evaluating Microservices Architecture Identifying the core priorities of a business Managing architectural decisions Team structure Choosing the right methodology Decomposition strategy Evaluating the DevOps capability Understanding which part of the business is going to change more rapidly Infrastructure readiness Release cycles Communication protocol across services Exposing services to clients Distributed transaction handling Service development Capabilities of the hosting platform Deployment strategy Monitoring services Assigning a correlation token to each service request Defining a microservices chassis framework Shift-left approach for testing and security Summary Assessments Chapter 1: Setting Up Your Mindset for Microservices Endeavor Chapter 2: Failing to Understand the Role of DDD Chapter 3: Microservices Architecture Pitfalls Chapter 4: Keeping the Re-Platforming of Brownfield Applications Trivial Chapter 5: Data Design Pitfalls Chapter 6: Communication Pitfalls and Prevention Chapter 7: Cross-Cutting Concerns Chapter 8: Deployment Pitfalls Chapter 9: Skipping Testing Why subscribe? Other Books You May Enjoy Packt is searching for authors like you Share Your Thoughts
Donate to keep this site alive
How to download source code?
1. Go to: https://github.com/PacktPublishing
2. In the Find a repository… box, search the book title: Embracing Microservices Design: A practical guide to revealing anti-patterns and architectural pitfalls to avoid microservices fallacies
, sometime you may not get the results, please search the main title.
3. Click the book title in the search results.
3. Click Code to download.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.