How to choose the right software architecture: The top 5 patterns (2023)

How many plots are there in Hollywood movies? Some critics say there are only five. How many ways can you structure a program? Right now, the majority of programs use one of five architectures.

Mark Richards is a Boston-based software architect who’s been thinking for more than 30 years about how data should flow through software. His new (free) book, Software Architecture Patterns,focuses on five architectures that are commonly used to organize software systems. The best way to plan new programs is to study them and understand their strengths and weaknesses.

In this article, I’ve distilled the five architectures into a quick reference of the strengths and weaknesses, as well as optimal use cases. Remember that you can use multiple patterns in a single system to optimize each section of code with the best architecture. Even though they call it computer science, it’s often an art.

Layered (n-tier) architecture

This approach is probably the most common because it is usually built around the database, and many applications in business naturally lend themselves to storing information in tables.

This is something of a self-fulfilling prophecy. Many of the biggest and best software frameworks—like Java EE, Drupal, and Express—were built with this structure in mind, so many of the applications built with them naturally come out in a layered architecture.

The code is arranged so the data enters the top layer and works its way down each layer until it reaches the bottom, which is usually a database. Along the way, each layer has a specific task, like checking the data for consistency or reformatting the values to keep them consistent. It’s common for different programmers to work independently on different layers.

How to choose the right software architecture: The top 5 patterns (1)

Image credit: Izhaki

The Model-View-Controller (MVC) structure, which is the standard software development approach offered by most of the popular web frameworks, is clearly a layered architecture. Just above the database is the model layer, which often contains business logic and information about the types of data in the database. At the top is the view layer, which is often CSS, JavaScript, and HTML with dynamic embedded code. In the middle, you have the controller, which has various rules and methods for transforming the data moving between the view and the model.

The advantage of a layered architecture is the separation of concerns, which means that each layer can focus solely on its role. This makes it:

  • Maintainable

  • Testable

  • Easy to assign separate "roles"

  • Easy to update and enhance layers separately

Proper layered architectures will have isolated layers that aren’t affected by certain changes in other layers, allowing for easier refactoring. This architecture can also contain additional open layers, like a service layer, that can be used to access shared services only in the business layer but also get bypassed for speed.

Slicing up the tasks and defining separate layers is the biggest challenge for the architect. When the requirements fit the pattern well, the layers will be easy to separate and assign to different programmers.

Caveats:

Best for:

  • New applications that need to be built quickly

  • Enterprise or business applications that need to mirror traditional IT departments and processes

  • Teams with inexperienced developers who don’t understand other architectures yet

  • Applications requiring strict maintainability and testability standards

Event-driven architecture

Many programs spend most of their time waiting for something to happen. This is especially true for computers that work directly with humans, but it’s also common in areas like networks. Sometimes there’s data that needs processing, and other times there isn’t.

The event-driven architecture helps manage this by building a central unit that accepts all data and then delegates it to the separate modules that handle the particular type. This handoff is said to generate an “event,” and it is delegated to the code assigned to that type.

Programming a web page with JavaScript involves writing the small modules that react to events like mouse clicks or keystrokes. The browser itself orchestrates all of the input and makes sure that only the right code sees the right events. Many different types of events are common in the browser, but the modules interact only with the events that concern them. This is very different from the layered architecture where all data will typically pass through all layers. Overall, event-driven architectures:

  • Are easily adaptable to complex, often chaotic environments

  • Scale easily

  • Are easily extendable when new event types appear

Caveats:

  • Testing can be complex if the modules can affect each other. While individual modules can be tested independently, the interactions between them can only be tested in a fully functioning system.

    (Video) 5 Design Patterns Every Engineer Should Know

  • Error handling can be difficult to structure, especially when several modules must handle the same events.

  • When modules fail, the central unit must have a backup plan.

  • Messaging overhead can slow down processing speed, especially when the central unit must buffer messages that arrive in bursts.

  • Developing a systemwide data structure for events can be complex when the events have very different needs.

  • Maintaining a transaction-based mechanism for consistency is difficult because the modules are so decoupled and independent.

Best for:

Microkernel architecture

Many applications have a core set of operations that are used again and again in different patterns that depend upon the data and the task at hand. The popular development tool Eclipse, for instance, will open files, annotate them, edit them, and start up background processors. The tool is famous for doing all of these jobs with Java code and then, when a button is pushed, compiling the code and running it.

