Chapter 2 Database Terms and Concepts
Database computing concepts
This section describes how database applications and the database
server work together to manage databases.
Any information system contains the following pieces:
- A database Data is stored in a database. An Adaptive Server Anywhere
database is a file, usually with an extension of db. Adaptive
Server Anywhere includes a sample database for you to work
with: asademo.db, which you can find in your
Adaptive Server Anywhere installation directory.
In the documentation, a database is indicated by a cylinder:
- A database server The database server manages the database. No other
applications address the database file directly; they all communicate
with the database server.
In the documentation, a database server is indicated as follows:
Adaptive Server Anywhere provides two versions of its database
server: the personal database server and
the network database server. In addition
to the features of the personal server, the network server supports client/server
communications across a network. The request-processing engine is
identical in the two servers.
- A language interface Applications communicate with the database server
using an interface. You can use ODBC, JDBC, Sybase Open Client,
or Embedded SQL.
The language interface provides a set of function calls for
communicating with the database. For ODBC and JDBC, the library
is commonly called a driver. The interface
is typically provided as a shared library on UNIX operating systems
or a dynamic link library (DLL) on PCs. The JDBC interface uses
the Sybase jConnect driver, which is a zip file of compiled Java
classes.
If you are working with an Adaptive Server Anywhere network
server, the language interface resides on the client computer.
- A client application Client applications use one of the language interfaces
to communicate with the database server.
If you develop an application using a rapid application development (RAD)
tool such as PowerStudio, you may find that the tool provides
its own methods for communicating with database servers, and hides the details
of the language interface. Nevertheless, all applications use one
of the supported interfaces.
In the documentation, a client application is indicated by
the following:
How the pieces fit together
A complete application on a single computer has the following
architecture:
In this case the database server is generally the personal
server, although you can also use applications on the same machine
as the network server.
A complete application in a client/server environment
has the following architecture:
In this case the database server is the network server, which
supports network communications. No changes are needed to the client
application for it to work in a client/server environment.
SQL and database computing
A client application carries out a database task, such as
retrieving information using a query or inserting a new row into
a table, by using Structured Query Language (SQL) statements. SQL,
pronounced "sequel," is a relational database
language that has been standardized by the ANSI and ISO standards bodies.
Depending on how you develop a client application, SQL statements
can be supplied in function calls from the programming language,
or you can build them graphically in a special window provided by
your application development tool.
The programming interface delivers the SQL statement to the
database server. The database server receives the statement and
executes it, returning any required information (such as query results)
back to the application.
Client/server communications protocols carry information
between the client application and the database server, and programming
interfaces define how an application sends the information. No matter
which interface and network protocol you use, it is SQL statements
that are sent to a server, and the results of SQL statements that
are returned to the client application.
Other files used by Adaptive Server Anywhere
In addition to the database file, Adaptive Server Anywhere
uses two other files when it is running a database. These are the
transaction log and the temporary file.
The transaction log
The transaction log contains a record of all the operations
performed on the database. Normally, it has the same name as the
database file, except that it ends with the suffix .log instead
of .db. It has three important functions.
- Record
operations on your data to enable recovery You can re-create your database from the transaction
log if the database file is damaged.
- Enable database replication SQL Remote can use this file to replicate your database
on portable computers which are sometimes, but not always, connected
to the network.
- Improve performance By writing information to the transaction log, the
database server can safely process your commands without writing
to the database file as frequently.
The temporary file
The temporary file is opened when the database server starts,
and is closed when the server stops. It is used while the server
is running to hold information that does not need to be kept between
sessions.
The temporary file is stored in your temporary directory,
which is generally identified by your TEMP environment variable.
Copyright © 2000 Sybase, Inc. All rights reserved.
|
|