We will now look at why we would want to use a modern database engine and take a quick look at its performance and advantages.
The Case Against Simple Files or Spreadsheets
We touched on a few of these briefly, but there are a number of reasons we do not want to "roll our own" database engine with a text (or binary) file and self-written functions or classes.
By selecting a modern RDBMS, we are going to see solutions to all of these problems, including a few for which we might not have a need yet. Most database servers run as a background process (sometimes known as a service or daemon) on some server in your datacenter, perhaps even on the computer running your web server. You connect to the server by using a software library that knows how to make the connection, or via a client that will typically ship with the server software (though many people write more useful clients later). Figure 8-2 shows an example of this client-server interaction.
Figure 8-2. The client-server model of most modern RDBMSes.
The performance of the RDBMSes ranges from very good to spectacular. Large Internet sites with billions of records and complicated data relationships are using these database systems, and they can transfer data to and from storage at staggering rates.
All of the systems we will look at have robust systems for creating users and assigning to those users specific permissions for specific databases. Thus, some users might only have the ability to fetch data from a table, while others might have the ability to add or remove data, and some might even have the ability to create and destroy entire tables. Most systems will also let you specify from which hosts people may connect, further improving your security situation.
The ability to handle multiple requests or connections from multiple clients is critical in a production environment where multiple web servers or different web applications are trying to access the same data concurrently. In addition, most web servers support the concept of transactions, which you can use to group entire sequences of operations on the data as a logically atomic action.
All of the software we discuss in this book makes use of a standardized programming language for accessing the data in the databases. This language is called Structured Query Language (SQL, or "see-quel" for short); all of the servers support a common standard of the language known as ANSI SQL.
While there are wide variations in the full versions of the various SQL implementations, we are able to use most of our SQL code for our sample applications interchangeably between the different servers.
By having all of our data in a powerful DBMS, we open new doors for data analysis. Many of these systems come with features, tools, and other means by which we can analyze our data to look for trends, anomalies, or problems.