Strictly speaking, a database is any collection of information that can be organized according to some set of attributes. This isn't limited to data stored on a computer, there are many examples of databases that are not computerized: card catalogs (obsolete), filing cabinets, wallets, newspaper stock listings, microfilm catalogs, almanacs, encyclopedias, and dictionaries are all databases. Even an alphabetized or date ordered bookshelf qualifies as a database, albeit not much of one. Common usage now restricts the term to computerized collections of data, though, so I'll focus on those for the remainder of this write-up.

First, while most people mean a relational database when they use the term database this is far from the only type of database that exists. There are also flat, network, hierarchical, and object databases. There are also specializations of the typical relational system such as temporal databases, data warehouses (really just huge relational systems), and several types of distributed relational systems that differ primarily in implementation details.


A flat database is one where the entire database is stored in a single file either on disk or in memory. It can be something as simple as a plain text file (such as /etc/shells on a linux box) or a binary data file such as a Berkeley DB. It can be formatted any way that the user needs it to be, but all information required for navigating the database is contained within a single file. Flat databases include the aforementioned /etc/shells as well as most address books and bookmark files.


A hierarchical database is one where the data is laid out in a in a tree fashion descending from a root node. One good example is a file system with its hierarchical directory structure. The Java class hierarchy can also be thought of as a hierarchical database.


A network database is, surprisingly, a database where the information is stored scattered about 2 or more nodes on a network. The foremost example of a non-relational network database is the Domain Name System, but any system where knowledge is distributed in a similar fashion is a network database.


An object database differs primarily by creating a notion of identity for the data. Each record in the system has a unique identifier that tags it. Everything else is supposed to use this identifier to refer to the object, rather than using qualifications on the data the object contains.


Currently the type of database that most people mean when they say database. A relational database system is just what it sounds like--a way to organize data according to the relations between various pieces of it. In a relational database the data is described as a series of tables that each contain a set of fields. For instance, if you needed to keep track of bibliographic data you might create tables called authors, publishers, and articles. The articles table would then have fields relating to both the publishers and authors tables in addition to fields specifying things such as the article's length, subject matter, or even the full text.