Skip to main content

Posts

Showing posts with the label softwaredesign

Cross-Cutting Concern Patterns

Topic: Software Design                                                                                                        Level: Intermediate Cross-Cutting Concern Patterns - What? A concern that is applicable throughout the application of microservices that supplies a generic unified characterisation of functionality 1. External Configuration Application services often need to define configuration information related to database connectivity, logging, timeouts, port configs, external endpoints, queue connection properties, management endpoints etc., that would co-exist with the packaged/shipped application for deployment. Such configuration management setup introduces sophistication when there is a change in a configuration property, the associated application has to be recompiled, repackaged and redeployed leading to downtime and coordination overheads. Additionally violating the DRY (Don't Repeat Yourself) principle if multiple services use the same configuration properties

Observability Patterns

Topic: Software Design                                                                                                        Level: Intermediate Observability Patterns - What? Logging, Tracing, and Monitoring of multiple instances of distributed services across numerous servers 1. Log Aggregation With a microservices design paradigm, the application can have multiple services designated for fulfilling user requests in a discrete, loosely coupled manner isolated in their process boundaries. There may also be numerous instances of the service running facilitating load balancing and scaling on additional machines based on the demand.  As the services involved process the request it simultaneously generates log statements (information, warning, error, debug) related to its logic processing with a specified format directed to a defined log file. Log aggregation is responsible for consolidating the logs spanning across multiple instances onto a centralized service, such that we might be abl

Database Patterns

Topic: Software Design                                                                                                        Level: Intermediate Database Patterns - What? Given that microservices by nature are decoupled in design and isolated in functional service tasks, such that facilitating data access/update requirements across the distributed services while maintaining the ACID (Atomic, Consistent, Isolated and Durable) properties of the transactions involved.  The atomicity ensures that all or none of the steps of a transaction should complete. Consistency takes data from one valid state to another valid state. Isolation guarantees that concurrent transactions should produce the same result that sequentially transactions would have produced. Lastly, durability means that committed transactions remain committed irrespective of any type of system failure.  In a distributed transaction scenario, as the transaction spans several services, ensuring ACID always remains key. 1. Databas

Integration Patterns - Part Two

   Topic: Software Design                                                                                                        Level: Intermediate Integration Patterns - What? Coordinating, intercommunicating, interfacing and converging the functionalities across the distributed service APIs 1. Chained Microservice Pattern In the process of constructing a response to the client request, a sole microservice alone would not be able to collate/compose all the necessary data, assuming that the certain dependent functionality is isolated and distributed across multiple services by each level of business capabilities (unless it follows Aggregator Pattern that orchestrates concurrent responses for the request sent in parallel to all the underlying services). The pattern in which, assembling a response involves traversing multiple services sequentially, such that any of the consulted services assumes the role of orchestrating the  composition of the data for response thus forming chained flo

Integration Patterns - Part One

  Topic: Software Design                                                                                                        Level: Intermediate Integration Patterns - What? Coordinating, intercommunicating, interfacing and converging the functionalities across the distributed service APIs 1. API Gateway Pattern The API gateway is a service that acts as a single entry point interceptor facade in redirecting and routing incoming client requests to multiple distributed services. Residing in between the client application and the microservices it internally maps the incoming requests to the relevant services, by providing features such as  Reverse proxy Requests aggregation Routing requests Protocol abstraction (REST, gRPC, AMQP, etc.,)  and other cross-cutting features like Authentication Authorization policies Response caching Service discovery Retry policies Load-balancing Rate-limiting Throttling IP whitelisting,  Request transformations Circuit breaker  implementation for the serv

Decomposition Patterns - Part Two

Topic: Software Design                                                                                                        Level: Intermediate Decomposition Patterns - What? Breaking down the architectural design with respect to a defined context 1. Strangler Pattern Extracting a specific functional component from the application into an independent service component, then an intermediary facade is placed for routing the request traffic in tandem to both the legacy (for facilitating the functionality that is still not extracted) and the new component (for conducting the migrated functionality), and upon correctness completely decommissioning the functionality from the legacy design (by which strangling the primary application by component elimination). Thereby gradually and iteratively, achieving a microservice design transformation by decoupling the functionality. Eliminates complete big-bang migration risk. At a high-level overview, the Strangler pattern is developed in the below