The Palm Computing platform uses a collection of databases, rather than a more traditional file system, to store applications and data. Nearly all of the memory in the handheld is devoted to database storage, and most information is accessed in place, without copying. The operating system only deals with blocks of memory, however, and does not impose any structure smaller than a record. The contents of each record are determined by the application; as far as the OS and synchronization protocols are concerned, each record is just an opaque collection of bytes.
Each database consists of several parts: a header, which holds information about the database such as its name and version; a series of records; an appinfo block; and a sortinfo block. Most of the information in a database is stored in its record; each record is simply a data block with a category, a unique identifier used for synchronization, and a few flag bits. In typical usage (as exhibited by the built-in applications) all records have the same internal format, but there is nothing in the operating system which enforces this.
The appinfo and sortinfo blocks are additional data blocks which can be attached to a database. They are not normal records: a database can have only one of each, and they do not have categories, unique IDs, or attribute bits. Although the names seem to imply a specific purpose for these two blocks, they are in fact just opaque chunks of data which can be used for anything the programmer wants. Normally, the appinfo block is treated like an application-specific database header, holding database-wide settings and the like. Also, if the application uses the operating system's built in category support, the first part of the appinfo block holds category management information. The sortinfo block is infrequently used, but the name seems to imply that it is meant to hold sort ordering information.
The Pyrite database interface is designed around the assumption that most applications will follow the standard Palm Computing platform conventions: all records formatted the same, with category support from the operating system. Most applications on the Palm Computing platform follow these conventions; one notable exception is the Doc e-text format.
In addition to the normal kind of database just described, the operating system on the handheld recognizes a special type of database called a resource database. A resource database is internally similar to an ordinary one, except for a single flag bit in its header and special record formatting. Unlike the records in an ordinary database, records in a resource database are typed. The operating system provides functions which search the database for a particular resource, by type and ID.
On the handheld, applications are stored in resource databases. Each user interface element is stored in a resource, which separates the definition of the user interface from the code which manages it. Resource databases may also be used by applications, but such use is rare. Pyrite's support for resource databases is very basic, but is likely to be expanded in the future.