SlideShare una empresa de Scribd logo
1 de 6
Descargar para leer sin conexión
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 don’t 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 layer’s 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

Más contenido relacionado

Similar a Components of a Generic Web Application Architecture

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.pptMatthew Perrins
 
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 PortalMunish Gupta
 
Enterprise Software Architecture
Enterprise Software ArchitectureEnterprise Software Architecture
Enterprise Software Architecturerahmed_sct
 
Web 2 0 Fullfeatures
Web 2 0 FullfeaturesWeb 2 0 Fullfeatures
Web 2 0 Fullfeaturesvsnmurthy
 
Web 2 0 Fullfeatures
Web 2 0 FullfeaturesWeb 2 0 Fullfeatures
Web 2 0 Fullfeaturesguest9b7f4753
 
"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 unit1MSc 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 SaleMike Taylor
 
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 Applicationsinfopapers
 
Brent Wilkins Resume
Brent Wilkins ResumeBrent Wilkins Resume
Brent Wilkins ResumeBrent Wilkins
 
Web Application Architecture: A Complete Guide
Web Application Architecture: A Complete GuideWeb Application Architecture: A Complete Guide
Web Application Architecture: A Complete GuideRosalie Lauren
 
Enhancement in Web Service Architecture
Enhancement in Web Service ArchitectureEnhancement in Web Service Architecture
Enhancement in Web Service ArchitectureIJERA Editor
 
Converting Any Website to Wordpress
Converting Any Website to WordpressConverting Any Website to Wordpress
Converting Any Website to WordpressIJERDJOURNAL
 

Similar a 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
 
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
 
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
 
Enterprise Software Architecture
Enterprise Software ArchitectureEnterprise Software Architecture
Enterprise Software Architecture
 
Web 2 0 Fullfeatures
Web 2 0 FullfeaturesWeb 2 0 Fullfeatures
Web 2 0 Fullfeatures
 
Web 2 0 Fullfeatures
Web 2 0 FullfeaturesWeb 2 0 Fullfeatures
Web 2 0 Fullfeatures
 
Web 2 0 Fullfeatures
Web 2 0 FullfeaturesWeb 2 0 Fullfeatures
Web 2 0 Fullfeatures
 
"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"...
 
Internet applications unit1
Internet applications unit1Internet applications unit1
Internet applications unit1
 
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
 
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...
 
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
 
Brent Wilkins Resume
Brent Wilkins ResumeBrent Wilkins Resume
Brent Wilkins Resume
 
Single Page Application
Single Page ApplicationSingle Page Application
Single Page Application
 
Web Application Architecture: A Complete Guide
Web Application Architecture: A Complete GuideWeb Application Architecture: A Complete Guide
Web Application Architecture: A Complete Guide
 
Web 2 0 Tools
Web 2 0 ToolsWeb 2 0 Tools
Web 2 0 Tools
 
Web 2.0 Introduction
Web 2.0 IntroductionWeb 2.0 Introduction
Web 2.0 Introduction
 
Enhancement in Web Service Architecture
Enhancement in Web Service ArchitectureEnhancement in Web Service Architecture
Enhancement in Web Service Architecture
 
Converting Any Website to Wordpress
Converting Any Website to WordpressConverting Any Website to Wordpress
Converting Any Website to Wordpress
 
Siva_DotNet
Siva_DotNetSiva_DotNet
Siva_DotNet
 

Último

Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfdanishmna97
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...FIDO Alliance
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxMasterG
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)Wonjun Hwang
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 

Último (20)

Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 

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 don’t 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 layer’s 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