際際滷

際際滷Share a Scribd company logo
Components of a generic web
application architecture
FARHAT KADIWALA
SEMESTER 5 | Enrollment: 21C21035
Subject: JavaScript Frameworks
Introduction
The internet, as we know it, is largely based on a client-server model. This means that
the end user devices communicate via a network with central servers, as opposed to
communicating with one another.
[Image credit: https://scaler.com/topics/images/how-does-the-client-server-model-work.webp]
Here, end user devices refer to devices such as laptops, smartphones, and desktop
computers. These devices are clients of the server. The web application is composed
of a complex architecture of varied components and layers. The request generated by
the user passes through all these layers. When a user makes a request on a website,
various components of the applications, user interfaces, middleware systems,
databases, servers, and the browser interact with each other.
1
The web application architecture is a multi-tiered architecture. Each of these tiers can
be independently replaced or upgraded.
Traditionally, a 2-tier architecture consists of two components namely the client side
system or the user interface and a backend system which is usually a database server.
Here the business logic is incorporated into the user interface or the database server.
This means that a user directly interacts with the database which gives rise to security
concerns. It also does not scale well.
A 3-tier architecture solves these problems by introducing a third tier. It comprises
Presentation, Application and Data tier. Here, the user interacts with an intermediate
server which in turn fetches the data from the database and applies the business logic
to it before responding to the user.
Presentation layer: This is a client-side component that enables the users to interact
with the servers via a browser. The code resides in the browser, receives requests and
presents the user with the required information. This is where UI/UX design,
dashboards, notifications, configurational settings, layout and interactive elements
come into the picture.
Application layer [Server-side component]: The server-side component is the key
component of the web application architecture that receives user requests, performs
business logic and delivers the required data to the front-end systems. It contains
servers, databases, web services etc.
2
Application layer [Application Programming Interface]: API is a concept that enables
developers to access certain data and functions of a software. Simply put, it is a
mediator that allows apps to communicate with each other. It comprises protocols,
tools and subroutine definitions required to build apps.
With APIs, developers dont have to create everything from scratch but use existing
functions exposed as an API to increase productivity and gain faster time to market. By
reducing development efforts, APIs significantly reduce development costs. It also
improves collaboration and connectivity across the ecosystem while enhancing
customer experience.
There are different types of APIs, namely -
 RESTful API: Representational State Transfer API in lightweight JSON format. It
is highly scalable, dependable and delivers fast performance making it the most
popular API.
 SOAP: Simple Object Access Protocol uses XML for data transmission. It
requires more bandwidth and advanced security
Data Layer: A database is a key component of a web application that stores and
manages information for a web app. Using a function, you can search, filter and sort
information based on user request and present the required info to the end user. They
allow role-based access to maintain data integrity.
Types of Web Applications Architectures
In a traditional web application, each request for a new view (HTML page) results in a
round-trip to the server. On the server side, the request is intercepted by a controller
object inside the presentation layer. The controller then interacts with the model layer
via the service layer, which determines the components required to complete the
model layers task. After the data is fetched, any necessary changes to the data are
then made in the business layer. Control is passed back to the presentation layer,
where the appropriate view is chosen. The browser then receives the new HTML page
and, via a UI refresh, the user sees the new view containing the requested data.
 Monolithic Architecture: In this model, all components, including user interfaces,
business logic, and the database, are tightly integrated into a single codebase.
It's relatively simple to develop but can become complex to maintain as the
application grows.
3
 Microservices: Microservices break applications into small, independent services,
each responsible for specific functions. These services communicate through
APIs and can be developed, deployed, and scaled independently.
 RESTful API Architecture: REST is an architectural style for designing networked
applications, using standard HTTP methods for CRUD operations. It's commonly
used for building web services that can be consumed by various clients.
Image credit: [https://mannhowie.com/rest-api]
 Single Page Application (SPA): SPAs are popular today, as they offer a more
responsive user experience. They present content as a single HTML page and
separate data from its presentation, often utilising technologies like React,
Angular, or Vue for the front-end.
SPA Interaction with WebSockets
SPAs achieve their responsiveness through techniques like WebSockets, which
establish a bidirectional connection between the client and server. This enables
real-time updates without page reloads.
Image credit: [https://testdriven.io/blog/html-over-websockets]
4
It is a popular architecture for web applications today. It is used in applications like
Gmail, Google Maps, Airbnb, Facebook, etc. It is presented to the user as a single
HTML page to be more responsive and to more closely replicate a desktop application
or a native application.
It works by separating the data from the presentation of data by having a model layer
that handles the data and a view layer that reads from the models.
The traditional way to achieve a Single-page Application (SPA) is to divide
responsibilities between the back and front-end:
 back-end serves information up via a JSON RESTful API
 front-end fetches data from the back-end asynchronously via API calls
The client requests the content through an associated route. The server generates the
relevant HTML, CSS and JS for the template using a templating system and returns the
template fragment through the WebSocket channel. The frontend updates the DOM
with template fragments.
const exampleSocket = new WebSocket("wss://www.example.com/socketserver", [
"protocolOne",
"protocolTwo",
]);
exampleSocket.send();
JSON.parse();
The above snippet is an example of how data is sent across using WebSockets.
Once the page is loaded, interactions with the server are through Ajax calls and data is
returned, typically in JSON (JavaScript Object Notation) format, to update the page
without requiring reloads.
Technologies used in a single page app architecture are:
 JavaScript frameworks to build the skeleton of the application. Developers may
use JS alone or in conjunction with React JS or Angular.Js, or Vue.
 AJAX is suitable for asynchronous XML and JavaScript, which is needed to
deploy the SPA. It permits data transmission between the server and the client
and is accountable for the seamless reload.
5
 Backend programs such as PHP, Node.js and DBMS such as MySQL, MongoDB.
Conclusion:
Web application architecture is a critical component of the internet's foundation. It
continues to evolve, with SPAs and microservices representing the future of web
development. While SPAs offer fast and responsive user experiences, they come with
security challenges like cross-site scripting attacks.
As technology advances, web applications will become even faster, more intuitive, and
adaptable, allowing businesses to unlock new opportunities and deliver enhanced
digital experiences to their users.
6

More Related Content

Similar to Components of a Generic Web Application Architecture (20)

4163A - What is Web 2.0.ppt
4163A - What is Web 2.0.ppt4163A - What is Web 2.0.ppt
4163A - What is Web 2.0.ppt
Matthew Perrins
Top 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web DevelopmentTop 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web Development
Technostacks Infotech Pvt. Ltd.
java web services - soap and rest services
java web services - soap and rest  servicesjava web services - soap and rest  services
java web services - soap and rest services
VasantPrasad
Web2.0 Ajax and REST in WebSphere Portal
Web2.0 Ajax and REST in WebSphere PortalWeb2.0 Ajax and REST in WebSphere Portal
Web2.0 Ajax and REST in WebSphere Portal
Munish Gupta
Enterprise Software Architecture
Enterprise Software ArchitectureEnterprise Software Architecture
Enterprise Software Architecture
rahmed_sct
Building Micro-Frontends: Scaling Teams and Projects Empowering Developers 1s...
Building Micro-Frontends: Scaling Teams and Projects Empowering Developers 1s...Building Micro-Frontends: Scaling Teams and Projects Empowering Developers 1s...
Building Micro-Frontends: Scaling Teams and Projects Empowering Developers 1s...
pyrageisari
Web 2 0 Fullfeatures
Web 2 0 FullfeaturesWeb 2 0 Fullfeatures
Web 2 0 Fullfeatures
Ratna Prashanth
Web 2 0 Fullfeatures
Web 2 0 FullfeaturesWeb 2 0 Fullfeatures
Web 2 0 Fullfeatures
vsnmurthy
Web 2 0 Fullfeatures
Web 2 0 FullfeaturesWeb 2 0 Fullfeatures
Web 2 0 Fullfeatures
guest9b7f4753
"A Highly Decoupled Front-end Framework for High Trafficked Web Applications"...
"A Highly Decoupled Front-end Framework for High Trafficked Web Applications"..."A Highly Decoupled Front-end Framework for High Trafficked Web Applications"...
"A Highly Decoupled Front-end Framework for High Trafficked Web Applications"...
Prem Gurbani
Internet applications unit1
Internet applications unit1Internet applications unit1
Internet applications unit1
MSc CST
Web Based Application for Rent or Sale
Web Based Application for Rent or SaleWeb Based Application for Rent or Sale
Web Based Application for Rent or Sale
Mike Taylor
Frontend Developer Roadmap PDF By Scholarhat
Frontend Developer Roadmap PDF By ScholarhatFrontend Developer Roadmap PDF By Scholarhat
Frontend Developer Roadmap PDF By Scholarhat
Scholarhat
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
Deliver Dynamic and Interactive Web Content in J2EE Applications
Deliver Dynamic and Interactive Web Content in J2EE ApplicationsDeliver Dynamic and Interactive Web Content in J2EE Applications
Deliver Dynamic and Interactive Web Content in J2EE Applications
infopapers
Brent Wilkins Resume
Brent Wilkins ResumeBrent Wilkins Resume
Brent Wilkins Resume
Brent Wilkins
Single Page Application
Single Page ApplicationSingle Page Application
Single Page Application
Prasad Narasimhan
Web Application Architecture: A Complete Guide
Web Application Architecture: A Complete GuideWeb Application Architecture: A Complete Guide
Web Application Architecture: A Complete Guide
Rosalie Lauren
Web 2 0 Tools
Web 2 0 ToolsWeb 2 0 Tools
Web 2 0 Tools
ramesh kumar
Web 2.0 Introduction
Web 2.0 IntroductionWeb 2.0 Introduction
Web 2.0 Introduction
Deepan Sivasankar
4163A - What is Web 2.0.ppt
4163A - What is Web 2.0.ppt4163A - What is Web 2.0.ppt
4163A - What is Web 2.0.ppt
Matthew Perrins
Top 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web DevelopmentTop 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web Development
Technostacks Infotech Pvt. Ltd.
java web services - soap and rest services
java web services - soap and rest  servicesjava web services - soap and rest  services
java web services - soap and rest services
VasantPrasad
Web2.0 Ajax and REST in WebSphere Portal
Web2.0 Ajax and REST in WebSphere PortalWeb2.0 Ajax and REST in WebSphere Portal
Web2.0 Ajax and REST in WebSphere Portal
Munish Gupta
Enterprise Software Architecture
Enterprise Software ArchitectureEnterprise Software Architecture
Enterprise Software Architecture
rahmed_sct
Building Micro-Frontends: Scaling Teams and Projects Empowering Developers 1s...
Building Micro-Frontends: Scaling Teams and Projects Empowering Developers 1s...Building Micro-Frontends: Scaling Teams and Projects Empowering Developers 1s...
Building Micro-Frontends: Scaling Teams and Projects Empowering Developers 1s...
pyrageisari
Web 2 0 Fullfeatures
Web 2 0 FullfeaturesWeb 2 0 Fullfeatures
Web 2 0 Fullfeatures
vsnmurthy
Web 2 0 Fullfeatures
Web 2 0 FullfeaturesWeb 2 0 Fullfeatures
Web 2 0 Fullfeatures
guest9b7f4753
"A Highly Decoupled Front-end Framework for High Trafficked Web Applications"...
"A Highly Decoupled Front-end Framework for High Trafficked Web Applications"..."A Highly Decoupled Front-end Framework for High Trafficked Web Applications"...
"A Highly Decoupled Front-end Framework for High Trafficked Web Applications"...
Prem Gurbani
Internet applications unit1
Internet applications unit1Internet applications unit1
Internet applications unit1
MSc CST
Web Based Application for Rent or Sale
Web Based Application for Rent or SaleWeb Based Application for Rent or Sale
Web Based Application for Rent or Sale
Mike Taylor
Frontend Developer Roadmap PDF By Scholarhat
Frontend Developer Roadmap PDF By ScholarhatFrontend Developer Roadmap PDF By Scholarhat
Frontend Developer Roadmap PDF By Scholarhat
Scholarhat
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
Deliver Dynamic and Interactive Web Content in J2EE Applications
Deliver Dynamic and Interactive Web Content in J2EE ApplicationsDeliver Dynamic and Interactive Web Content in J2EE Applications
Deliver Dynamic and Interactive Web Content in J2EE Applications
infopapers
Brent Wilkins Resume
Brent Wilkins ResumeBrent Wilkins Resume
Brent Wilkins Resume
Brent Wilkins
Web Application Architecture: A Complete Guide
Web Application Architecture: A Complete GuideWeb Application Architecture: A Complete Guide
Web Application Architecture: A Complete Guide
Rosalie Lauren

Recently uploaded (20)

FutureProofing the Nordic Economy with GenAI
FutureProofing the Nordic Economy with GenAIFutureProofing the Nordic Economy with GenAI
FutureProofing the Nordic Economy with GenAI
Pete Nieminen
How to Achieve High-Accuracy Results When Using LLMs
How to Achieve High-Accuracy Results When Using LLMsHow to Achieve High-Accuracy Results When Using LLMs
How to Achieve High-Accuracy Results When Using LLMs
Aggregage
Top Tips to Get Your Data AI-Ready
Top Tips to Get Your Data AI-Ready   Top Tips to Get Your Data AI-Ready
Top Tips to Get Your Data AI-Ready
Precisely
Cybersecurity-Threat-Landscape-March-31-April-7-2025.pdf
Cybersecurity-Threat-Landscape-March-31-April-7-2025.pdfCybersecurity-Threat-Landscape-March-31-April-7-2025.pdf
Cybersecurity-Threat-Landscape-March-31-April-7-2025.pdf
Joe Shenouda
Commit Conf 2025 Bitnami Charts with Kubescape
Commit Conf 2025 Bitnami Charts with KubescapeCommit Conf 2025 Bitnami Charts with Kubescape
Commit Conf 2025 Bitnami Charts with Kubescape
Alfredo Garc鱈a Lavilla
Laravel Crud Tutorial Basic Step by Stepy S
Laravel Crud Tutorial Basic Step by Stepy SLaravel Crud Tutorial Basic Step by Stepy S
Laravel Crud Tutorial Basic Step by Stepy S
christopherneo4
ScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 EdinburghScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 Edinburgh
Ray Bugg
From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...
From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...
From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...
Pavel Shukhman
Innovative Web Design | Malachite Technologies
Innovative Web Design | Malachite TechnologiesInnovative Web Design | Malachite Technologies
Innovative Web Design | Malachite Technologies
malachitetechnologie1
Presentation Session 4 -Agent Builder.pdf
Presentation Session 4 -Agent Builder.pdfPresentation Session 4 -Agent Builder.pdf
Presentation Session 4 -Agent Builder.pdf
Mukesh Kala
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryDataNew from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
BookNet Canada
Artificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examplesArtificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examples
anandsimple
Build Your Uber Clone App with Advanced Features
Build Your Uber Clone App with Advanced FeaturesBuild Your Uber Clone App with Advanced Features
Build Your Uber Clone App with Advanced Features
V3cube
TNBC Research Presentation and medical virology .pptx
TNBC Research Presentation and medical virology .pptxTNBC Research Presentation and medical virology .pptx
TNBC Research Presentation and medical virology .pptx
MohamedHasan816582
Introduction to Generative AI refers to a subset of artificial intelligence
Introduction to Generative AI refers to a subset of artificial intelligenceIntroduction to Generative AI refers to a subset of artificial intelligence
Introduction to Generative AI refers to a subset of artificial intelligence
Kongu Engineering College, Perundurai, Erode
Least Privilege AWS IAM Role Permissions
Least Privilege AWS IAM Role PermissionsLeast Privilege AWS IAM Role Permissions
Least Privilege AWS IAM Role Permissions
Chris Wahl
Introduction to Mobile App Development.
Introduction to  Mobile App Development.Introduction to  Mobile App Development.
Introduction to Mobile App Development.
AkashDwivedi43
Getting the Best of TrueDEM April News & Updates
Getting the Best of TrueDEM  April News & UpdatesGetting the Best of TrueDEM  April News & Updates
Getting the Best of TrueDEM April News & Updates
panagenda
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
DOCOMO Innovations, Inc.
CEE Software Development M&A Report 2025
CEE Software Development M&A Report 2025CEE Software Development M&A Report 2025
CEE Software Development M&A Report 2025
Yevgen Sysoyev
FutureProofing the Nordic Economy with GenAI
FutureProofing the Nordic Economy with GenAIFutureProofing the Nordic Economy with GenAI
FutureProofing the Nordic Economy with GenAI
Pete Nieminen
How to Achieve High-Accuracy Results When Using LLMs
How to Achieve High-Accuracy Results When Using LLMsHow to Achieve High-Accuracy Results When Using LLMs
How to Achieve High-Accuracy Results When Using LLMs
Aggregage
Top Tips to Get Your Data AI-Ready
Top Tips to Get Your Data AI-Ready   Top Tips to Get Your Data AI-Ready
Top Tips to Get Your Data AI-Ready
Precisely
Cybersecurity-Threat-Landscape-March-31-April-7-2025.pdf
Cybersecurity-Threat-Landscape-March-31-April-7-2025.pdfCybersecurity-Threat-Landscape-March-31-April-7-2025.pdf
Cybersecurity-Threat-Landscape-March-31-April-7-2025.pdf
Joe Shenouda
Commit Conf 2025 Bitnami Charts with Kubescape
Commit Conf 2025 Bitnami Charts with KubescapeCommit Conf 2025 Bitnami Charts with Kubescape
Commit Conf 2025 Bitnami Charts with Kubescape
Alfredo Garc鱈a Lavilla
Laravel Crud Tutorial Basic Step by Stepy S
Laravel Crud Tutorial Basic Step by Stepy SLaravel Crud Tutorial Basic Step by Stepy S
Laravel Crud Tutorial Basic Step by Stepy S
christopherneo4
ScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 EdinburghScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 Edinburgh
Ray Bugg
From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...
From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...
From SBOMs to xBOMs to Transparency - Pavel Shukhman at OWASP Ottawa on 2025-...
Pavel Shukhman
Innovative Web Design | Malachite Technologies
Innovative Web Design | Malachite TechnologiesInnovative Web Design | Malachite Technologies
Innovative Web Design | Malachite Technologies
malachitetechnologie1
Presentation Session 4 -Agent Builder.pdf
Presentation Session 4 -Agent Builder.pdfPresentation Session 4 -Agent Builder.pdf
Presentation Session 4 -Agent Builder.pdf
Mukesh Kala
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryDataNew from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
BookNet Canada
Artificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examplesArtificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examples
anandsimple
Build Your Uber Clone App with Advanced Features
Build Your Uber Clone App with Advanced FeaturesBuild Your Uber Clone App with Advanced Features
Build Your Uber Clone App with Advanced Features
V3cube
TNBC Research Presentation and medical virology .pptx
TNBC Research Presentation and medical virology .pptxTNBC Research Presentation and medical virology .pptx
TNBC Research Presentation and medical virology .pptx
MohamedHasan816582
Least Privilege AWS IAM Role Permissions
Least Privilege AWS IAM Role PermissionsLeast Privilege AWS IAM Role Permissions
Least Privilege AWS IAM Role Permissions
Chris Wahl
Introduction to Mobile App Development.
Introduction to  Mobile App Development.Introduction to  Mobile App Development.
Introduction to Mobile App Development.
AkashDwivedi43
Getting the Best of TrueDEM April News & Updates
Getting the Best of TrueDEM  April News & UpdatesGetting the Best of TrueDEM  April News & Updates
Getting the Best of TrueDEM April News & Updates
panagenda
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
DOCOMO Innovations, Inc.
CEE Software Development M&A Report 2025
CEE Software Development M&A Report 2025CEE Software Development M&A Report 2025
CEE Software Development M&A Report 2025
Yevgen Sysoyev

Components of a Generic Web Application Architecture

  • 1. Components of a generic web application architecture FARHAT KADIWALA SEMESTER 5 | Enrollment: 21C21035 Subject: JavaScript Frameworks Introduction The internet, as we know it, is largely based on a client-server model. This means that the end user devices communicate via a network with central servers, as opposed to communicating with one another. [Image credit: https://scaler.com/topics/images/how-does-the-client-server-model-work.webp] Here, end user devices refer to devices such as laptops, smartphones, and desktop computers. These devices are clients of the server. The web application is composed of a complex architecture of varied components and layers. The request generated by the user passes through all these layers. When a user makes a request on a website, various components of the applications, user interfaces, middleware systems, databases, servers, and the browser interact with each other. 1
  • 2. The web application architecture is a multi-tiered architecture. Each of these tiers can be independently replaced or upgraded. Traditionally, a 2-tier architecture consists of two components namely the client side system or the user interface and a backend system which is usually a database server. Here the business logic is incorporated into the user interface or the database server. This means that a user directly interacts with the database which gives rise to security concerns. It also does not scale well. A 3-tier architecture solves these problems by introducing a third tier. It comprises Presentation, Application and Data tier. Here, the user interacts with an intermediate server which in turn fetches the data from the database and applies the business logic to it before responding to the user. Presentation layer: This is a client-side component that enables the users to interact with the servers via a browser. The code resides in the browser, receives requests and presents the user with the required information. This is where UI/UX design, dashboards, notifications, configurational settings, layout and interactive elements come into the picture. Application layer [Server-side component]: The server-side component is the key component of the web application architecture that receives user requests, performs business logic and delivers the required data to the front-end systems. It contains servers, databases, web services etc. 2
  • 3. Application layer [Application Programming Interface]: API is a concept that enables developers to access certain data and functions of a software. Simply put, it is a mediator that allows apps to communicate with each other. It comprises protocols, tools and subroutine definitions required to build apps. With APIs, developers dont have to create everything from scratch but use existing functions exposed as an API to increase productivity and gain faster time to market. By reducing development efforts, APIs significantly reduce development costs. It also improves collaboration and connectivity across the ecosystem while enhancing customer experience. There are different types of APIs, namely - RESTful API: Representational State Transfer API in lightweight JSON format. It is highly scalable, dependable and delivers fast performance making it the most popular API. SOAP: Simple Object Access Protocol uses XML for data transmission. It requires more bandwidth and advanced security Data Layer: A database is a key component of a web application that stores and manages information for a web app. Using a function, you can search, filter and sort information based on user request and present the required info to the end user. They allow role-based access to maintain data integrity. Types of Web Applications Architectures In a traditional web application, each request for a new view (HTML page) results in a round-trip to the server. On the server side, the request is intercepted by a controller object inside the presentation layer. The controller then interacts with the model layer via the service layer, which determines the components required to complete the model layers task. After the data is fetched, any necessary changes to the data are then made in the business layer. Control is passed back to the presentation layer, where the appropriate view is chosen. The browser then receives the new HTML page and, via a UI refresh, the user sees the new view containing the requested data. Monolithic Architecture: In this model, all components, including user interfaces, business logic, and the database, are tightly integrated into a single codebase. It's relatively simple to develop but can become complex to maintain as the application grows. 3
  • 4. Microservices: Microservices break applications into small, independent services, each responsible for specific functions. These services communicate through APIs and can be developed, deployed, and scaled independently. RESTful API Architecture: REST is an architectural style for designing networked applications, using standard HTTP methods for CRUD operations. It's commonly used for building web services that can be consumed by various clients. Image credit: [https://mannhowie.com/rest-api] Single Page Application (SPA): SPAs are popular today, as they offer a more responsive user experience. They present content as a single HTML page and separate data from its presentation, often utilising technologies like React, Angular, or Vue for the front-end. SPA Interaction with WebSockets SPAs achieve their responsiveness through techniques like WebSockets, which establish a bidirectional connection between the client and server. This enables real-time updates without page reloads. Image credit: [https://testdriven.io/blog/html-over-websockets] 4
  • 5. It is a popular architecture for web applications today. It is used in applications like Gmail, Google Maps, Airbnb, Facebook, etc. It is presented to the user as a single HTML page to be more responsive and to more closely replicate a desktop application or a native application. It works by separating the data from the presentation of data by having a model layer that handles the data and a view layer that reads from the models. The traditional way to achieve a Single-page Application (SPA) is to divide responsibilities between the back and front-end: back-end serves information up via a JSON RESTful API front-end fetches data from the back-end asynchronously via API calls The client requests the content through an associated route. The server generates the relevant HTML, CSS and JS for the template using a templating system and returns the template fragment through the WebSocket channel. The frontend updates the DOM with template fragments. const exampleSocket = new WebSocket("wss://www.example.com/socketserver", [ "protocolOne", "protocolTwo", ]); exampleSocket.send(); JSON.parse(); The above snippet is an example of how data is sent across using WebSockets. Once the page is loaded, interactions with the server are through Ajax calls and data is returned, typically in JSON (JavaScript Object Notation) format, to update the page without requiring reloads. Technologies used in a single page app architecture are: JavaScript frameworks to build the skeleton of the application. Developers may use JS alone or in conjunction with React JS or Angular.Js, or Vue. AJAX is suitable for asynchronous XML and JavaScript, which is needed to deploy the SPA. It permits data transmission between the server and the client and is accountable for the seamless reload. 5
  • 6. Backend programs such as PHP, Node.js and DBMS such as MySQL, MongoDB. Conclusion: Web application architecture is a critical component of the internet's foundation. It continues to evolve, with SPAs and microservices representing the future of web development. While SPAs offer fast and responsive user experiences, they come with security challenges like cross-site scripting attacks. As technology advances, web applications will become even faster, more intuitive, and adaptable, allowing businesses to unlock new opportunities and deliver enhanced digital experiences to their users. 6