Cloud Design Patterns. Design and implementation patterns: Part 2
Pipes and Filters
The Pipes and Filters pattern allows breaking down a complex processing task into a collection of smaller, independent, and reusable components (filters) interconnected by channels (pipes). Filters are typically stateless and execute specific processing tasks on the data, while pipes serve as communication channels connecting the output of one filter to the input of another.
The following diagram depicts an architectural scenario in which two data sources supply data to two distinct modules for processing. The processed data from these modules is directed to the sink endpoint. Although the modules share functionally similar tasks, they were independently designed, and the code implementing these tasks is tightly coupled within each module.
This can be decomposed into a set of distinct components, each carrying out a specific task. Subsequently, these filters can be assembled in a pipeline to leverage component reuse and avoid code duplication.
Advantages:
Challenges:
Strangler Fig
Over the time, as new functionally is added to the existing system, the system architecture can become very complex and difficult to extend and maintain.
The main idea of the Strangler Fig pattern is to build up a new system by gradually migrating the functionality of the legacy system. It's named after a type of tree that grows on others and eventually overtakes and replaces them.
The pattern implementation typically involves the following steps:
Advantages:
Challenges:
Leader Election
The Leader Election pattern serves as a distributed computing strategy in which a group of instances elects one of them as the leader for managing and coordinating the actions of the group. This ensures that the instances work together smoothly, avoiding conflicts, resource disputes, and disruptions. Usually, if the leader fails, a new one is elected to take over this responsibility.
This pattern is fundamental in various distributed systems. For example in a distributed database system, the leader may be responsible for managing distributed locks, coordinating transactions and ensuring data consistency. The leader can prevent conflicts by deciding which nodes are allowed to make changes to the database at a given time.
Another example is load balancing on Clustered Web Servers, where the leader is responsible for distributing the incoming requests evenly among the servers.
Advantages:
Challenges:
Static Content Hosting
The Static Content Hosting pattern segregates the static content like multimedia, HTML, CSS, downloadable documents and other assets from dynamic content by strategically distributing it across multiple geographic locations to ensure optimized and swift access.
In typical cloud hosting environments the application's assets and static content can be easily persisted behind a storage service. The storage service would handle requests for these resources and help minimizing the content loading time. Additionally, this can help in reducing the hosting expenses for websites and applications that contain same static resources. One well known example of implementing this pattern is the Content Delivery Network (CDN).
Advantages:
Challenges:
Recommended by LinkedIn
Gateway Aggregation
Frequent communication between the client and the backend can negatively impact the overall performance and scalability of the application. Microservice architectures exacerbate this problem because applications made up of many smaller services inherently require more inter-service calls.
The gateway aggregation pattern utilizes a gateway to combine multiple separate requests into a unified request when a client needs to initiate multiple calls to different backend systems to perform a specific operation.
The gateway serves as a single entry point for the application to interact with the backend services. It acts as a reverse proxy, receiving incoming requests from the application and forwarding them to the appropriate backend services. It combines the data and responses from these backend services into a single response and sends it back to the application. This aggregation may include combining data from services, filtering, or composing responses to fulfill the client's request.
Advantages:
Challenges:
Gateway Routing
The Gateway Routing pattern allows directing requests to multiple services or instances through a single endpoint. It can help in scenarios where clients need to interact with multiple services or multiple instances of a service, or multiple versions of the same service. Frequent changes to any of these will correspondingly result in frequent client updates.
Implementing a gateway in front of applications, services, or deployments by utilize application layer routing will help to direct requests to the appropriate instances. This allows clients to communicate with a single endpoint, simplifying client applications and mitigating the need for constant updates when changes occur.
Advantages:
Challenges:
External Configuration Store
Many application runtimes contain application configurations files. Any configuration changes required after the deployment will require redeploying the application that can result in downtime and operational overheads.
The External Configuration Store pattern is used to manage application configuration settings outside of application code in distributed systems where applications are often deployed across multiple environments and need to be configured dynamically without redeployment.
Advantages:
Challenges:
Gateway Offloading
Common cross-cutting concerns such as logging/monitoring, rate limiting, certificate management, authentication/authorization and etc. can be challenging to implement and manage across large numbers of deployments.
Gateway Offloading pattern offers offloading certain tasks or responsibilities from the core services to a specialized gateway proxy component.
Advantages:
Challenges:
#clouddesigpatterns #cloudcomputing #designpatterns #distributedsystems #computernetworking #networking #network #systemdesign #PipesAndFilters #StranglerFig #LeaderElection #StaticContentHosting #GatewayAggregation #GatewayRouting #ExternalConfigurationStore #GatewayOffloading