In this case, the basic routines for displaying a file and editing it are part of the microkernel. The Java compiler is just an extra part that’s bolted on to support the basic features in the microkernel. Other programmers have extended Eclipse to develop code for other languages with other compilers. Many don’t even use the Java compiler, but they all use the same basic routines for editing and annotating files.

The extra features that are layered on top are often called plug-ins. Many call this extensible approach a plug-in architecture instead.

Richards likes to explain this with an example from the insurance business:“Claims processing is necessarily complex, but the actual steps are not. What makes it complex are all of the rules.”

The solution is to push some basic tasks—like asking for a name or checking on payment—into the microkernel. The different business units can then write plug-ins for the different types of claims by knitting together the rules with calls to the basic functions in the kernel.

Caveats:

  • Deciding what belongs in the microkernel is often an art. It ought to hold the code that’s used frequently.

  • The plug-ins must include a fair amount of handshaking code so the microkernel is aware that the plug-in is installed and ready to work.

  • Modifying the microkernel can be very difficult or even impossible once a number of plug-ins depend upon it. The only solution is to modify the plug-ins too.

    (Video) 10 Architecture Patterns Used In Enterprise Software Development Today

  • Choosing the right granularity for the kernel functions is difficult to do in advance but almost impossible to change later in the game.

Best for:

  • Tools used by a wide variety of people

  • Applications with a clear division between basic routines and higher order rules

  • Applications with a fixed set of core routines and a dynamic set of rules that must be updated frequently

Microservices architecture

Software can be like a baby elephant: It is cute and fun when it’s little, but once it gets big, it is difficult to steer and resistant to change. The microservice architecture is designed to help developers avoid letting their babies grow up to be unwieldy, monolithic, and inflexible. Instead of building one big program, the goal is to create a number of different tiny programs and then create a new little program every time someone wants to add a new feature. Think of a herd of guinea pigs.

via GIPHY

“If you go onto your iPad and look at Netflix’s UI, every single thing on that interface comes from a separate service,” points out Richards. The list of your favorites, the ratings you give to individual films, and the accounting information are all delivered in separate batches by separate services. It’s as if Netflix is a constellation of dozens of smaller websites that just happens to present itself as one service.

This approach is similar to the event-driven and microkernel approaches, but it’s used mainly when the different tasks are easily separated. In many cases, different tasks can require different amounts of processing and may vary in use. The servers delivering Netflix’s content get pushed much harder on Friday and Saturday nights, so they must be ready to scale up. The servers that track DVD returns, on the other hand, do the bulk of their work during the week, just after the post office delivers the day’s mail. By implementing these as separate services, the Netflix cloud can scale them up and down independently as demand changes.

Caveats:

Best for:

  • Websites with small components

  • Corporate data centers with well-defined boundaries

  • Rapidly developing new businesses and web applications

    (Video) Software Architecture | Architectural patterns | Architecture vs Design pattern

  • Development teams that are spread out, often across the globe

Space-based architecture

Many websites are built around a database, and they function well as long as the database is able to keep up with the load. But when usage peaks, and the database can’t keep up with the constant challenge of writing a log of the transactions, the entire website fails.

The space-based architecture is designed to avoid functional collapse under high load by splitting up both the processing and the storage between multiple servers. The data is spread out across the nodes just like the responsibility for servicing calls. Some architects use the more amorphous term “cloud architecture.” The name “space-based” refers to the “tuple space” of the users, which is cut up to partition the work between the nodes.“It’s all in-memory objects,” says Richards. “The space-based architecture supports things that have unpredictable spikes by eliminating the database.”

Storing the information in RAM makes many jobs much faster, and spreading out the storage with the processing can simplify many basic tasks. But the distributed architecture can make some types of analysis more complex. Computations that must be spread out across the entire data set—like finding an average or doing a statistical analysis—must be split up into subjobs, spread out across all of the nodes, and then aggregated when it’s done.

Caveats:

  • Transactional support is more difficult with RAM databases.

  • Generating enough load to test the system can be challenging, but the individual nodes can be tested independently.

  • Developing the expertise to cache the data for speed without corrupting multiple copies is difficult.

Best for:

  • High-volume data like click streams and user logs

  • Low-value data that can be lost occasionally without big consequences—in other words,not bank transactions

  • Social networks

These are Richards' big five. They may be just what you need. And if they’re not, the right solution could be a mixture of two. Or maybe even three. Be sure to download his book for free; it contains a lot more detail.If you can think of more, please let us know in the comments.

Image credit: Moose Winans

