Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Microservice Patterns and Best Practices

You're reading from   Microservice Patterns and Best Practices Explore patterns like CQRS and event sourcing to create scalable, maintainable, and testable microservices

Arrow left icon
Product type Paperback
Published in Jan 2018
Publisher Packt
ISBN-13 9781788474030
Length 366 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Vinicius Feitosa Pacheco Vinicius Feitosa Pacheco
Author Profile Icon Vinicius Feitosa Pacheco
Vinicius Feitosa Pacheco
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Title Page
Dedication
Packt Upsell
Contributors
Preface
1. Understanding the Microservices Concepts FREE CHAPTER 2. The Microservice Tools 3. Internal Patterns 4. Microservice Ecosystem 5. Shared Data Microservice Design Pattern 6. Aggregator Microservice Design Pattern 7. Proxy Microservice Design Pattern 8. Chained Microservice Design Pattern 9. Branch Microservice Design Pattern 10. Asynchronous Messaging Microservice 11. Microservices Working Together 12. Testing Microservices 13. Monitoring Security and Deployment 1. Other Books You May Enjoy Index

Index

A

  • AAA (Authentication, Authorization, and Accounting) / Identifying the fat domains
  • active monitoring / Monitoring a single service
  • ActiveMQ / ActiveMQ
  • Advanced Message Queuing Protocol (AMPQ) / Creating the orchestration controller
  • aggregator design pattern
    • about / Understanding the pattern
    • CQRS, applying / Applying CQRS and event sourcing
    • event sourcing / Applying CQRS and event sourcing
    • database, separating / Separating the database
    • microservices, refactoring / Refactoring the microservices
    • microservice communication / Microservice communication
    • scalability / Pattern scalability
    • bottleneck anti-pattern / Bottleneck anti-pattern
    • best practices / Best practices
    • tests, applying / Applying tests
    • functional test / Functional test
    • functional test, writing / Writing the functional test
    • integration test / Integration test
    • advantage / Pros and cons of aggregator design pattern, Pros of aggregator design pattern
    • disadvantage / Pros and cons of aggregator design pattern, Cons of aggregator design pattern
  • anemic domains
    • identifying / Identifying anemic domains
  • anti-corruption layer (ACL) / Domain-driven design
  • Apache Avro
    • URL / Tools for synchronous communication
    • about / Apache Avro
  • Apache Benchmark (AB) / Apache Benchmark
  • Apache Thrift
    • URL / Tools for synchronous communication
    • about / Apache Thrift
  • API gateway / The API gateway
  • application
    • about / Knowing the application
    • DDD / Domain-driven design
    • single responsibility principle / Single responsibility principle
    • explicitly published interface / Explicitly published interface
  • asynchronous messaging design pattern
    • about / Understanding the pattern
    • scalability / Pattern scalability
    • best practices / Best practices
    • advantage / Pros and cons of the asynchronous messaging design pattern
    • disadvantage / Pros and cons of the asynchronous messaging design pattern

B

  • best practices, asynchronous messaging design pattern
    • application, defining / Application definition
    • responses, avoiding / Don’t try to create responses
    • simplicity, maintaining / Keep it simple
  • best practices, branch design pattern
    • domain, definition / Domain definition
    • rules, following / Respect the rules
    • physical components / Attention to physical components
    • simplicity, maintaining / Keep it simple
  • best practices, chained design pattern
    • pure microservices / Purest microservices
    • consistent data, requesting / Requesting consistent data
    • chaining / Understanding chain in depth
    • communication layer, using / Paying attention to the communication layer
  • best practices, proxy design pattern
    • purest pattern / Purest pattern
    • bottleneck, viewing / Looking at the bottleneck
    • proxy, caching / Caching in the proxy
    • response, controlling / Simple response
  • Big Ball of Mud anti-pattern
    • about / Big Ball of Mud anti-pattern
    • characteristics / Big Ball of Mud anti-pattern
  • binary communication
    • about / Binary communication – direct communication between services, Understanding the aspect
    • used, for direct communication between services / Binary communication – direct communication between services
    • used, for direct communication between service / Binary communication – direct communication between services
    • synchronous communication, tools / Tools for synchronous communication
    • MessagePack / MessagePack
    • gRPC / gRPC
    • Apache Avro / Apache Avro
    • Apache Thrift / Apache Thrift
    • direct communication alerts / Direct communication alerts
  • blue/green deployment pattern / The blue/green deployment pattern and Canary releases
  • bottleneck anti-pattern / Bottleneck anti-pattern
  • Bounded Context
    • reference link / Understanding CQRS
  • branch design pattern
    • about / Understanding the pattern
    • rules / Understanding the pattern
    • used, for data orchestration / Data orchestration and response consolidation
    • used, for response consolidation / Data orchestration and response consolidation
    • flow / Data orchestration and response consolidation
    • microservice communication / Microservice communication
    • scalability / Pattern scalability
    • advantage / Pros and cons of the branch design pattern
    • disadvantage / Pros and cons of the branch design pattern
  • brown projects / Understanding the pattern

