Software Architecture Patterns

Software Architecture Patterns

Thinking how the enterprise systems are designed? Well, you are with me.

Let's begin..

We have to identify the suitable architecture that will provide us the design and functionality with quality attributes before we start any major software development.

According to Wikipedia,

An?architectural pattern?is a general, reusable solution to a commonly occurring problem in?software architecture?within a given context.

Here we are going to do high-level understanding of the following most important architecture patterns:

  • Layered
  • Client-Server
  • Pipe-Filter
  • Model View Control
  • Event Bus
  • Microservices Architecture
  • Broker
  • Peer-to-Peer
  • Blackboard


Layered Pattern:

No alt text provided for this image

It is also known as N-Tier architecture. In here, software is divided into units called layers.

This usually contains 4 different as follows:

  1. Presentation Layer
  2. Application Layer
  3. Business Logic Layer
  4. Data Access Layer

Usually, this pattern used in desktop and simple web applications.

Many of my projects have been developed in this pattern.


Client-Server Pattern:

No alt text provided for this image

Typical real world use cases of this pattern include online applications such as email, document sharing and banking.

Server provides the service and the client consumes it.?

Usually server has a huge computing power but bound to a limit. There are chances that the server may crash or stop responding when the traffic overwhelming.

This happens to web apps hosted with cloud and on-premises as well.


Pipe-Filter Pattern:

No alt text provided for this image

It divides a larger processing task into a sequence of smaller independent processing steps or filters that are connected by channels or pipes.

Stream of complex messages into a stream of unique simple plain text order messages without additional data fields.

This pattern often used in compliers where the consecutive filters perform lexical analysis parsing semantic analysis and code generation.


Model View Controller Pattern:

No alt text provided for this image

It separates the application functionality into three kinds of components

  • Model which contains the core functionality and data
  • View which displays the information to user where more than one view may be defined
  • Controller which handles the input from the user

?Commonly used in web frameworks such as?ASP.NET, Django.


Event Bus Pattern:

No alt text provided for this image

The modern enterprise software is often built as a distributed system that can service asynchronously arriving messages associated with high volume of events.

?It has 4 major components:

  1. Event Source (Publisher)
  2. Event Listener (Subscriber)
  3. Channel
  4. Event Bus

Typically used in mobile development, e-commerce apps and notification services.


Microservices Architecture Pattern:

No alt text provided for this image

The modern enterprise apps are required to support a variety of browsers and native mobile clients. These days the applications usually handle client requests by executing business logic, accessing a database, exchanging messages with other systems and returning responses.

In this regard monolithic applications can become too large and complex for efficient support and deployment.

The solution is to build applications as microservices, each services is independently deployable and scalable and has its own API boundary.

Different services can be written in different programming languages and manage their own database and developed by different teams.

Many use cases area applicable for a microservices architecture especially those that involve an extensive data pipeline.


Broker Pattern:

No alt text provided for this image

It is used to structure distributed systems with decoupled components. These components can interact with each other by remote service invocations.

A broker component is responsible for the coordination of communication among components.

Servers publish their capabilities to a broker, clients request a service from the broker and the broker then redirects the client to a suitable service from its registry.

Broker pattern allows for dynamic change, addition, deletion and relocation of objects and it makes distribution transparent to the developer, however among the disadvantages of the broker pattern is that it requires standardization of service descriptions.

This pattern is often used in the message broker software such as Apache Kafka, RabbitMQ.


Peer-to-Peer Pattern:

No alt text provided for this image

Peer may act as a client or as a server or as both and it can change its role dynamically with time.

The peer-to-peer pattern supports decentralized computing and is highly robust in the failure of any given node besides it is highly scalable in terms of resources and computing power however there is no guarantee about quality of service as nodes cooperate voluntarily. On top of that, security is difficult to ensure and the system performance often depends on the number of nodes.

This pattern is used in file sharing networks such as Gnutella (system for sharing files) and G2 (Managed File Transfer).

Multimedia protocols such as P2PTV and PDTP as well as in Cryptocurrency based products.

A quick understanding of Gnutella Architecture:

  • Users place the files they want to share on their hard disks and make them available to everyone else for downloading in?peer-to-peer?fashion.
  • Users run a piece of?Gnutella software?to connect to the Gnutella network.
  • There is no central database that knows all of the files available on the Gnutella network. Instead, all of the machines on the network tell each other about available files using a distributed query approach.
  • There are many different client applications available to access the Gnutella network.


Blackboard Pattern:

No alt text provided for this image

This pattern is useful for problems for which no deterministic solution strategies are known.

The Blackboard pattern consists of three main components:

  1. Blackboard which is a structured global memory containing objects from the solution space.
  2. Knowledge Source which is specialized module with their own representation.
  3. Control Component which selects configures and executes modules.

All the components have access to the blackboard.

Components may produce new data objects that are added to the blackboard.

Components look for particular kinds of data on the blackboard and may find these by pattern matching with the existing knowledge source.

The advantage of using this pattern is the extending the structure of the data space is easy however modifying the structure of the data space is hard as all applications are affected.

This pattern is often used in speech recognition, protein structure identification and robotics.

Alright, enough!

The complete understanding of all these architecture patterns help to decide which to choose based on the technical requirements and nature of business domain.

? Keep learning and keep sharing! ?

要查看或添加评论,请登录

Senthil Kumaran的更多文章

  • SMS Segments Calculator

    SMS Segments Calculator

    We use 3rd party services like Twilio, Infobip, etc. to delivery SMS messages to end-user.

    1 条评论
  • Creating Excel Spreadsheet in .NET using DocumentFormat.OpenXML

    Creating Excel Spreadsheet in .NET using DocumentFormat.OpenXML

    We have few ways to create Microsoft Excel spreadsheet. Here we are going to discuss about creating using the…

  • Tools I use to make better me!

    Tools I use to make better me!

    I would like to express my ways to learning, in this journey, I share here the tools I use for my knowledge management.…

  • Quick intro to CQRS and Eventual Consitency

    Quick intro to CQRS and Eventual Consitency

    CQRS - Command Query Responsibility Segregation The command (insert/update/delete) commit the data in to the database…

  • Circuit Breaker Pattern

    Circuit Breaker Pattern

    The failures are usually categorized into 3 types: Immediate failure Timeout failure Cascading failure The response is…

  • Implementing Health Check for your application

    Implementing Health Check for your application

    Here we are going to see about the health check for an application, especially why it is required and how it is useful.…

  • Secure .Net Core API calling from Twilio using Signature

    Secure .Net Core API calling from Twilio using Signature

    The requirement here is to secure the API developed in .Net Core 3.

  • AWS DynamoDB with .Net Core

    AWS DynamoDB with .Net Core

    In this blog, we are going to connect & query DynamoDB using .Net Core 3.

    3 条评论
  • AWS CDK with .Net Core

    AWS CDK with .Net Core

    CDK helps to build the cloud application with our convenient programming language and produce IaC (Infrastructure as…

    2 条评论
  • Setup MongoDB in Docker (Linux Container) on Windows 10 with Volume Mapping

    Setup MongoDB in Docker (Linux Container) on Windows 10 with Volume Mapping

    Let's see how to setup MongoDB in Docker on Windows 10 using Linux container. Let's pull the latest MongoDB image…

    5 条评论

社区洞察

其他会员也浏览了