Keep learning

FAQs

What are the main architecture patterns? ›

Different Software Architecture Patterns :

Client-Server Pattern. Event-Driven Pattern. Microkernel Pattern. Microservices Pattern.

How can we use patterns in software architecture? ›

"The architectural pattern captures the design structures of various systems and elements of software so that they can be reused. During the process of writing software code, developers encounter similar problems multiple times within a project, within the company, and within their careers.

How do I choose the right software? ›

Seven steps for choosing the right software for your business
  1. Decide who needs to be involved in decision-making. ...
  2. Review your processes, prioritise your needs and set your budget. ...
  3. Do your research. ...
  4. Get the right advice. ...
  5. Select the software you want to demo or trial. ...
  6. Train your team. ...
  7. Communicate about new features and updates.
21 Jul 2021

What are the 4 elements that make up a software architectural style? ›

2.1 What Software Architecture Is and What It Isn't
  • The system consists of four elements.
  • Three of the elements- Prop Loss Model (MODP), Reverb Model (MODR), and Noise Model (MODN)-might have more in common with each other than with the fourth-Control Process (CP)-because they are positioned next to each other.

What are design patterns in software why they are having importance in choosing software architecture? ›

What are software architecture patterns? When writing software, engineers encounter many of the same problems over and over again. Because of this, design patterns have been defined that give engineers a reusable way to solve these commonly occurring problems.

What are the types of software design pattern? ›

Examples include user interface design patterns, information visualization, secure design, "secure usability", Web design and business model design. The annual Pattern Languages of Programming Conference proceedings include many examples of domain-specific patterns.

What are the 3 types of architectural design models in software engineering? ›

Software Architectural Models

Static type of architectural structural model represents the major system components. Dynamic type of architectural process model represents the process structure of the system. Distribution type of architectural model represents how the component is distributed across various computers.

What are the 5 basic architectural? ›

The American Institute of Architects (AIA) defines Five Phases of Architecture that are commonly referred to throughout the industry: Schematic Design, Design Development, Contract Documents, Bidding, Contract Administration.

What are the 5 elements of architecture? ›

'The Five Points of a New Architecture' (1927)
  • Pilotis. Replacement of ground floor supporting walls by a grid of reinforced concrete columns that bear the structural load is the basis of the new aesthetic.
  • The free design of the ground plan. ...
  • The free design of the façade. ...
  • Horizontal windows. ...
  • Roof garden.

What are the 5 major architectural drawings? ›

What is an architectural drawing?
  • Structural drawings.
  • Engineering drawings.
  • Shop drawings.
  • Technical drawings.
  • HVAC drawings.
  • Electrical and plumbing drawings.
3 May 2021

Why is pattern important in architecture? ›

Patterns offer the promise of helping the architect to identify combinations of Architecture and/or Solution Building Blocks (ABBs/SBBs) that have been proven to deliver effective solutions in the past, and may provide the basis for effective solutions in the future.

What are the 3 basic types of pattern development? ›

The three basic types are parallel-line development, radial-line development, and triangulation.

Why is it important to choose the right software? ›

An ideal software solution allows you to be able to alter different ways of operating, whether it be big or small, to allow the software to remain flexible to continuously support and improve your company's ways of operations.

Why is it important to choose the right application software? ›

Picking up the right application software for your specific needs improves function and efficiency. Understanding the different types of application software will help you save cost, time, and resources, enhance productivity, and improve decision-making.

What are the 5 Steps to software design? ›

At the most basic level, we employ five stages during the software design process: research, ideation, design, development and iteration. These five elements parallel the most basic questions of “who, what, when, where and how” that are needed to fully answer any set of questions.

What are the 5 key activities in an object oriented design process? ›

Today we will talk about the first step toward designing any system in an object-oriented manner.
  • Problem at Hand. ...
  • STEP 1: Requirement Analysis: ...
  • STEP 2: Define the Use Cases. ...
  • STEP 3: Identify the Actors. ...
  • STEP 4: Identify The Scenarios. ...
  • STEP 5: Use Case Diagram.
10 Jan 2021

How do you know which design pattern to use? ›

To use design patterns effectively you need to know the context in which each one works best. This context is : Participants — Classes involved. Quality attributes — usability, modifiability, reliability, performance.

What is a design pattern Why should use design patterns in software design? ›

In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn't a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.

What are the 5 types of pattern in art? ›

These types of patterns can be arranged in symmetric, asymmetric, geometric, organic, regular, or irregular sequences.

