First Guide to SQL Anywhere Studio
PART 1. First Steps
CHAPTER 2. Database Terms and 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. SQL Anywhere Studio includes a sample database for you to work with: this is the file asademo.db in your Adaptive Server Anywhere installation directory.
In diagrams 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 diagrams 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.
For more information about these two versions of the server, see The Adaptive Server Anywhere database server.
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 PC operating systems. 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 one of the Powersoft PowerStudio tools, you may find that the tool provides its own methods for communicating with database servers, and hide the details of the language interface. Nevertheless, all applications do use one of the supported interfaces.
In diagrams in the documentation, a client application is indicated by the following:
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.
When a client application wants to carry out a database task, such as retrieving information using a query or inserting a new row into a table, it does so 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 could be supplied in function calls from the programming language, or you may 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 what interface you use, and what 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.
For an introduction to SQL see the chapters beginning with Selecting Data from Database Tables.
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 is a separate file, which 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 recreate 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 is opened when the database server starts, and is closed down when the server stops. As its name suggests, the temporary file is used while the server is running to hold temporary information. The temporary file holds no information that needs to be kept between sessions.
The temporary file is stored in your temporary directory. The location of this directory is generally identified by your TEMP environment variable.