form of structured storage that is suitable for large and high-traffic uses.
These databases have been written and put into use in places where flat
files are unsuitable but where relational databases are slower than desired.
It is important to note that although NoSQL databases work great when
scalability and speed are desirable, you cannot be certain with all NoSQL
databases that data is replicated and available instantly across a large
installation. It generally is, but there is no guarantee of up-to-the-moment
data. This is okay for some applications (web search) but would be
disastrous for others (like a financial institution).
There are many forms of NoSQL databases, each with different intents and
applications. Some are created and used by big names you might recognize,
such as Google’s BigTable and Apache’s Cassandra. Ubuntu uses Apache’s
CouchDB for several applications. Other common ones include MongoDB
and Berkeley DB. In this chapter, we concentrate on the more traditional
relational databases that are used for most applications, but we urge you to
keep an eye on what is happening in the NoSQL world. For more
information about NoSQL databases, see Chapter 29, “NoSQL Databases.”
Oracle, DB2, Microsoft SQL Server, and the freely available PostgreSQL and
MySQL are all examples of RDBMSs. The following sections discuss how
relational databases work and provide a closer look at some of the basic
processes involved in administering and using databases. You also learn about
SQL, the standard language used to store, retrieve, and manipulate database
data.
How Relational Databases Work
An RDBMS stores data in tables, which you can visualize as spreadsheets.
Each column in the table is a field; for example, a column might contain a
name or an address. Each row in the table is an individual record. The table
itself has a name you use to refer to that table when you want to get data out
of it or put data into it. Figure 28.1 shows an example of a simple relational
database that stores name and address information.
In the example shown in Figure 28.1, the database contains only a single
table. Most RDBMS setups are much more complex than this, with a single
database containing multiple tables. Figure 28.2 shows an example of a
database named sample_database that contains two tables.