Web Stack Series Part 3: The Database
Parts 1 and 2 of our look at the Web Stack introduced us to the Physical Server and the Webserver Software. Part 3 of the series brings us to the second piece of software installed on the physical server: the Database.
Dynamic, database-driven web sites have become the gold standard on the Web. Sites are updated in real time, user-generated content fills ever page, custom-tailored data targets specific users, and data is changed on the fly - all thanks to the database. It is rare to find a website that doesn’t make use of a database in some way or another. The database has become the brain of the modern web site.
So what is a database? Let’s check in with our old pal Wikipedia for a quick and dirty definition:
In computing, a database can be defined as a structured collection of records or data that is stored in a computer so that a program can consult it to answer queries.
Though this may sound simplistic, the definition is spot on. A database is nothing more than a bunch of data (usually plain text) stored and indexed in a structured manner. This allows for specific data to be found quickly and painlessly. Perhaps an analogy is in order: A library is like a database - it is a central repository of books stored in a structured system (Dewey Decimal). This system makes it easy for a person to quickly find a specific book.
The larger and more complex sites on the internet typically store all of their content in a database and retrieve the appropriate data when necessary. The web page that is requested by the user is said to “query” the database for the appropriate data to be displayed. Databases can be queried using a special language called Structured Query Language or “SQL” (pronounced like “sequel”). SQL is simply a special type of language that makes it easy and intuitive to extract data from a database. There are people who spend their entire careers mastering SQL, although you can probably teach yourself the basics of SQL in about a month or two.
Here are a couple of things you should know about database systems:
- Just like a webserver, the database system is just another piece of software
Database server software is installed on the physical server. Once installed, the database is turned on and left to run indefinitely in the background - Database systems range in price from free (MySQL, PostgreSQL) to really, really, really expensive (Oracle, Microsoft SQL Server)
The majority of small to medium sites on the Web today are run on MySQL. This is a natural consequence of it being free and easy to use. If you were to ask my opinion, I would always recommend MySQL, I love it. - Database optimization is absolutely crucial if you want your web site to scale gracefully and handle high traffic loads
Don’t be bashful about spending some money on a good developer who understands how to set up a database system properly. When your site explodes in popularity and handles all of the traffic without a hiccup, you will be thankful you did.
In the next part of this series, we will talk about the glue that connects the user, the webserver and the database all together. Make sure you are subscribed so you don’t miss out!
Subscribe to the RSS Feed
Add Your Comments!
- Solo Signal Series: The Web Stack Explained
- Web Stack Series Part 4: Business Logic Programming
- Web Stack Series Part 1: The Physical Server
Tagged:
databases, definitions, microsoft, mysql, optimization, oracle, reference, web stack
Comments
Web Stack Series Part 2: Webserver Software
Part 2 of The Web Stack Explained leads us to the webserver software. Webserver software basically serves as the interface for files stored on the server. Let’s start things of with a good, but rather stuffy definition of the word “webserver” from Wikipedia:
A computer program that is responsible for accepting HTTP requests from clients, which are known as Web browsers, and serving them HTTP responses along with optional data contents, which usually are Web pages such as HTML documents and linked objects (images, etc.).
Now, let’s break this down piece by piece:
- A computer program
A webserver is a computer program, just the same as WinZip and Solitaire. Webservers can be downloaded and installed just like anything else you place on your computer. They are responsible for serving requests for websites, hence the term: web - server. Webserver software is usually run differently than the programs you are familiar with. Since your server can’t predict when someone wants to view your web page, the webserver software must be constantly listening for requests. As a result, the webserver software is started up and then left to quietly run in the background indefinitely. When a request is received, the webserver processes the request, fetches the pages and files that were requested, and sends them all back to the person doing the requesting. - HTTP Requests
HTTP stands for HyperText Transfer Protocol - but you don’t care. And quite frankly you don’t need to care. Just think of HTTP as the ether that lets computers talk to each other over the Web. Requests are messages sent by users to your webserver. Whenever someone types a URL in their web browser, they are making a request to the webserver associated with that URL. The webserver catches this request and then acts accordingly. - Clients, or Web Browsers
If “server” refers to webservers, then “client” refers to web browsers. Web browsers are the software programs used to surf the web. Microsoft Internet Explorer and Mozilla Firefox are the two most popular these days. Web browsers are translators: they translate human requests for web sites into requests that webserver software can process. When the webserver processes the request and sends back the appropriate information, the user’s web browser displays it in all its glory. - HTTP Responses
HTTP responses are what webservers send back to web browsers after a request is made. These responses typically contain the web pages, images and files that were requested by the user. - Web pages
The final pieces of the puzzle. Web pages are the files stored on the server that users request. These are typically text files full of HTML and other markup. Your web browser is designed to translate these files into the correctly formatted web pages that you view.
There are several brands of webserver software available, but the two most popular are Apache HTTP Server and Microsoft Internet Information Services server. Although the primary responsibility of the webserver software is to fetch and return the appropriate website files, there is another function: running other software required by the files themselves. This other software is typically a script engine, and we will talk about that in our next Web Stack Series installment!
Subscribe to the RSS Feed
Add Your Comments!
- Solo Signal Series: The Web Stack Explained
- Web Stack Series Part 3: The Database
- Web Stack Series Part 1: The Physical Server
Tagged:
apache, definitions, http, microsoft, web stack, webserver



















