NashTech Insights

Functional Web App (FWA)

Trần Minh
Trần Minh
Table of Contents
Functional Web Application

Functional Web App (FWA) is an architectural pattern for building web applications and APIs. It empowers developers with the flexibility of dynamic, full-stack applications and the ease of scaling a static website.

What is FWA?

As you know, the significant advantage of a Dynamic Web Application (DWA) is the flexibility and ability to change content and design. Meanwhile, Static Web Application has advantages in scaling and easy deploying. But how can we leverage both? Functional Web App is the answer to that question.

The three facets of the Functional Web App

AWS Lambda, Azure Function, GCP FunctionFull Managed DatabaseInfrastructure As Code
Cloud FunctionsManaged DatabaseDeterministic Deployment
Apps are primarily composed of single-responsibility cloud functions.A fully-managed database securely maintains persistence.They are deterministically deployed with Infrastructure as Code (IaC) and runtime dependency lock files.

Cloud Functions

FWA uses Cloud Functions to execute its business tasks
FWA uses Cloud Functions

Dynamic Web Applications execute business logic with the trusted computing process, while FWA uses Cloud Functions to execute its business tasks.

Cloud Functions is a serverless service of cloud providers. Cloud functions are the purest encapsulation unit for stateless, auto-scale trusted computing. You can read this article if you want more knowledge about serverless’s advantages.

Whenever someone calls the FWA endpoint or triggers a background task, a discretely isolated, single-responsibility cloud function spins up, providing a safe, secure, trusted computing process.

How an FWA is built physically is the same as how it is designed logically, where functions have one responsibility each. The function code that is created is the exact cloud function that is used. This simplifies the process of debugging and maintaining. In the FWA development process, errors can be linked to specific cloud functions, each with different logs.

Managed Database

Functional Web App uses full-managed database
Full-Managed Database Pros

In Dynamic Web Applications, we need a primary database. But in traditional, the database is the most complicated part for management. And we need to scale it and schedule to back up and upgrade. But that is the business of a managed database provider to keep your database secure, fast, and stable. In addition, managed databases free FWA developers to continue with business logic, database reading, and writing.

Functional Web Apps should expect their data layer to adjust to the demand in real-time, increasing or decreasing as needed, and never needing planned maintenance for upgrades. A managed database provider takes care of setting up, watching, securing, and backing up regularly.

Deterministic Deployment

Functional Web App uses IaC to deploy
Infrastructure As Code

When developing an application, we need to define specific infrastructure. So cloud infrastructure is a dependency of our application. As with source code dependencies, applications should explicitly define cloud infra dependencies to ensure safe, reliable software delivery and operation. Functional Web Apps guarantee consistent deployment by specifying cloud infrastructure requirements in the exact location where the code that relies on them is kept and managed, which we call IaC (Infrastructure As Code).

In web applications that change often, having different environments for development and production makes finding and solving bugs rigid and slow. Also, setting up cloud infrastructure manually in different cloud vendor websites causes severe problems with reliability and maintenance. To ensure an entirely predictable and repeatable application environment, keep all the steps needed for setting up, hosting, and delivering a Functional Web App in the same place as the code. This makes sure FWAs work precisely as planned every single time.

Why do we build an Functional Web App?

The Functional Web App has some characteristics we can consider when creating a new or evolving your existing application.

Anyone can build

The Functional Web App doesn’t require special knowledge to create or manage. If you have basic knowledge of web development, you can create a full-functionality FWA.

Focus on your code

Compared with traditional dynamic web applications, FWA is easier to debug, deploy, develop, and maintain. Developers only need to focus on their code and business logic. That helps their applications significantly code lower than traditional dynamic web applications.

Reliable and reproducible

Because FWAs require IaC in pattern, deployment logic is identical to the physical architecture without complicated developer environments. That improves velocity and reduces time to bug resolution.

Code runs in isolation.

By applying the cloud function in the FWA pattern, FWA code runs in isolation, and unrelated code is never run in the same process, thereby reducing bug surface area and potential security issues.

Power and flexibility

FWA combines DWA (Dynamic Web Application) and SWA (Static Web Application) with the power and flexibility of dynamic and the ease and simplicity of scaling a static website.

Open source to build Functional Web App

There’s some open-source support for us to build FWAs:

  • Architect: is the simple framework for building and delivering powerful FWA on AWS
  • Bicep: is a Domain Specific Language (DSL) for deploying Azure resources declaratively
  • SAM: The AWS Serverless Application Model (SAM) is an open-source framework for building serverless applications. It provides shorthand syntax to express functions, APIs, databases, and event source mappings.
  • Serverless: Zero-friction development tooling for auto-scaling apps on AWS Lambda.
  • Terraform: Terraform is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage hundreds of cloud services.
Trần Minh

Trần Minh

I'm a solution architect at NashTech. I live and work with the quote, "Nothing is impossible; Just how to do that!". When facing problems, we can solve them by building them all from scratch or finding existing solutions and making them one. Technically, we don't have right or wrong in the choice. Instead, we choose which solutions or approaches based on input factors. Solving problems and finding reasonable solutions to reach business requirements is my favorite.

Leave a Comment

Your email address will not be published. Required fields are marked *

Suggested Article

%d bloggers like this: