Professional Documents
Culture Documents
Web architecture consists of several components, including the client, the server, the
network, and the database. The client is the web browser or application that the user
interacts with, and the server is the computer or group of computers that host the website or
web application. The network is the infrastructure that connects the client and the server,
such as the internet. The database is a collection of data that is used to store and retrieve
information for the website or web application.
Web architecture also includes the design and layout of the website or web application, as
well as the way it is organized and the relationships between different pages and
components. It also includes the way the website or web application is built and maintained,
including the use of frameworks and libraries, and the deployment and hosting of the
website or web application.
The server −This is the computer or group of computers that host the website or web
application. The server processes requests from the client and sends back the appropriate
response.
The network This is the infrastructure that connects the client and the server, such as the
internet. It allows for communication between the client and the server.
The database −This is a collection of data that is used to store and retrieve information
for the website or web application. The database can be located on the same server as the
website or web application, or it can be hosted on a separate server.
The design and layout −This refers to the way the website or web application is
structured and organized, including the layout, navigation, and overall appearance.
The frameworks and libraries − These are tools and resources that are used to
build and maintain the website or web application. They can include frameworks like Ruby
on Rails or Django, or libraries like jQuery or React.
The deployment and hosting − This refers to the way the website or web
application is deployed and hosted, including the hosting environment (such as a shared
hosting plan or a cloud platform) and the process for deploying updates and changes to the
A well-designed web architecture can improve the user experience by ensuring that the
website or web application loads quickly and reliably. It can also make the website or web
application easier to maintain, as it provides a clear structure and organization that makes it
easier to find and modify different components.
Web architecture is also important for scalability, as it determines the website or web
application's ability to handle increasing traffic and usage without experiencing performance
issues. A scalable web architecture can support growth and handle changes in traffic
patterns without requiring major changes to the system.
Finally, a strong web architecture can improve the security of a website or web application
by implementing
Well, that’s exactly true but if you go on a deeper level, you’ll find that your web application
has a complex architecture of different components and layers. Your request passes
through these different layers and components and then you get the response back from
the server’s end. It’s a quite long process but understanding the fundamental of web
application architecture is really important if your goal is to become a good web application
developer. Firstly let’s understand a few things about web applications.
When you’re building an application, you need to remember three principles in your mind…
From the customer’s point of view, the application shouldn’t be complicated, it should be
pleasing, and it should address most of their problems.
From a business aspect, your web application should stay aligned with its product/market fit.
From an engineer’s perspective, the application should be scalable, functional, and it should
be able to bear high traffic loads.
We will discuss the above points in web application architecture and we will understand the
core concept, how the architecture works, its components, and types in detail.
Addresses a particular problem, even if it’s simply finding some information As interactive as
a desktop application Works with Content Management System.
If we talk about the website, then traditionally it’s just a combination of static pages. A
website becomes a web application when it consists of both static and dynamic pages (yes!!
it’s true that all modern websites are the example of web applications.)
Web application architecture is a mechanism that gives us a clarification that how the
connection is established between the client and the server. It determines how the
components in an application communicate with each other. It doesn’t matter what is the
size and the complexity level of the application is, they all follow the same principle only the
details may differ.
In technical terms, 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. Web Application Architecture is a framework that ties up this
relation together and maintains the interaction between these components.
When a user interacts with a website and gets the response back from the server’s end, the
whole process executes within a few seconds. The most important thing we need to notice
here is the code which has been passed to the browser. This code may or may not have
particular instructions telling the browser how to respond with respect to the different types
of user inputs. That’s why a web application architecture includes all the sub-components
and external applications interchanges for an entire software application. A web application
architecture has to deal with the reliability, scalability, security, and robustness due to a
large amount of global network traffic.
How Does the Web Request Work?
Let’s take an example that you want to visit Flipkart.com.
You enter flipkart.com in your browser: When you type the URL in your web
browser and hit enter the web browser needs to know the address of the server
where the page is located. So it sends the request to the DNS (Domain Name
Server, which is a storehouse of domain names and their IP addresses). After
that browser sends the request to the found IP address using the HTTPS
protocol. If you already have visited Flipkart.com earlier from the same browser,
then it will pull the address from the cache.
The web server processes the request: In the next step, the webserver sends
the request to the storage area to locate the page and all data that follows with it.
Here the Business logic (also called Domain Logic and Application Logic) comes
in the picture. BL takes the responsibility of routing which means how each piece
of data is accessed. It regulates this workflow specifically for each application. As
BL processes the request, it sends it to storage to locate the looked-for data.
You get the response back: When the response travels back, it displays in front
of your screen. The web page (graphical interface) for any website which is
displayed on your screen is called the front end of an application. Here you see
all the UI and UX components to access the information.
Code that runs in the browser and works as per the inputs of the user.
While working on the web application, a web developer decides the functions of
the code on the server and the functions of the code on the browser. They also
define how these two will function in relation to each other. Server-side code can
be written using the languages Python, JavaScript, C#, PHP, Ruby on Rails, etc.
Any code can have the capability to run on the server if it can respond to HTTP
requests. The server-side code is mainly responsible for creating the page which
the user has requested. It also stores different types of data such as user profiles,
tweets, pages, etc. Server-side code can not be seen by the end-user (except
within a rare malfunction)
Presentation Layer: This layer is accessible to the client via a browser and it
includes user interface components and UI process components. As we have
already discussed that these UI components are built with HTML, CSS, and
JavaScript (and its frameworks or library) where each of them plays a different
role in building the user interface.
Some other parts of the web application which is separated from the main layers
that exist in the architecture are…
AJAX, Asynchronous JavaScript, and XML are mainly used for page
communication.
Users can continue the interaction with the page while the contents are updated
on the page (faster interaction).
2. Microservices: These are small and lightweight services that execute specific,
single functionality. The components in the applications are not dependent on
each other, so there is no need to develop each component using the same
programming language. This gives the flexibility to the developers to choose the
language or technology stack of their own choice. It enhances the productivity of
the developers and speeds up the development process.
1. Introduction
From an engineering point of view, networks typically consider the OSI model or the TCP/IP
model to define and organize their operation. These models, in turn, contemplate different layers,
such as the network layer, the transport layer, and the application layer.
Each network layer has particular protocols that implement a myriad of functionalities. Examples
are the IP at the network layer, TCP and UDP at the transport layer, and HTTP at the
application layer.
These protocols evolve, thus being updated and extended over time. So, it is natural that
network protocols have multiple versions.
In this context, this tutorial holistically explores the HTTP application protocol. First, we’ll have a
brief review of application protocols. Thus, we’ll study the general purposes of HTTP. Finally,
we’ll see the main differences among the HTTP versions and compare them in a systematic
summary.
In practice, the application layer is the closest layer to the user. So, it is in the application layer
that, for example, clients of e-mail, streams, and browsers operate.
Client-Server: the main characteristic of the client-server architecture is to have multiple clients
requesting and receiving services from a centralized server
Hybrid: an architecture that employs both servers and peers to execute operations
Naturally, the application layer uses the functionalities of the lower layers. For example,
application protocols assume that other layers tackle the communication with the correct
destination computer connected in the network.
Finally, some examples of popular application layer protocols are HTTP, FTP, TELNET, POP,
DNS, and SMTP.
The Hypertext Transfer Protocol
HTTP is an application protocol (layer 7 OSI and layer 4 TCP/IP) employed
to create distributed hypermedia systems. Since it operates on the application layer,
it is agnostic of several networking aspects, such as addressing and transmission.
Historically, HTTP emerged as a simple protocol to enable communication between clients and
servers over the Internet. From its release, HTTP became one of the most relevant protocols to
exchange information on the World Wide Web.
In this way, HTTP has been used on the Internet since the ’90s. The first release of HTTP (0.9)
was much limited. This version only enabled clients to request information from a server using a
single operation: GET.
The first HTTP release only supported transmitting ASCII data. However, in the following
releases, this support expanded to other data types.
In the following subsections, we’ll explore each released version of HTTP, from 1.0 to 3.0,
focusing on their particular characteristics and novelty compared to the previously released
version.
As previously presented, the first version of HTTP only allowed getting information from a server.
However, it became insufficient as the Internet evolved and new functionalities arose.
In this context, version 1.0 of HTTP was released in 1996, about five years
after version 0.9.
Version 1.0 of HTTP brings several new utilities. Let’s see some of them:
Header: only the method and the resource name composed an HTTP 0.9 request. HTTP 1.0,
in turn, introduced the HTTP header, thus allowing the transmission of metadata that made the
protocol flexible and extensible
Versioning: the HTTP requests explicitly informs the employed version, appending it in the
request line
Status code: HTTP responses now contain a status code, thus enabling the receiver to check
the request processing status (successful or failed)
Content-type: thanks to the HTTP header, in specific to the Content-Type field, HTTP can
transmit other documents types than a plain HTML file
New methods: besides GET, HTTP 1.0 provides two new methods (POST and HEAD)
In summary, HTTP 1.0 got much more robust than the 0.9 version. The most
responsible for the protocol improvements are the HTTP header and the new HTTP methods.
So, the HTTP header enabled clients to send and receive different file types and exchange
relevant metadata. The new methods, in turn, enabled the clients to both recover only the
metadata about a document (HEAD) and transfer data from the client to the server (POST).
Version 1.1 of HTTP was released in 1997, only one year after the previous
version 1.0. HTTP 1.1 is an enhancement of HTTP 1.0, providing several extensions.
Host header: HTTP 1.0 does not officially require the host header. HTTP 1.1 requires it by
the specification. The host header is specially important to route messages through proxy
servers, allowing to distinguish domains that point to the same IP
Persistent connections: in HTTP 1.0, each request/response pair requires opening a new
connection. In HTTP 1.1, it is possible to execute several requests using a single connection
Continue status: to avoid servers refusing un processable requests, now clients can first
send only the request headers and check if they receive a continue status code (100)
New methods: besides the already available methods of HTTP 1.0, the 1.1 version added
six extra methods: PUT, PATCH, DELETE, CONNECT, TRACE, and OPTIONS
In addition to the highlighted enhancements, there are many others introduced in version 1.1 of
HTTP, such as compression and decompression, multi-language support, and byte-range
transfers.
The HTTP CONNECT can create a tunnel through a proxy server. TRACE executes a loopback
test in the path from a client to the destination server. Finally, OPTIONS returns information
about the available communications options with the server.
Stateless nature of the protocol
As HTTP is a stateless then how to maintain the session between web browser and web
server?
HTTP is a "stateless" protocol which means each time a client retrieves a Webpage, the client
opens a separate connection to the Web server and the server automatically does not keep any
record of previous client request.
Cookies
A webserver can assign a unique session ID as a cookie to each web client and for subsequent
requests from the client they can be recognized using the received cookie.
This may not be an effective way as the browser at times does not support a cookie. It is not
recommended to use this procedure to maintain the sessions.
This entry means that, when the form is submitted, the specified name and value are
automatically included in the GET or the POST data. Each time the web browser sends the
request back, the session_id value can be used to keep the track of different web browsers.
This can be an effective way of keeping track of the session but clicking on a regular (<A
HREF...>) hypertext link does not result in a form submission, so hidden form fields also cannot
support general session tracking.
URL Rewriting
You can append some extra data at the end of each URL. This data identifies the session; the
server can associate that session identifier with the data it has stored about that session.
URL rewriting is a better way to maintain sessions and works for the browsers when they don't
support cookies. The drawback here is that you will have to generate every URL dynamically to
assign a session ID though page is a simple static HTML page.
HTTP Request Methods (GET, POST, HEAD, PUT, DELETE)
What is HTTP?
The Hypertext Transfer Protocol (HTTP) is designed to enable communications between clients
and servers. HTTP works as a request-response protocol between a client and server.
Example: A client (browser) sends an HTTP request to the server; then the server returns a
response to the client. The response contains status information about the request and may
also contain the requested content. The HTTP Methods is as follows:
➢ GET
➢ POST
➢ PUT
➢ HEAD
➢ DELETE
➢ PATCH
➢ OPTIONS
➢ CONNECT
➢ TRACE
The two most common HTTP methods are: GET and POST.
Status codes
HTTP status codes are three-digit responses from the server to the browser-side request. Eve-
ryone has probably gotten the classic 404 page-not-found error. That is an HTTP client error
status code and there are a lot more of them.
These status codes (also called response status codes) serve as a means of communication
between the server and the internet browser and there are multiple code classes based on the
type of information they are communicating. The differences in classes are indicated through the
first digit of the error code, for example: just like a 404, any other 4xx will mean that in some
way the page or website could not be reached, while a 2xx means that your request was suc-
cessfully completed.
2xx Succesful
200 OK
201 Created
202 Accepted
203 Non-Authoritative Information
204 No Content
205 Reset Content
206 Partial Content
207 Multi-Status
208 Already Reported
226 IM Used
3xx Redirection
What is HTTPS?
Hypertext transfer protocol secure (HTTPS) is the secure version of HTTP, which is the primary
protocol used to send data between a web browser and a website. HTTPS is encrypted in order
to increase security of data transfer. This is particularly important when users transmit sensitive
data, such as by logging into a bank account, email service, or health insurance provider.
Any website, especially those that require login credentials, should use HTTPS. In modern web
browsers such as Chrome, websites that do not use HTTPS are marked differently than those
that are. Look for a padlock in the URL bar to signify the webpage is secure. Web browsers take
HTTPS seriously; Google Chrome and other browsers flag all non-HTTPS websites as not se-
cure.
With HTTPS, traffic is encrypted such that even if the packets are sniffed or otherwise intercept-
ed, they will come across as nonsensical characters. Let’s look at an example:
Before encryption:
This is a string of text that is completely readable
After encryption:
ITM0IRyiEhVpa6VnKyExMiEgNveroyWBPlgGyfkflYjDaaFf/Kn3bo3OfghBPDWo6AfSHlNtL8
N7ITEwIXc1gU5X73xMsJormzzXlwOyrCs+9XCPk63Y+z0=
In websites without HTTPS, it is possible for Internet service providers (ISPs) or other interme-
diaries to inject content into webpages without the approval of the website owner. This common-
ly takes the form of advertising, where an ISP looking to increase revenue injects paid advertis-
ing into the webpages of their customers. Unsurprisingly, when this occurs, the profits for the
advertisements and the quality control of those advertisements are in no way shared with the
website owner. HTTPS eliminates the ability of unmoderated third parties to inject advertising
into web content.
(In networking, a port is a virtual software-based point where network connections start and end.
All network-connected computers expose a number of ports to enable them to receive traffic.
Each port is associated with a specific process or service, and different protocols use different
ports.)
When a user connects to a webpage, the webpage will send over its SSL certificate which con-
tains the public key necessary to start the secure session. The two computers, the client and the
server, then go through a process called an SSL/TLS handshake, which is a series of back-and-
forth communications used to establish a secure connection. To take a deeper dive into encryp-
tion and the SSL/TLS handshake, read about what happens in a TLS handshake.
All websites using Cloudflare receive HTTPS for free using a shared certificate (the technical
term for this is a multi-domain SSL certificate). Setting up a free account will guarantee a web
property receives continually updated HTTPS protection. You can also explore our paid plans
for individual certificates and other features. In either case, a web property receives all the
benefits of using HTTPS.
getElementsByTagName() returns all the elements having the given tag name.
getElementsByClassName() returns all the elements having the given class name.
<form name="form1">
Enter Name:<input type="text" name="name"/>
<input type="button" onclick="printvalue()" value="print name"/>
</form>
Events
HTML has the ability to let events trigger actions in a browser, like starting a JavaScript when a
user clicks on an element. To learn more about programming events, please visit our JavaScript
tutorial. Below are the global event attributes that can be added to HTML elements to define
event actions.