Web Fundamentals in dbms

What are the Web Fundamentals in dbms? What is a Uniform resource locator? What is HyperText Markup Language? What are Web Servers and Sessions
Web Fundamentals in dbms
Learn about Web Fundamentals
If you want to know more about these topics, don't worry I will help😄. Today, in this post, I will tell you some of the fundamental technology behind the World Wide Web. So let's begin-


What is Uniform Resource Locator?

Uniform Resource Locator (URL) (Web Fundamentals)
What is URL?
A uniform resource locator (URL) is a globally unique name for every document that can be accessed on the web. 

An example of a  URL is: 

http://www.acm.org/sigmod 

The primary part of the URL indicates how the document is to be accessed: "http" indicates that the document is to be accessed by the HyperText Transfer Protocol (HTTP), which is a protocol for transferring HTML documents. 
Tabular data in HTML format (Web develpment)
Tabular data in HTML format
The second part gives the name of a machine that has a Web server. The remainder of the URL is the path name of the file on the machine, or different unique identifier of a document within the machine. 

A URL can contain the identifier of a program located on the Web server machine, as well as arguments to be given to the program. 

An example of such a URL is 

http://www.google.com/search?q=silberschatz 

which says that the program search on the server www.google.com should be executed with the argument q=silberschatz

On receiving an invitation for such a URL, the Web server executes the program, using the given arguments. The program returns a HTML document to the Web server, that sends it back to the front end. 

What is HyperText Markup Language? 

Image below shows the displayed image generated by a browser from the HTML illustration of the table above. The HTML source shows a couple of of the HTML tags. 
Display of HTML source from table (Web Fundamentals)
Image in a browser through HTML representation of table
Each HTML page should be enclosed in an html tag, whereas the body of the page is enclosed in a body tag. 

A table is specified by a table tag, that contains rows specified by a tr tag. The header row of the table has table cells specified by a th tag, whereas regular rows have table cells specified by a td tag. 

Image below shows a way to specify an HTML type that permits users to pick the person type (student or instructor) from a menu and to input a number in a text box. 

Two ways of accepting input are illustrated in the form, however HTML additionally supports many different input ways. 

The action attribute of the form tag specifies that once the form is submitted (by clicking on the submit button), the form information should be sent to the URL PersonQuery (the URL is relative to that of the page). 

The Web server is organized such that when this URL is accessed, a corresponding application program is invoked, with the user-provided values for the arguments persontype and name (specified within the select and input fields). 

The application program generates an HTML document, which is then sent back and displayed to the user; we shall see how to construct such programs later in the upcoming posts. 
HTML (Web Fundamentals)

HTTP defines two ways in which values entered by a user at the browser can be sent to the Web server. The get method encodes the values as a part of the URL. 

For instance, if the Google search page used a form with an input parameter named q with the get method, and the user typed in the string "silberschatz" and submitted the form, the browser would request the subsequent URL from the Web server:         

http://www.google.com/search?q=silberschatz 

The post method would instead send a request for the URL http://www.google.com, and send the parameter values as a part of the HTTP protocol exchange between the Web server and the browser. 

Although HTML code can be created using a plain text editor, there are variety of editors that let direct creation of HTML text by using a graphical interface. 

Such editors allow constructs like forms, menus, and tables to be inserted into the HTML document from a menu of choices, rather than manually typeing the code to come up with the constructs. 

HTML supports stylesheets, which can alter the default definitions of how an HTML formatting construct is displayed, as well as different display attributes like background color of the page. 

The cascading stylesheet (CSS) standard permits the same stylesheet to be used for multiple HTML documents, giving a particular but uniform look to all the pages on the Web site. 

What are Web Servers and Sessions?


A Web Server is a program running on the server machine, that accepts requests from a Web browser and sends back results in the form of HTML documents. 
Three-layer Web application architecture (Web Fundamentals)
Three-layer Web application architecture
The browser and Web server communicate via HTTP. Web servers offer powerful features, beyond the easy transfer of documents. 