What are the five common types of data patterns? ›

What Are Data Trends and Patterns, and How Do They Impact Business Decisions?
  • Exponential Trend. This technique produces non-linear curved lines where the data rises or falls, not at a steady rate, but at a higher rate. ...
  • Damped Trend. ...
  • Seasonality. ...
  • Irregular/Random Patterns.
31 Jul 2018

Should I know all design patterns? ›

Design patterns are a toolkit of tried and tested solutions to common problems in software design. Even if you never encounter these problems, knowing patterns is still useful because it teaches you how to solve all sorts of problems using principles of object-oriented design.

What are the 4 types of models? ›

Let us look at the different types of Models in the Fashion World
  • Fashion (Editorial) Model. Fashion models are also called editorial models. ...
  • Fashion (Catalog) Model. ...
  • Commercial Model. ...
  • Mature Model. ...
  • Promotional Model. ...
  • Parts Model. ...
  • Fit Model. ...
  • Fitness Model.
24 Jul 2019

What are the 4 types of models in engineering? ›

Each of these fits within an overall classification of four main categories: physical models, schematic models, verbal models, and mathematical models.

What are the 4 types of system models? ›

Systems analysis. Hard systems modeling or operational research modeling. Soft system modeling. Process based system modeling.

What are 5 things an architect does? ›

10 Things an Architect Does For You
  • Provide a wealth of knowledge. ...
  • Design for you. ...
  • Offer Peace of Mind & Insurance. ...
  • Provides Project Administration. ...
  • Acts as Homeowner's Advocate. ...
  • Guide the Homeowner. ...
  • Gather bids. ...
  • Design with Topography and Landscape.
14 Oct 2013

Who formulated the 5 points of new architecture? ›

Le Corbusier's Five Points of Architecture is an architecture manifesto conceived by architect, Le Corbusier. It outlines five key principles of design that he considered to be the foundations of modern architectural discipline, which would be expressed though much of his designs.

What are the 3 rules of architecture? ›

Firmitas (Firmness, Durability) – It should stand up robustly and remain in good condition. Utilitas (Commodity, Utility) – It should be useful and function well for the people using it. Venustas (Delight, Beauty) – It should delight people and raise their spirits.

What are the principles of design 5? ›

Summary: The principles of scale, visual hierarchy, balance, contrast, and Gestalt not only create beautiful designs, but also increase usability when applied correctly.

What are the 5 elements of design and its meaning? ›

The elements of design are the fundamental aspects of any visual design which include shape, color, space, form, line, value, and texture. Graphic designers use the elements of design to create an image that can convey a certain mood, draw the eye in a certain direction, or evoke a number of feelings.

What are the 5 points of architecture that Le Corbusier proposed? ›

The design principles include the following five points by Le Corbusier: Pilotis (pillars), roof garden, open floor plan, long windows and open facades. Basically, Le Corbusier called for a radical change in architecture.

What are the 5 drawing tools? ›

Here are common drawing tools for many artistic careers:
  • Pens. Many drawing professions require an assortment of pens. ...
  • Pencils. Drawing professionals often use pencils to create different types of artwork. ...
  • Pencil sharpener. ...
  • Paper. ...
  • Ruler. ...
  • Stencil. ...
  • Pencil case or pouch. ...
  • Drawing compass.
11 Mar 2022

What are the 4 most common architectural scales? ›

It is a matter of representing the object in smaller measures than those presented in reality. It is the most used scale of representation in architecture, and some of the most used are 1:5, 1:10, 1:20, 1:50, 1:100, 1:200, 1:500, 1:1000, 1:2000 and 1:50000.

What makes a good pattern design? ›

Make sure your design is balanced

Balance within a design can be considered in many ways including: Colour- making sure your colours are well balanced and work together. Texture- make sure your choice of textures work together. Layout- choose a layout that works with the motifs you are using and desired outcome.

What is a design pattern and why are they important? ›

The design pattern is an essential element in object-oriented programming. It is a software infrastructure made up of a small number of classes that is used to solve a technical problem.

What is the most popular pattern? ›

Checkered. One of the most popular and instantly recognizable patterns on the market, checked or checkered, fabrics feature a simple checkerboard-style design with alternating colored squares.

Why are pattern important and why do we need to study them? ›

Patterns provide a sense of order in what might otherwise appear chaotic. Researchers have found that understanding and being able to identify recurring patterns allow us to make educated guesses, assumptions, and hypothesis; it helps us develop important skills of critical thinking and logic.

