You are on page 1of 13

HTTP VS HTTPs

What is HTTP?
HTTP stands for Hypertext Transfer Protocol, and it is a protocol – or a prescribed order and
syntax for presenting information – used for transferring data over a network. Most
information that is sent over the Internet, including website content and API calls, uses the
HTTP protocol. There are two main kinds of HTTP messages: requests and responses.
In the OSI model, HTTP is a layer 7 protocol.

What is HTTPS?
The S in HTTPS stands for "secure." HTTPS uses TLS (or SSL) to encrypt HTTP requests
and responses, so in the example above, instead of the text, an attacker would see a bunch of
seemingly random characters.
Instead of:
GET /hello.txt HTTP/1.1
User-Agent: curl/7.63.0 libcurl/7.63.0
OpenSSL/1.1.l zlib/1.2.11
Host: www.example.com Accept-Language: en
The attacker sees something like:
t8Fw6T8UV81pQfyhDkhebbz7+oiwldr1j2gHBB3L3RFTRsQCpaSnSBZ78Vme+DpDVJPvZdZUZHpzbbcqmSW1+3xX
URI Vs URL Vs URN
1. URI stands for Uniform Resource identifier. URI is a sequence of characters
used to identify resource location or a name or both over the World Wide
Web. The most popular URI schemes, are HTTP, HTTPS, and FTP.
2. URL stands for Uniform Resource Location.URL is a subset of URI that
describes the network address or location where the source is available.URL
begins with the name of the protocol to be used for accessing the resource and
then specific resource location. 
3. A URN is a formal naming scheme that identifies a resource, but
does not indicate its location or how to access it (e.g. ISBN, ISSN).
question
What happens when you type something
in browser and hit enter?
3 Tier
• “3-tier architecture is a client-server
architecture in which the functional
process logic, data access, computer
data storage and user interface are
developed and maintained as
independent modules on separate
platforms.”
Layers of 3-Tier
• A “tier” in this case can also be referred
to as a “layer”. The three tiers, or layers,
involved include:
• A Presentation Layer that sends
content to browsers in the form of
HTML/JS/CSS. This might leverage
frameworks like React, Angular, Ember,
Aurora, etc
• An Application Layer that uses an
application server and processes the
business logic for the application. This might
be written in C#, Java, C++, Python, Ruby,
etc.
• A Data Layer which is a database
management system that provides access to
application data. This could be MSSQL,
MySQL, Oracle, or PostgreSQL, Mongo, etc
Web sites based on data

Web Client / user Web Server Database server


1. User
requests 2. HTTP request sent
a page 3. SQL query 4. Server
executes
Runs program
data returned query
or script
5. Server script
Response copies data in
Web page
HTML format
on screen

The “three tier architecture”


Run as slide show to see animated display .
3-Tier Architecture
Browser Web
client server
Browser sends Fetches file or runs
URL to web server,
requesting a file or Apache server side (php) script
program web
SQL programming interface:
server
SQL commands sent
- results returned
PHP 1
Server returns results
file and/or program outputs script
2
HTML5 CLI for PHP phpMyAdmin
CSS and mysql provides separate
PHP browser-based
HTML: Browser displays (renders) MySQL GUI interface
SQL
resulting page 3 Database
MySQL
JavaScript: executed by browser Javascript
HTTP (developer tools)
jQuery AJAX: ‘direct’ asynchronous AJAX, jQuery notation
web server connection JSON, web services
Full stack development
Integrated development

Command Line Interface (CLI)


mysql commands  performance
(eg in MobaXterm) provides
php in CLI error reporting
alternative DB interface

Also online meandeviation.com PHP syntax tool


Some technologies to use

Web Client / user Web Server Database server


Any Web browser
Client languages:
HTML, CSS, Apache (most popular)
JavaScript Server language:
PHP MySQL
Query language:
SQL

Bundled in the package


In practice: code
<html> 
 …
<body> 
  <h1>PHP and MySQL databases</h1> 

<?php 
$con = mysql_connect(“hostname","user","password"); 
mysql_select_db(“databasename", $con);
?> The lines in red are server commands,
Embedded in the HTML code.

http://www.boisvert.me.uk/run/elcid.html?
file=users/charles/PHP_and_MySQL.xml
(http://localhost/run/elcid.html?file=users/charles/PHP_and_MySQL.xml)
Benefits
Of
3-Tier
Architecture
• Three-Tier Architecture provides the following benefits.
• Scalability—Each tier can scale horizontally. For example, you
can load-balance the Presentation tier among three servers to
satisfy more Web requests without adding servers to the
Application and Data tiers.
• Performance—Because the Presentation tier can cache
requests, network utilization is minimized, and the load is
reduced on the Application and Data tiers. If needed, you can
load-balance any tier.
• Availability—If the Application tier server is down and caching
is sufficient, the Presentation tier can process Web requests
using the cache.
Limitations of 3 Tier

• You must manually push templates, assets, private assets,


uploaded images, and uploaded files from the Application tier to
the Presentation tier. You may use a tool like Robocopy to do
this.
• You create content (HTML, assets, PageBuilder pages, etc.)
only in the Application tier. You can only view content from
Presentation tier.
• Because Three-Tier Architecture uses WCF, it requires:
– the 8.5 Framework API and databinding. You cannot use API calls
outside of the Framework API.
– templated server controls.
– widgets created by the Framework API.
• Because the business logic executes on the Application tier, its
Web site directory must be identical to the Presentation tier's.
• Using eSync with three-tier architecture

You might also like