A relational database is a set of data stored in one or more tables in a computer.
A table is a two-dimensional arrangement of data consisting of horizontal rows and vertical columns as shown in the following table. Each row contains a sequence of values, one for each column of the table. A column has a name and contains a particular data type (for example, character, decimal, or integer).
Item | Name | Supplier | Quantity |
---|---|---|---|
78476 | Baseball | ACME | 650 |
78477 | Football | Imperial | 228 |
78478 | Basketball | ACME | 105 |
78479 | Soccer ball | ACME | 307 |
Tables can be defined and accessed in several ways on the server. One way to describe and access tables on the server is to use a language like Structured Query Language (SQL). SQL is the standard IBM® database language and provides the necessary consistency to enable distributed data processing across different servers.
Another way to describe and access tables on the server is to describe physical and logical files using data description specifications (DDS) and access tables using file interfaces (for example, read and write high-level language statements).
SQL uses different terminology from that used on the iSeries™ server. For most SQL objects there is a corresponding server object on the iSeries server. The following table shows the relationship between SQL relational database terms and iSeries server terms.
|
A distributed relational database exists when the application programs that use the data and the data itself are located on different machines, or when the programs use data that is located on multiple databases on the same server. In the latter case, the database is distributed in the sense that DRDA® protocols are used to access one or more of the databases within the single server. The connection to a database in such an environment will be one of two types: local or DRDA. There will be, at most, only one local database connection at one time. One simple form of a distributed relational database is shown in the following figure where the application program runs on one machine, and the data is located on a remote server.
When using a distributed relational database, the system on which the application program is run is called the application requester (AR), and the system on which the remote data resides is called the application server (AS). The term client is often used interchangeably with AR, and server with AS.
A unit of work is one or more database requests and the associated processing that make up a completed piece of work as shown in the following figure. A simple example is taking a part from stock in an inventory control application program. An inventory program can tentatively remove an item from a shop inventory account table and then add that item to a parts reorder table at the same location. The term transaction is another expression used to describe the unit of work concept.
In the preceding example, the unit of work is not complete until the part is both removed from the shop inventory account table and added to a reorder table. When the requests are complete, the application program can commit the unit of work. This means that any database changes associated with the unit of work are made permanent.
With unit of work support, the application program can also roll back changes to a unit of work. If a unit of work is rolled back, the changes made since the last commit or rollback operation are not applied. Thus, the application program treats the set of requests to a database as a unit.