C

  • C# / C#
  • caching
    • at client level / Caching at the client level
  • caching first / The public facing layer
  • caching tools
    • about / Caching tools
    • Memcached / Memcached
    • Redis / Redis
  • Canary release / The blue/green deployment pattern and Canary releases
  • chained design pattern
    • about / Understanding the pattern
    • flow / Understanding the pattern
    • used, for data orchestration / Data orchestration and response consolidation
    • used, for response consolidation / Data orchestration and response consolidation
    • microservice communication / Microservice communication
    • scalability / Pattern scalability
    • best practices / Best practices
    • advantage / Understanding the pros and cons of chained design pattern
    • disadvantage / Understanding the pros and cons of chained design pattern
  • Chaos Gorilla / Chaos Monkey
  • Chaos Monkey
    • about / Chaos Monkey
    • reference link / Chaos Monkey
    • Chaos Gorilla / Chaos Monkey
    • Conformity Monkey / Chaos Monkey
    • Doctor Monkey / Chaos Monkey
    • Janitor Monkey / Chaos Monkey
    • Latency Monkey / Chaos Monkey
    • Security Monkey / Chaos Monkey
  • circuit breaker / Circuit breaker
  • Command Query Responsibility Segregation (CQRS)
    • about / Asynchronism and workers, CQRS – query strategy, What is CQRS?, Understanding CQRS, Data orchestration
    • implementing, advantages / Advantages and disvantages of implementing CQRS
    • implementing, disadvantages / Advantages and disvantages of implementing CQRS
    • applying / Applying CQRS and event sourcing
  • CommandStack / Understanding CQRS
  • communication
    • documentation / Documentation of communication
  • complex queries / What is CQRS?
  • Conformity Monkey / Chaos Monkey
  • containers
    • separating / Separating containers
    • layered services architecture / Layered services architecture
    • UsersService, separating / Separating UsersService
    • preparing, for integration test / Preparing the containers for the integration test
    • about / Service instance per container
  • content obsolescence / What is CQRS?
  • context maps / Domain-driven design
  • continuous delivery / Continuous integration/continuous delivery/continuous deploy
  • continuous deploy / Continuous integration/continuous delivery/continuous deploy
  • continuous integration (CI) / Release pipelines, Continuous integration/continuous delivery/continuous deploy
  • current application status
    • about / Understanding the current application status
    • public facing layer / The public facing layer
    • internal layer / The internal layer
    • general tools / Understanding general tools
    • microservices, communication between / Communication layer and accreditation between services
    • pattern distribution / Pattern distribution
    • fail strategies / Fail strategies
    • API integration / API integration

