Lecture 8: Introduction to Server-side Technologies

Web Programming

J Mwaura

Lecture Outline

  1. Introduction to server-side technology
  2. Introduction to databases
  3. Introduction to servers

Server-side Technology

Client-side technologies can be faster and safer than server-side technologies; however they are limited in functionality and cannot interact with permanent storage such as a database

Server-side technologies are required, if the web-application requires permanent storage

Server-side Technology

Server-side technologies encompass a range of software solutions, mainly;

  • Server-side scripting languages
  • Database Management Systems (DBMS)
  • Web server software such as Apache

Web-service software solution stack

Web service software solution stack e.g. LAMP - include 4 components: an operating system; a web-server instance; a database management system and a server-side scripting language

  1. L (OS) - refers to server's operating system e.g., Linux (LAMP), Windows (WAMP), or Mac OS X (MAMP)
  2. A (Apache) - Apache is still the most commonly used web-server software; however others are available such as NGINX

Web-service software solution stack

  1. M (MySQL) - MySQL is a widely used Relational Database Management System (RDBMS). Others include; PostgreSQL, SQLite or Oracle
  2. P (PHP) - PHP is a server side scripting language that has the ability to connect to and query a database using query language (such as SQL for MySQL, or PGSQL for PostgreSQL). Other server-side scripting languages such as Ruby, Python or Perl

Case: Facebook log-in process works

  1. The Facebook login URL is entered in a web browser address bar which initiates a HTTP request from the client machine to Facebook's server which is running the Apache web server software
  2. Upon receiving the request, the Facebook Apache Server responds with a HTTP response containing a static webpage containing a log-in form

Case: Facebook log-in process works

  1. Log-in credentials are entered and the 'Submit' button is clicked calling (probably) some Javascript validation. The credentials are passed to a PHP which establishes a secure connection to the Facebook server-side Database Management System using a query language such as SQL
  2. Once a secure connection has been established an SQL query is called which checks if the user-credentials match a user in the database. If so, a series of server-side processes occur to compile the user profile and display it in the browser. If not, PHP returns an error and the user is asked to try again

The Apache HTTP Server

Apache is a free and open source cross-platform web server and is currently the world's most commonly used web server software

Apache can be configured to suit the needs of the user/application and is highly extensible

Compiled modules extend the core functionality, ranging from server-side language support, such as PHP, Perl and Python, to authentication schemes such as mod_access and mod_digest

Database Management Systems (DBMS)

In this course we will make use of DBMS PostgreSQL (known as Postgres)

Postgres is an open-source, platform independent DBMS which is also highly scalable, so suitable for a range from large internet facing applications to single machine applications

Postgres has spatial extension for the use of geographic data types known as PostGIS

Database Management Systems (DBMS)

A Database Management System (DBMS) is a piece of software that sits in front of the database and allows a user to interact with the data itself

DBMS is the Graphical User Interface (GUI) and the Database is the data holding software itself

Relational Databases

A relational database is an organised collection of related data made up of a number of strictly defined tables (relations)

A well-designed database would reduce the amount of data redundancy by adhering to database normalisation rules which ensure the data is stored as efficiently as possible

PGAdmin

PGAdmin is a cross-platform administration and development platform for the PostgreSQL database

PGAdmin allows the user to quickly view and filter data through its GUI and query data with the syntax highlighting SQL editor

Learn or refresh PostgreSQL+PostGIS and pgAdmin

Structured Query Language

The Structured Query Language is a special purpose query language used to manage data held in a relational database, such as PostgreSQL

SQL provides functionality such as; SELECT, UPDATE, INSERT and DELETE

The Request/Response Procedure

The basic client/server request/response sequence

The Request/Response Procedure

A dynamic client/server request/response sequence

Example - Cluster Map Marker

End of Lecture 8

Web Programming

That's it!

Queries about this Lesson, please send them to: jmwaura@jkuat.ac.ke

*References*

  • Google Maps; Power Tools for Maximizing the API, 2014 Evangelos Petroutsos
  • D3 Tips and Tricks; Interactive Data Visualization in a Web Browser, 2013 Malcolm Maclean
  • Interactive Data Visualization for the Web, 2013 Scott Murray
  • Web Programming with HTML5, CSS, and JavaScript, 2019 John Dean
  • Leaflet Documentation Leaflet Team
  • Google Documentation for developers Google Team
Courtesy of
Web Programming