Software Architecture Patterns - 1

Software Architecture Patterns - 1

Last week I was part of a discussion where I was supposed to know about the possible architectural patterns that exists. However, I didn’t have any clue and felt very bad about it. Considering our inclinations towards learning newer technologies we forget the core crux of how enterprise scale systems are designed.

I am sure many of us nowadays are still confused about the difference between architecture patterns or don’t even know much about it. So here in this series we will talk about various architectural patterns with their usage, pros and cons.

Layered Architecture

No alt text provided for this image

The most common architecture pattern is the layered architecture or known as the n-tier architecture. It is widely known by most software architects, designers, developers. Although, there are no specific restrictions in terms of the number and type of layers that must exist, most layered architecture consists of four tiers:

1.     Presentation layer (also known as UI layer)

2.     Application layer (also known as service layer)

3.     Business logic layer (also known as domain layer)

4.     Data access layer (also known as persistence layer)

The idea is that the user initiates a piece of code in the presentation layer by performing some action (e.g. clicking a button). The presentation layer then calls the underlying layer, i.e. the application layer. Then we go into the business layer and finally, the persistence layer stores everything in the database. So higher layers are dependent upon and make calls to the lower layers.

No alt text provided for this image

Pros:

Each of the layers has a specific role and responsibility. Modular design can be developed and evolved separately with little interaction among the parts, supporting portability, modifiability, and reuse.

For example, the presentation layer would be responsible for handling all UI. Because this separation of concerns within the layered architecture makes it easy to build effective roles and responsibility.

Cons:

Layers contribute to a performance penalty. The pattern does not lend itself to high-performance applications because it is not efficient to go through multiple layers of the architecture to fulfill a business request. The addition of layers also adds up-front cost and complexity to a system.

Usability:

Layered architecture is widely used for numerous reasons. You can consider it under the following scenarios/requirements:

  • When you aim to design an application quickly with fewer developers.
  • Applications that primarily require maintainability and separation of concerns as their pillars of architecture.
  • Enterprise applications that need to adopt traditional IT structures and processes

In the next part of this article we will discuss about Event-Driven Architecture Pattern

To view or add a comment, sign in

More articles by Kapil Uthra

Others also viewed

Explore content categories