Day 1

CS 304: Databases with Web Interfaces

Introductions

What the course is about

Our goal is to learn just enough about enough things so that we can build complete web database applications.

The Three-Tier Architecture

The following is the classic picture, though I relied heavily on the figure in the Platypus book.

The Three-Tier Architecture

The red arrows are where we will concentrate most of our efforts. We will not primarily be involved with receiving HTTP requests or delivering the results (the blue arrows), but we will when we do work with Ajax.

Why a Three-Tier Architecture?

The Back End

In principle, any database management system (DBMS) can be used as the back end. We have chosen the MySQL software because:

It has its own quirks and limitations, but we'll do our best.

Middleware Technologies

In past offerings of this course, I've preferred to teach several different middleware technologies. This semester, we're going all-in on Flask.

Flask is one of many web frameworks, where a framework is some software infrastructure that recognizes common patterns in web applications and automates some of the more repetitive, tedious steps. Flask is actually a micro-framework (as opposed to larger frameworks like Django). To use Flask, we will implement our code in Python.

Other middleware:

If we have time, we may learn a little PHP/PDO, just because it's simple, easy and pretty good.

LAMP

Collectively, this suite (or "stack") of technologies goes by the acronym LAMP, for

(Interestingly, there is now competition from WAMP, where Windows replaces Linux. There's also MEAN, for MongoDB, Express.js, AngularJS and Node.js. We'll learn something about three of those later in the course.)

Three Tier in Action

Here are some slides showing the three tiers in action, as we'll use them in this course.


The calm before the storm...

user clicks on a button, submitting a form

Apache gets it, and hands it off to a PHP or CGI script.

The script sends SQL code to MySQL to get or modify data

The MySQL DBMS returns results to the script, often a table of data

The script can do as it pleases with the data, and give a response to Apache

Apache hands the response, which is HTML, CSS and JavaScript to the browser

And the round trip is complete.

In another situation, the browser might submit to a Flask server, which may be integrated with Apache.

Flask includes some code that you write to handle different routes (urls)

Your handler can connect to MySQL, sending it some SQL code

Again, the DBMS replies with a table of data

The flask application replies to the browser

Events Cal

Events Cal, built Grace Hu and Cece Tsui in Fall of 2016.

Syllabus Review

We'll take a look at the syllabus together, just to make sure we all understand the requirements of the course.

Then, we'll look at the schedule together. Highlights from the syllabus/schedule:

Pedagogical Approach

Class sessions are going to be as hands on as possible. If we don't get through everything, I'd like you to try to continue on your own, and we'll see where people get by next time.

Classes will not focus on a detailed and complete exposition of SQL, Python, or whatever the topic of the day is. We'll focus on understanding just enough to get that day's example working. I will expect you to refer to reference material for the details and particulars of the languages we'll be using.

Help me build up our FAQ! Don't hesitate to post to the Google group! Recommend entries for the FAQ.

Your Questions and Concerns?

What are they?

Books and Resources

To Do

For next time, please do the following:

Day 2

[an error occurred while processing this directive]

Day 3: MS Access

Day 4: DDL, Referential Integrity, Datatypes, Altering Tables

[an error occurred while processing this directive]

Day 5: ER Diagrams

[an error occurred while processing this directive]