Lesson Weekend

Before this week, data for our programs has been stored using either objects in our code or in session data in our browser. The memory space this information has inhabited in our computer is called random-access memory, or RAM. RAM is a fast, temporary place to store information, but is not suitable for long-term storage. We also learned how to store data with Silex using the superGlobal variable, $_SESSION. Both of these are great solutions for storing information you don't need to keep around indefinitely. As you undoubtedly experienced for the past two weeks, if you shut down your server and re-launch your application, most of your program's data is gone!

Anything we want to have saved after our programs end and our machines have been powered off needs to be written to permanent storage. Beginning this week, we will begin saving data in full-blown databases!

We'll begin by learning about SQL, or Structured Query Language, and how to use it with PostgresSQL through MAMP. Then, we'll cover how to setup and configure our very own databases, including best practices for naming and data organization/architecture. After that, we'll explore connecting databases to our PHP applications, so our data can persist indefinitely.

By the end of the week you'll be able to:

  • Create an application in Silex that uses two databases: one to store user information, and one for our tests.
  • Update and delete instances in our Silex apps with the HTTP requests PATCH/PUT and DELETE.
  • Use routing in a way that represents accurately the information you have saved (RESTful routing).
  • Build and query complex relational databases with special queries called JOIN statements.

Independent Project Objectives

This week's independent project will be reviewed on the following criteria:

  • Do the database table and column names follow proper naming conventions?
  • Is there a one-to-many relationship set up correctly in the database?
  • Is CRUD functionality included for each class in Silex?
  • Are RESTful routes used in Silex?
  • Does the code and Git documentation follow best practices?
  • Have all of the standards from previous weeks been met?
  • If prompted, are you able to discuss the flow of your code and concepts behind it with an instructor using the correct terminology?
  • Is the project in a polished, portfolio-quality state?
  • Does the application work as expected?