The most important feature is the ability to execute programs, with arguments provided by the user, and to deliver the results back as an HTML document. 

As a result, a Web server can act as an intermediary to supply access to a variety of data services. A brand new service can be created by making and installing an application program that provides the service. 

The common gateway interface (CGI) standard defines how the Web server communicates with application programs. 

The application program usually communicates with a database server, through ODBC, JDBC, or different protocols, in order to get or store data.

Image above shows a Web application designed using a three-layer design, with a Web server, an application server, and a database server. 

Using multiple levels of servers increases system overhead; the CGI interface starts a new process to service every request, which ends up in even larger overhead. 

Most Web applications these days thus use a two-layer Web application architecture, where the application program runs within the Web server, as in image below. 

There is no continuous connection between the client and the Web server; once a Web server receives a request, a connection is temporarily created to send the request and receive the response from the Web server. 

But the connection may then be closed, and the next request could come over a new connection. 

In distinction, once a user logs on to a computer, or connects to a database using ODBC or JDBC, a session is formed, and session data is maintained at the server and the client till the session is terminated-information like the user-identifier of the user and session choices that the user has set. 

One vital reason that HTTP is connectionless is that the majority computers have limits on the quantity of simultaneous connections they can accommodate, and if an oversized variety of websites on the Web open connections to one server, this limit would be exceeded, denying service to additional users. 

With a connectionless protocol, the connection can be broken as soon as request is satisfied, leaving connections out there for alternative requests. 

Most Web applications, however, need session data to permit meaningful user interaction. As an example, applications usually prohibit access to information, and thus need to certify users. 

Authentication should be done once per session, and more interactions within the session must not need reauthentication. 
Two-layer Web application architecture (Web Fundamentals)
Two-layer Web application architecture
To implement sessions in spite of connections getting closed, further information should be stored at the client and returned with every request in a session; the server uses this data to spot that a request is part of a user session. 

Extra data regarding the session also should be maintained at the server. This extra data is typically maintained in the form of a cookie (you thought🍪 right?) at the client; a cookie is just a tiny piece of text containing identifying data and with an associated name. 

As an example, google.com may set a cookie with the name prefs, that encodes preferences set by the user like the preferred language and also the number of answers displayed per page. 

On every search request, google.com can retrieve the cookie named prefs from the user's browser, and show results according to the required preferences. 

A domain (Web site) is allowable to retrieve only cookies that it has set, not cookies set by different domains, and cookie names can be reused across domains. 

For the purpose of tracking a user session, an application may generate a session identifier (usually a random number not currently in use as a session identifier), and send a cookie named (for instance) sessionid containing the session identifier. 

The session identifier is additionally stored locally at the server. Once a request comes in, the application server requests the cookie named sessionid from the client. 

If the client doesn't have the cookie stored, or returns a value that's not currently recorded as a legitimate session identifier at the server, the application concludes that the request isn't a part of a current session. 

If the cookie value matches a stored session identifier, the request is identified as part of an ongoing session. 

If an application needs to determine users firmly, it can set the cookie only after authenticating the user; as an example a user may be authenticated only if a legitimate user name and password are submitted.

For applications that don't need high security, like publicly available news sites, cookies can be stored permanently at the browser and at the server; they determine the user on future visits to the same website, without any identification data being typed in. 

For applications that need higher security, the server may invalidate (drop) the session after a time-out period, or once the user logs out. 

(Typically a user logs out by clicking on a logout button, that submits a logout form, whose action is to invalidate the current session.) 

Invalidating a session just consists of dropping the session identifier from the list of active sessions at the application server.


Check out our other posts and learn about database management system.




I hope you got your queries solved and if you still got any, feel free to comment it down below👇💬. Share this post with your friends to help them as well😉.



Newest
Previous
Next Post »

No comments:

Post a Comment

Please do not enter any spam links in comment box.