D

  • data
    • deprecating / Depreciating data
    • regionalizing / Regionalizing data
  • DataAccess / Layered services architecture
  • database
    • about / The databases
    • separating / Separating the database
    • CommandStack container, writing / Writing the CommandStack container
    • News Databases, creating / Creating the news databases
    • QueryStack container, writing / Writing the QueryStack container
  • data orchestration
    • shared data pattern, used for / Data orchestration
    • proxy design pattern, used for / Proxy strategy to orchestrator
    • chained design pattern, used for / Data orchestration and response consolidation
    • branch design pattern, used for / Data orchestration and response consolidation
  • Death Star / Direct communication alerts
  • deployment
    • about / Deployment
    • continuous integration / Continuous integration/continuous delivery/continuous deploy
    • continuous delivery / Continuous integration/continuous delivery/continuous deploy
    • continuous deploy / Continuous integration/continuous delivery/continuous deploy
    • blue/green deployment pattern / The blue/green deployment pattern and Canary releases
    • Canary releases / The blue/green deployment pattern and Canary releases
    • multiple service instance per host / Multiple service instances per host
    • service instance per host / Service instance per host
  • direct communication alerts / Direct communication alerts
  • Distributed Denial of Service (DDoS) / Defense for malicious requests – Identifying attacks
  • Django Framework Rest / Python
  • Dockerfile
    • requirements.txt, dependencies / Dependencies with requirements.txt
  • Domain-Driven Design (DDD) / Domain-driven design, Understanding the pattern, Data orchestration and response consolidation
  • domains
    • migrating, to entity / From domain to entity
  • domain structure
    • developing / Developing the structure
    • database / Database
    • programming language and tools / Programming language and tools
  • dumb proxy / Dumb proxy

E

  • ecosystem
    • using, against failures / Bulkheads – using the ecosystem against failures
    • redundancy, designing / Designing for redundancy
    • partition, by criticality / Partitioning by criticality
    • isolation, designing with / Designing with isolation
    • fail fast / Fail fast
  • end-to-end tests / End-to-end tests
  • event sourcing
    • about / Event sourcing – data integrity, Understanding event sourcing, Applying CQRS and event sourcing
    • state mutation / State mutation
  • explicitly published interface / Explicitly published interface

F

  • fail alert tools / Fail alert tools
  • fail strategies / Fail strategies
  • fasthttp
    • reference link / Handlers
  • fasthttprouter
    • reference link / Handlers
  • fat domains
    • identifying / Identifying the fat domains
  • functional test / Functional test
  • Fuzzing / Monkey tests

G

  • Go
    • about / Go, Go
    • logs / Logs
    • handlers / Handlers
    • middleware / Middleware
    • tests / Tests
    • package manager / Package manager
    • Golang ORMs / Golang ORMs
  • godep
    • reference link / Package manager
  • gorilla/mux
    • about / Handlers
    • reference link / Handlers
  • green projects/greenfield applications / Understanding the pattern
  • gRPC
    • URL / Tools for synchronous communication, Understanding the data contract between services
    • about / gRPC

H

  • health checks / Monitoring a single service
  • heterogeneous applications / Potentially heterogeneous/polyglot
  • HTTP API / The public facing layer

I

  • independent deployment / Independently deploy, upgrade, scale, and replace, Independent deployment
  • independent upgrade
    • about / Independently deploy, upgrade, scale, and replace, Upgrade
    • rules / Upgrade
  • integration test
    • about / Integration test, Integration tests
    • writing / Writing the integration tests
    • containers, preparing / Preparing the containers for the integration test
  • interceptor / Explaining the interceptor
  • interchange context / Domain-driven design
  • internal communication, microservice
    • sequential / Microservice communication
    • threads / Microservice communication
    • message broker / Microservice communication
  • Internal Services / Understanding the pattern

J

  • Janitor Monkey / Chaos Monkey
  • Java / Java
  • JavaScript / JavaScript
  • JWT (JSON Web Token) / Understanding JWT

K

  • Kafka / Kafka

L

  • Latency Monkey / Chaos Monkey
  • layered services architecture / Layered services architecture
  • light weight communication
    • about / Light weight communication
    • synchronous / Synchronous
    • asynchronous / Asynchronous
  • Load Balancer / Microservice communication, Understanding the pattern
  • locale proof performance
    • about / Locale proof performance
    • AB / Apache Benchmark
    • WRK tool / WRK
    • Locust / Locust
  • Locust / Locust
  • logrus
    • reference link / Logs
  • logs
    • viewing / Looking at the logs

