Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 1

Frontend Architecture: Key Quality Attributes

Recommended resources

Hello! Welcome to your first lesson in the Frontend System Design course. We're starting at the very foundation of architectural thinking. This lesson will explore what makes a frontend architecture "good" by identifying the key quality attributes that guide our decisions. You'll learn to think not just about what an application does, but how it does it in terms of performance, scalability, maintainability, and reliability. Mastering this mindset is the first step toward your goal of designing robust, large-scale frontend systems.

Instead of searching for a single "best" way to build software, we will focus on understanding the context and making deliberate trade-offs. Let's begin by defining what we mean by software architecture.

What Is Frontend Architecture?

At its core, software architecture is about the most significant design decisions—the ones that are fundamental to the system and costly to change later. It's less about the specific implementation details of a single component and more about the overall structure and how the different parts of the system fit together.

To understand what drives these big decisions, it's helpful to watch a short clip that distinguishes between what a system does (its features) and how it behaves (its qualities).

Getting the Basics - Software Architecture Introduction (part 1)

In the video "Getting the Basics - Software Architecture Introduction," the creator introduces the core concepts of software architecture.

Please watch from the beginning until the explanation of functional vs. non-functional requirements. Pay close attention to the introduction of the "-ilities" as these are the quality attributes we'll be focusing on.

As the video explains, we have two types of requirements:

  • Functional Requirements: These define the specific behaviors or functions of the system. For an e-commerce site, this would be things like "a user can search for products" or "a user can add an item to the cart."
  • Non-Functional Requirements (or Quality Attributes): These describe the qualities or characteristics of the system. They define how the system should perform its functions. Examples include how fast the page loads (performance), how easy it is to add new features (maintainability), or whether the system can handle a sudden spike in traffic (scalability).

These quality attributes are the primary architectural drivers. They are the forces that influence and shape our architectural decisions.

This mind map illustrates the core pillars of frontend architecture. Our focus today is on the "Architecture Characteristics," which are the quality attributes that drive our decisions.

This mind map illustrates the core pillars of frontend architecture. Our focus today is on the "Architecture Characteristics," which are the quality attributes that drive our decisions.


Key Quality Attributes in Frontend Architecture

While there are many quality attributes, we will concentrate on four of the most critical ones in frontend development: performance, scalability, maintainability, and reliability. Understanding them is essential, but the real skill lies in understanding the trade-offs between them.

A great starting point is to see a list of common characteristics. The following article provides a concise overview.

Frontend Architecture Cheat Sheet - Tom Tech Talks

This cheat sheet from Tom Tech Talks gives a quick rundown of several important architectural characteristics.

Please read the section titled "Architecture characteristics". This will give you a solid list of definitions for the attributes we are about to discuss in more detail.

Now, let's explore the big four in more depth, connecting them to the practical decisions you make as a frontend developer.

1. Performance

Performance is arguably the most user-facing quality attribute. It directly impacts user satisfaction, engagement, and even a business's revenue. In the frontend, performance is often measured by metrics like:

  • Time to First Byte (TTFB): How quickly the server responds with the first piece of information.
  • First Contentful Paint (FCP): When the first piece of content is rendered on the screen.
  • Time to Interactive (TTI): The time it takes for the page to become fully interactive for the user.
  • Responsiveness: How quickly the UI reacts to user input after the initial load.

Architectural Decisions Driven by Performance:

A strong emphasis on initial load performance might lead you to choose Server-Side Rendering (SSR) or Static Site Generation (SSG) over a purely Client-Side Rendered (CSR) Single-Page Application (SPA). SSR/SSG sends a fully rendered HTML page to the browser, leading to a much faster FCP. A CSR app, on the other hand, sends a minimal HTML shell and a large JavaScript bundle, which must be downloaded, parsed, and executed before anything appears, often resulting in a blank screen for the user initially.

The following video clip brilliantly contrasts these rendering strategies and their performance implications.

Every Frontend Architecture Pattern Explained in 23 Minutes

In "Every Frontend Architecture Pattern Explained in 23 Minutes," the speaker explains the evolution of rendering patterns, highlighting their performance trade-offs.

First, watch the segment on SPAs from the start of the section to understand their performance characteristics. Then, jump to the discussion on SSG, ISR, and SSR from this point to see how they address the performance drawbacks of SPAs.

As you can see, prioritizing performance isn't just about writing efficient code; it's about making fundamental architectural choices about how and where your application is rendered.

2. Scalability

In the context of frontend architecture, scalability has two important dimensions:

  1. Load Scalability: The application's ability to perform well as the number of users or requests increases. This is often tied to backend and infrastructure choices, but frontend decisions like asset caching and using a Content Delivery Network (CDN) play a significant role.
  2. Development Scalability: The ability of the architecture to support a growing team of developers working on the same codebase. This is a crucial concern in the large-scale applications you aim to build. As a team grows, a poorly structured "monolithic" codebase can lead to merge conflicts, unintended side effects, and a general slowdown in development velocity.