What are the 4 steps in drafting pattern? ›

We'll cover the simple 4-step process for pattern drafting:
  1. Measurement. Taking the proper measurements to build a pattern.
  2. Detailing. Creating dIfferent collar types, specifically for T-shirts.
  3. Materials. Selecting materials for a desired fit.
  4. Paper Drafting. Drafting the paper pattern.

What are 3 examples of a pattern? ›

Even numbers pattern -: 2, 4, 6, 8, 10, 1, 14, 16, 18, … Odd numbers pattern -: 3, 5, 7, 9, 11, 13, 15, 17, 19, … Fibonacci numbers pattern -: 1, 1, 2, 3, 5, 8 ,13, 21, … and so on.

What are the criteria of choosing architecture? ›

The client selects an architect on the basis of reputation, personal acquaintance or the recommendation of a friend, former client or another architect. Sometimes, institutions maintain a roster of architects, and they select a different practice for each project by using a rotation system.

What are the features of a good software architecture? ›

A software architecture influences team structure. A software architecture focuses on significant elements. A software architecture captures early design decisions.
...
Operational Architecture Characteristics :
  • Availability.
  • Performance.
  • Reliability.
  • Low fault tolerance.
  • Scalability.
24 Nov 2021

What do you think are 3 qualities of a good software developer? ›

Scalable Path founder Damien Filiatrault has identified 7 qualities that will mark you out as a great programmer.
  • Positive Attitude. A great programmer is ambitious and eager to do their best. ...
  • Good Communication Skills. ...
  • Time and Task Management. ...
  • Quick Learning. ...
  • Technical Experience. ...
  • A Good Team Player. ...
  • End-User Focus.
17 Jun 2021

What are the 3 important elements of architecture? ›

Writing near the end of the first century B.C.E., Roman architect Vitruvius Pollio identified three elements necessary for a well-designed building: firmitas, utilitas, and venustas.

What are the 5 main design factors? ›

To help you on your way, we've put together a list of 7 important factors to be aware of when designing a product.
  • AESTHETICS. ...
  • ERGONOMICS. ...
  • MATERIALS. ...
  • MANUFACTURE. ...
  • MODULARITY. ...
  • SUSTAINABILITY. ...
  • PROTECTION. ...
  • PACKAGING & ASSEMBLY.

What are the five qualities of good software? ›

The common requirements that all software applications must satisfy to be successful: user experience, availability, performance, scalability, adaptability, security, and economy. All seven qualities are important, but if you get the user experience (UX) wrong, nothing else matters.

What is the importance of software architecture pattern? ›

Software architecture patterns allow for higher levels of quality to be achieved while still maintaining efficiency. There is also no one-size-fits-all architecture that can be applied to every project.

What is important for software architecture? ›

A software architect makes important decisions regarding the software that goes on to define its overall integrity. A good software architecture helps define attributes such as performance, quality, scalability, maintainability, manageability, and usability.

What are the important element of software architecture? ›

Software architecture looks at important elements like structural elements and their interfaces, the behavior and collaboration of those elements, compositions of the elements within the larger system, how the architectural decisions help meet business objectives, and whether the styles will guide the organization.

What are the most important factors to consider when designing software? ›

These factors are: the type and size of the software, the experience of use for reference to predecessors, difficulty level to obtain users' needs, development techniques and tools, situation of development team, development risks, the software development methods that can be chosen.

What are the most important characteristics of software features best answer? ›

Six of the most important quality characteristics are maintainability, correctness, reusability, reliability, portability, and efficiency.

What are the 3 requirements of software? ›

There are three types of software requirements:- functional requirements, non-functional requirements, and domain requirements.

Videos

1. Getting the Basics - Software Architecture Introduction (part 1)
(A Dev' Story)
2. 10 Design Patterns Explained in 10 Minutes
(Fireship)
3. Top Software Architecture Patterns
(The Coder Kid & Mr Miyagi Show)
4. Design Patterns in Plain English | Mosh Hamedani
(Programming with Mosh)
5. Why you should think about SOFTWARE ARCHITECTURE in Python 💡
(ArjanCodes)
6. How to choose what architecture and design pattern to use from Microsoft Azure
(Blazor, .NET, C#, Azure & Unity 3d)
Top Articles
Latest Posts
Article information

Author: Carlyn Walter

Last Updated: 03/11/2023

Views: 5285

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.