Exploring the Evolution of Web App Architectures: From MVC to JAMstack and FWA

tfc

Hatched by tfc

Aug 13, 2023

4 min read

0

Exploring the Evolution of Web App Architectures: From MVC to JAMstack and FWA

Introduction:

Web application architectures have undergone significant transformations over the years, driven by the need for improved performance, scalability, and reproducibility. In this article, we will explore three key architectures: the traditional server-centric MVC approach, the modern JAMstack architecture, and the emerging Functional Web App (FWA) paradigm. We will analyze their logical and physical structures, discuss their advantages and limitations, and highlight the role of Amazon EFS for AWS Lambda in serverless applications.

  1. Traditional Server-Centric MVC Architecture:

In the traditional server-centric MVC architecture, the logical architecture refers to the organization and structure of the system's source code. On the other hand, the physical architecture represents the cloud infrastructure that runs the source code. The distinction between authortime (logical) and runtime (physical) poses challenges in achieving consistency and reproducibility.

To ensure high availability and fault tolerance, a typical server-based application requires a logical architecture running on multiple physical web servers behind a load balancer, possibly supported by a CDN and database servers. However, having separate definitions for physical infrastructure and code can lead to slow bug resolution and hinder reproducibility.

  1. JAMstack Architecture: Simplifying Complexity with Two-Tier Structure:

To address the complexity of three-tier architectures, the JAMstack architecture adopts a two-tier approach. JAMstack, which stands for JavaScript, APIs, and Markup, leverages pre-rendered markup for the presentation layer and browser JavaScript for business logic. APIs act as the server in this architecture.

While JAMstack simplifies the architecture, it also introduces tradeoffs. Dynamic data and personalization functionalities may be delayed due to the reliance on browser client JavaScript. Furthermore, many implementations of the JAMstack architecture lack deterministically reproducible infrastructure, relying on third-party API providers for dynamic functionality. This makes deployment and governance error-prone and manual.

  1. Functional Web App (FWA) Architecture: The Move towards Deterministic Deployments:

FWA architecture offers a different solution to the complexity of traditional architectures. It embraces a fully functional approach, where the entire application is authored as single-responsibility cloud functions. These functions can dynamically render HTML-first and incorporate the full-stack, including a managed database.

By modeling the presentation and application logic in the backend with pure cloud functions, an FWA achieves deterministic deployment through Infrastructure as Code (IaC). This ensures that the entire application is reproducible to any version at any time. The logical architecture of an FWA aligns with its physical architecture, eliminating delivery and maintenance headaches while maintaining high availability.

  1. Leveraging Amazon EFS for AWS Lambda in Serverless Applications:

In serverless applications, AWS Lambda provides ephemeral compute functions for event-driven integration and data transformation. However, the temporary file system included with Lambda is not designed for durable storage. This is where Amazon Elastic File System (EFS) comes into play.

Amazon EFS is a fully managed, elastic, shared file system that can be consumed by Lambda and other AWS services. With EFS for Lambda, data can be easily shared across function invocations, and large reference data files can be read and function output can be written to a persistent and shared store.

EFS scales automatically to petabytes of data, providing low-latency access and durability across multiple Availability Zones. It offers cost optimization through lifecycle management and two performance modes: general purpose and MaxIO. By mounting the EFS file system to Lambda functions, multiple instances can access and modify shared data, enhancing collaboration and efficiency.

Actionable Advice:

  1. Embrace Infrastructure as Code (IaC): Regardless of the architecture you choose, adopting IaC practices ensures reproducibility and consistency in your deployments. Define your infrastructure alongside your code to avoid manual and error-prone processes.

  2. Evaluate the Tradeoffs: When selecting an architecture, consider the tradeoffs it brings. While JAMstack simplifies complexity, it may impact dynamic functionality. Assess the specific requirements of your application and choose the architecture that aligns best with your needs.

  3. Leverage Amazon EFS for AWS Lambda: If you're building serverless applications with AWS Lambda, explore the benefits of integrating Amazon EFS. It enables data sharing, persistence, and collaboration across function invocations, enhancing the capabilities of your serverless architecture.

Conclusion:

As web application architectures continue to evolve, it is crucial to understand the strengths and weaknesses of different approaches. From the traditional server-centric MVC architecture to the modern JAMstack and emerging FWA paradigms, each architecture offers unique solutions to the challenges of scalability, fault tolerance, and reproducibility.

By incorporating Infrastructure as Code practices, evaluating tradeoffs, and leveraging services like Amazon EFS for AWS Lambda, developers can build robust, scalable, and efficient web applications that meet the demands of today's digital landscape. Embrace the power of architectural evolution and choose the approach that best suits your project's requirements.

Sources

← Back to Library

Hatch New Ideas with Glasp AI 🐣

Glasp AI allows you to hatch new ideas based on your curated content. Let's curate and create with Glasp AI :)

Start Hatching 🐣