Architectural Decisions Driven by Scalability:

When development scalability is a primary concern for a very large organization, an architect might choose a micro-frontends architecture. This pattern breaks a large application into smaller, independently deployable frontend applications, each owned by a different team. This allows teams to work and release features in parallel. However, this comes at the cost of increased complexity in deployment, communication between the micro-apps, and potential performance overhead.

For a medium-sized team, a modular monolith might be a better choice. Here, the application is still a single deployable unit, but the code is organized into well-defined, loosely coupled modules. This improves maintainability and team autonomy without the full complexity of micro-frontends.

Every Frontend Architecture Pattern Explained in 23 Minutes

This video also provides an excellent comparison of architectures from a team scalability perspective.

Watch the section on the modular monolith, followed immediately by the explanation of microfrontends. Note how the speaker frames the choice in terms of team size and development speed versus complexity.

3. Maintainability

Maintainability refers to the ease with which a software system can be modified to correct faults, improve performance, or adapt to a changed environment. A maintainable codebase is easy to understand, change, and extend without breaking existing functionality. This is critical for the long-term health and evolution of any project.

Architectural Decisions Driven by Maintainability:

  • Separation of Concerns: A layered architecture that separates UI components from business logic, and business logic from data fetching services, is a hallmark of maintainable design. This makes it easier to change one part of the system (e.g., swapping a REST API for GraphQL) without rewriting the UI.
  • Component Model: Adopting a consistent component organization strategy, like atomic design or feature-based folders, makes the codebase easier to navigate.
  • Dependency Management: Decoupling components from specific libraries or frameworks where possible. For instance, abstracting state management logic so you could, in theory, swap Redux for Zustand without a massive refactor.

4. Reliability

Reliability is the probability that the system will perform its intended function without failure for a specified period. In frontend, this means the application should be robust, handle errors gracefully, and provide a consistent experience.

Architectural Decisions Driven by Reliability:

  • Error Handling Strategy: Implementing global error boundaries to catch unexpected runtime errors and display a fallback UI instead of a blank or broken page.
  • Testing Strategy: Defining a comprehensive testing pyramid with a mix of unit, integration, and end-to-end tests that run automatically in a CI/CD pipeline.
  • Resilient Data Fetching: Designing patterns for handling network failures, including retries, timeouts, and showing cached/stale data when the server is unavailable.

The Art of the Trade-Off

You cannot build a system that is maximally performant, infinitely scalable, trivially maintainable, and perfectly reliable all at once. Improving one quality attribute often comes at the expense of another.

  • Microfrontends boost team scalability but add operational complexity and can harm performance if not carefully managed.
  • Server-Side Rendering improves initial load performance but increases infrastructure complexity and cost compared to a simple static site.

The essence of architecture is to understand these trade-offs and make conscious, reasoned decisions based on the specific context and priorities of your project. As the author of the next reading puts it, the goal is not to find the best design, but the least worst combination of trade-offs.

This article introduces a fantastic way of thinking about this process and provides some practical tools for making these decisions with your team.

The Least Worst Architecture | Frontend at Scale

This article from "Frontend at Scale" explains how to approach architectural decisions by focusing on trade-offs.

Start by reading from the beginning to the end of the section on "What Influences Your Architecture?" to solidify your understanding of architectural drivers and quality attributes. Then, skip down to the "Activity Time" section and read about the two tools presented: Trade-off Sliders and the Decision Matrix. Think about how you could use these on a project.

The "Decision Matrix" and "Trade-off Sliders" are powerful tools for turning abstract discussions about quality attributes into concrete, prioritized decisions. The "Frontend Architecture Map" below is a real-world example of this kind of analysis, evaluating different parts of an e-commerce application against various quality attributes to justify specific architectural choices (like CSR vs. SSR) for different user flows.

This map is an advanced example of architectural analysis. It breaks down an e-commerce application by user activities and evaluates each step against key quality attributes to decide on the most appropriate rendering architecture.

This map is an advanced example of architectural analysis. It breaks down an e-commerce application by user activities and evaluates each step against key quality attributes to decide on the most appropriate rendering architecture.


Conclusion

In this lesson, we've laid the cornerstone for your study of frontend architecture. You are now equipped with the vocabulary and mental model to analyze architectural problems through the lens of quality attributes.

Here are the key takeaways:

  • Frontend architecture is about making the significant, hard-to-change decisions that define a system's structure.
  • These decisions are driven by quality attributes (non-functional requirements) like performance, scalability, maintainability, and reliability.
  • Every architectural choice involves trade-offs. Improving one attribute often degrades another.
  • The role of an architect is to understand the project's context, prioritize the most important quality attributes, and choose the "least worst" set of trade-offs to meet the goals.

In our next lesson, we will apply this thinking to our first major architectural choice: "Compare monolithic vs. modular frontend architectures and their trade-offs." We will explore how these high-level patterns stack up against the quality attributes we've discussed today, particularly development scalability and maintainability.