Software Architectural Patterns in a nutshell

Nuwan Zen
3 min readFeb 28, 2021

An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture, similar to software design pattern but have a broader scope.

Photo by Gaelan Andrade Booker on Unsplash

Layered pattern

Application is splittered horizontally into layers so that a request from request to database will go through all the layers.

  • Presentation layer (also known as UI layer)
  • Application layer (also known as service layer)
  • Business logic layer (also known as domain layer)
  • Data access layer (also known as persistence layer)

Client-server pattern

This pattern consists of two parties; a server and multiple clients. The server component will provide services to multiple client components.

Master-slave pattern

This pattern consists of master and slaves. The master component distributes the work among identical slave components, and computes a final result from the results which the slaves return. Ex: DB replication.

Pipe-filter pattern

This pattern can be used to process a stream of data. processing is enclosed within a filter component. Data is passed through pipes for buffering or for synchronization purposes.

Broker pattern

A broker component is responsible for the coordination of communication among components in distributed systems with decoupled components. Ex: Kafka

Peer-to-peer pattern

In this pattern, individual components are known as peers. Peers may function both as a client, requesting services from other peers, and as a server, providing services to other peers. Ex: Torrent, blockchain

Event-bus pattern

This pattern primarily deals with events and has 4 major components; event source, event listener, channel and event bus. Sources publish messages to particular channels on an event bus. Listeners subscribe to particular channels. Listeners are notified of messages that are published to a channel to which they have subscribed before.

Model-view-controller pattern (MVC)

Divides an interactive application in to 3 parts as,

  1. model — contains the core functionality and data
  2. view — displays the information to the user
  3. controller — handles the input from the user

This separates internal representations of information from the presentation. It decouples components and allows efficient code reuse.

Blackboard pattern

This pattern is useful for problems which has no deterministic solution strategies. It has 3 main components.

  • blackboard — a structured global memory containing objects from the solution space
  • knowledge source — specialized modules with their own representation
  • control component — selects, configures and executes modules.

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. Ex: Speech recognition.

Interpreter pattern

This pattern is used for designing a component that interprets programs written in a dedicated language. It mainly specifies how to evaluate lines of programs, known as sentences or expressions written in a particular language. Ex: SQL

Ref:

Read my other blogs:

--

--

Nuwan Zen

Sometimes A software Engineer, sometimes a support engineer, sometimes a devops engineer, sometimes a cloud engineer :D That’s how the this life goes!