M

  • Memcached / Memcached
  • message broker
    • used, for async communication between services / Message broker – Async communication between services
    • ActiveMQ / ActiveMQ
    • RabbitMQ / RabbitMQ
    • Kafka / Kafka
    • about / Microservice communication, Microservice communication
    • applying / Applying the message broker
    • containers, working / Making the containers work together
    • proxy/load balancer, updating / Updating the proxy/load balancer
  • MessagePack
    • URL / Tools for synchronous communication
    • about / MessagePack
  • metrics / The metrics – Understanding the numbers
  • Microservice Aggregator / Data orchestration and response consolidation
  • microservice communication
    • about / Microservice communication
    • orchestrator, building / Building the orchestrator
    • message broker, applying / Applying the message broker
  • microservice domains
    • identifying, for business / Identifying microservice domains for the business
  • microservice encapsulation / Best practices
  • microservice frameworks
    • about / Microservice frameworks
    • Python / Python
    • Go / Go
  • microservices
    • monolithic application, separating into / Breaking a monolithic application into microservices
    • priorities, defining / Defining priorities
    • deadlines, setting / Setting deadlines
    • domain, defining / Defining the domain
    • experiment, performing / Making experiments
    • standards, defining / Defining standards
    • prototype, creating / Creating a prototype
    • sending, to production / Sending to production
    • developing / Developing new microservices, Exposing the microservice data
    • configuration file, writing / Writing the microservice configuration file
    • model, creating / Creating our model
    • data, exposing / Exposing the microservice data
    • app, executing / Preparing the app to run
    • Dockerfile, creating / Creating the Dockerfile
    • refactoring / Refactoring the microservices
    • requirements, selecting / Selecting our requirements
    • framework, configuring / Configuring the framework
    • container, configuring / Configuring the container
    • model, writing / Writing the models
    • service, creating / Creating the service
    • database containers, preparing / Preparing the database containers to work together
    • communication layer, and accreditation between services / Communication layer and accreditation between services
    • data contract, using / Understanding the data contract between services
    • binary communication, applying / Applying binary communication 
  • microservices, monitoring
    • about / Monitoring microservices
    • single service, monitoring / Monitoring a single service
    • multiple services, monitoring / Monitoring multiple services
    • logs, viewing / Looking at the logs
    • application errors, learning from / Learning from the errors in the application
    • metrics / The metrics – Understanding the numbers
  • microservices structure
    • about / Project structure
    • models.go file / The models.go file
    • app.go file / The app.go file
    • main.go file / The main.go file
  • Minimum Viable Product (MVP) / Development of practicality
  • mobile applications
    • endpoints / Endpoints for mobile applications
  • mock / Unit tests
  • monkey test / Monkey tests
  • monolithic application
    • separating, into microservices / Breaking a monolithic application into microservices
  • multiple service instances per host / Multiple service instances per host
  • multiple services
    • monitoring / Monitoring multiple services

N

  • Nagios Core
    • reference link / Monitoring multiple services
  • Negroni
    • reference link / Middleware
  • NewOrchestrator / Microservice communication

O

  • Orchestration Process / Data orchestration and response consolidation
  • orchestrator
    • about / Layered services architecture
    • building / Building the orchestrator
    • microservice container, preparing / Preparing the microservice container
    • dependencies, writing / Writing the dependencies
    • configuration file, writing / Writing the configuration file
    • server access, writing / Writing the server access
    • controller, creating / Creating the orchestration controller
  • Orchestrator Service / The public facing layer

P

  • passive monitoring / Monitoring a single service
  • pattern distribution / Pattern distribution
  • patterns
    • applying, in application / Pattern distribution
  • pipelines
    • releasing / Release pipelines
  • polyglot / Potentially heterogeneous/polyglot
  • POSIX threads (pthreads) / Microservice communication
  • process sequence anti-pattern / Process sequence anti-pattern
  • programming languages / Programming languages
  • programming languages, aspects
    • proficiency / Proficiency
    • performance / Performance
    • practicality, development / Development of practicality
    • ecosystem / Ecosystem
    • scalability cost / Scalability cost
    • application, selecting / Making choices for our application
  • proxy / The proxy approach, Proxy strategy to orchestrator
  • proxy design pattern
    • about / The proxy approach
    • dumb proxy / Dumb proxy
    • smart proxy / Smart proxy
    • using / Understanding our proxy
    • used, for data orchestration / Proxy strategy to orchestrator
    • microservice communication / Microservice communication
    • scalability / Pattern scalability
    • best practices / Best practices
    • advantages / Pros and cons of proxy design pattern
    • disadvantages / Pros and cons of proxy design pattern
  • public facing layer / The public facing layer
  • Public Facing Services / Understanding the pattern
  • published interfaces
    • about / Explicitly published interface
    • published versioned interfaces / Explicitly published interface
    • small published interfaces / Explicitly published interface
    • published external interfaces / Explicitly published interface
  • Python / Python, Python

