Understanding Software Architecture Patterns: A Summary of Monolithic, Layered, Microservices, and Serverless Architectures

Debashis Kar Suvra
5 min readMar 6, 2023

--

Many of us get confused with software UI patterns, design patterns, and software architecture. They are related but distinct concepts in software development. In this article, I will try to summarize the book called “Software Architecture Patterns” by Mark Richards and discuss some of my research.

Layered Architecture: This pattern involves dividing the software into layers that are responsible for specific tasks. The layers are arranged in a hierarchical order, with each layer depending on the layer below it. This pattern is commonly used in enterprise applications. This pattern is commonly used in enterprise applications such as banking systems, where there are multiple layers responsible for different tasks.

Layered Architecture

For example, the presentation layer handles the user interface and input validation, the application layer handles business logic, and the data layer handles data storage and retrieval. It is also known as n-tier architecture.

Event-Driven Architecture: This pattern involves sending and receiving messages between different software components in response to events. This pattern is commonly used in systems that need to be highly responsive and scalable. This pattern is commonly used in systems that need to be highly responsive and scalable, such as e-commerce sites or social media platforms.

Event-Driven Architecture

For example, a social media platform might use an event-driven architecture to handle user interactions such as posting comments or liking posts. When a user posts a comment, an event is triggered that updates the post and notifies other users who are subscribed to the post.

Microkernel Architecture: This pattern involves separating the core functionality of a software system into a set of independent modules. This allows the system to be more flexible and scalable, as each module can be developed and deployed independently. This pattern is commonly used in large, complex systems such as airline reservation systems or hospital management systems.

Microkernel Architecture

For example, an airline reservation system might use a microkernel architecture to separate different modules such as booking, inventory management, and ticketing. Each module can be developed and deployed independently, which makes the system more flexible and scalable.

Hexagonal Architecture: This pattern involves separating the core business logic of a software system from its input and output channels. This allows the system to be more flexible and easier to maintain. This pattern is commonly used in systems that need to be highly adaptable and maintainable, such as financial systems or insurance systems.

For example, a financial system might use a hexagonal architecture to separate the core business logic from the user interface and data storage. This allows the system to be easily modified or extended without affecting the core business logic.

Domain-Driven Design: This pattern involves modeling a software system around the domain it serves. This helps to ensure that the software is closely aligned with the needs of its users. This pattern is commonly used in systems that need to closely align with the needs of their users, such as healthcare systems or education systems. For example, a healthcare system might use domain-driven design to model the system around patient care, with different modules for patient records, medical procedures, and prescription management. This helps to ensure that the system meets the needs of both patients and healthcare providers.

Apart from these architectures, that Richards has mentioned there are also some others. Let’s discuss this.

Monolith: The entire software system is designed as a single, self-contained unit. In this architecture, all components of the application, including the user interface, business logic, and data access layers, are tightly coupled and integrated into a single codebase. In a monolithic architecture, any changes or updates to the system require a complete redeployment of the entire application. This can make it difficult to scale the system and can lead to long deployment times.

Despite these limitations, monolithic architectures have some advantages. They are generally simpler to develop and maintain, as all code is in one place, and they can be easier to test and debug. Monoliths can also be a good choice for smaller applications with limited complexity.

Serverless: Serverless architecture, also known as Function-as-a-Service (FaaS), involves building applications by breaking them down into small, independent functions that can be deployed and run on a cloud-based platform like AWS, or GCP. In a serverless architecture, developers do not need to worry about managing servers, as the cloud provider takes care of scaling, maintenance, and security. The serverless architecture pattern has several benefits, including reduced infrastructure costs, improved scalability, and increased development agility. However, it also has some limitations, such as potential performance issues and vendor lock-in. Examples of serverless architectures include AWS Lambda, Azure Functions, and Google Cloud Functions. Serverless architecture is commonly used for building microservices, event-driven applications, and serverless web applications.

While both serverless and microservices architecture involves breaking down applications into smaller components, the main difference between them is in the way they are deployed and managed. In microservices architecture, each service is deployed and managed separately, often using containerization technologies such as Docker. In serverless architecture, the functions are deployed and managed by the cloud provider, and developers only need to focus on writing the code for the functions

On the other hand, UI patterns are MVC(Model View Controller), MVT (Model View Template- Django pattern), and MVVM (Model-View-ViewModel). Design patterns are Structural patterns, Behavioral patterns,, Creational etc. I have separate article on design patterns.

If you have enjoyed this article and would like to buy me a coffee ☕️follow this buymeacoffee.com/suvra.

References:

  1. “Software Architecture Patterns” by Mark Richards.
  2. https://www.jianshu.com/p/f4dd7a3354b1
  3. https://appinventiv.com/wp-content/uploads/sites/1/2022/05/How-does-serverless-work.webp
  4. Software Architecture Patterns by Peter Morlin

--

--

Debashis Kar Suvra
Debashis Kar Suvra

Written by Debashis Kar Suvra

Problem Solving || Passionate Software Engineer || Leadership || ML & Data Science enthusiast || Explorer

Responses (1)