Saga Pattern It manages distributed transactions across microservices by coordinating a series of local transactions. Each service executes its transaction and triggers the next via events, with compensating actions undoing changes if a failure occurs.
Ensures consistency in multi-service workflows, such as order processing involving payment, inventory and shipping. Provides fault tolerance by rolling back previous steps through compensating transactions when any step fails. Implementation:
Choreography-Based Approach (Event-Driven): There is no central coordinator.
Helm is an open source package manager for Kubernetes. It provides the ability to provide, share, and use software built for Kubernetes.
Key concepts A Chart is a Helm package. It contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster. Think of it like the Kubernetes equivalent of a Homebrew formula, an Apt dpkg, or a Yum RPM file. It uses a templating engine to make the YAML files dynamic.
Scaling Patterns Horizontal Scaling Pattern Horizontal Scaling or “scaling out,” involves adding more instances of a microservice to distribute the load. This pattern improves the system’s ability to handle increased traffic and provides better fault tolerance. Instances can be added or removed dynamically based on the current load, which is particularly effective in cloud environments where resources can be provisioned on demand. Vertical Scaling Pattern Vertical Scaling or “scaling up,” involves adding more resources (CPU, memory) to an existing microservice instance.
Deployment Patterns Multiple Service Instances per Host Pattern Deploy multiple instances of different microservices on a single host, whether it’s a virtual machine or a physical server By sharing the same host, this pattern maximizes resource utilization, reducing the cost and overhead associated with running multiple separate hosts However, it requires careful resource management to ensure that the services do not compete for the same resources, potentially leading to performance bottlenecks.
Event Sourcing Pattern It stores all changes to application state as a sequence of events rather than only saving the current state. This enables reconstruction of past states and provides a reliable audit trail.
Supports full history tracking and auditing, useful for compliance and debugging. Ideal for financial systems where transactions and account histories must be reconstructed accurately. Key concepts:
The Aggregate Root: In microservices, the “Aggregate” is the consistency boundary.