Q

  • QueryStack / Understanding CQRS
  • queueing / Understanding CQRS

R

  • RabbitMQ / RabbitMQ
  • Recommendation Service
    • data, defining / Data definition – RecommendationService
    • about / The public facing layer
  • RecommendationService, communication features
    • about / Microservice communication
    • queues, applying / Applying the message broker and queues
    • message broker, applying / Applying the message broker and queues
    • pub/sub structure, preparing / Preparing the pub/sub structure
  • RecommendationService domain
    • defining / Domain definition – RecommendationService
  • RecommendationService microservice
    • coding / Coding the microservice
  • Redis / Redis
  • refactoring / Applying binary communication 
  • Remote Procedure Call (RPC) / Microservice communication
  • response consolidation
    • chained design pattern, used for / Data orchestration and response consolidation
    • branch design pattern, used for / Data orchestration and response consolidation
  • REST (Representational State Transfer) / Understanding the pattern
  • risk points, for microservice failure
    • performance / Performance
    • build / Build
    • components / Components
    • implementation gaps / Implementation gaps

S

  • scalability
    • about / Scale
    • x-axis / The x-axis
    • y-axis / The y-axis
    • z-axis / The z-axis
    • replace process / Replace
  • Secure Socket Layer (SSL) / Web container
  • security
    • about / Security
    • JWT / Understanding JWT
    • SSO / Single Sign-On
    • of data / Security of data
    • attacks, identifying / Defense for malicious requests – Identifying attacks
    • interceptor / Explaining the interceptor
    • web container / Web container
    • API gateway / The API gateway
  • Security Monkey / Chaos Monkey
  • segregated database / Best practices
  • semantic gap / Domain-driven design
  • Sentry
    • about / Implementation gaps
    • features / Implementation gaps
  • server
    • monitoring / Monitoring a single service
  • service instance per host
    • about / Service instance per host
    • VM / Service instance per VM
    • container / Service instance per container
  • Service Signature / Signature tests
  • shared data pattern
    • about / Understanding the pattern
    • used, for data orchestration / Data orchestration
    • responses, consolidating / Consolidating responses
    • microservice communication / Microservice communication
    • storage sharing anti-pattern / Storage sharing anti-pattern
    • using, best practices / Best practices
    • testing / Testing
    • advantages / Pros and cons of the shared data pattern
    • disadvantages / Pros and cons of the shared data pattern
  • signature tests / Signature tests
  • single responsibility principle / Single responsibility principle
  • Single Sign-On (SSO) / Explicitly published interface, Single Sign-On
  • smart proxy / Smart proxy
  • SQLX
    • reference link / Golang ORMs
  • storage distribution
    • about / Storage distribution
    • data, depreciating / Depreciating data
    • data, regionalizing / Regionalizing data
  • storage sharing anti-pattern / Storage sharing anti-pattern
  • synchronization
    • automatic updating / Understanding CQRS
    • update possible state / Understanding CQRS
    • controlled update state / Understanding CQRS
    • update on demand state / Understanding CQRS

T

  • testify
    • reference link / Tests
  • throttling policies
    • for client / Throttling for your client
  • Transport Layer Security (TLS) / Web container

U

  • unit tests / Unit tests
  • UsersService
    • separating / Separating UsersService
    • Dockerfile, creating / Creating Dockerfile
    • containers, using / Using the containers
    • about / The public facing layer

V

  • Virtual Machine (VM) / Service instance per VM

W

  • web application caches
    • strategies / Caching strategies
    • applying / Applying cache
    • caching first strategy / Caching first
    • tasks, enqueuing / Enqueuing tasks
    • asynchronism / Asynchronism and workers
    • workers / Asynchronism and workers
  • web applications
    • endpoints / Endpoints for web applications
  • web container / Web container
  • WRK tool / WRK
lock icon The rest of the chapter is locked
arrow left Previous Section
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images