The JADE database stores and manages approximately 16 different types of record, including normal object records, five different types of index records, collection headers, collection blocks, available record areas, and available index blocks.
The index records, which are maintained in the same file as the corresponding data, have a fixed length of 2048 bytes. The main types of persistent indexes are:
Object index
Subobject index
Version index
Free space index
All non-index records are variable in length and consist of a fixed length header followed by the embedded property values terminating with a 5-byte trailer. Embedded properties are packed with alignment on octet boundaries on all platforms.
The storage size for each attribute type corresponds to the C data type sizes, with the exceptions or additions listed in the following table.
Type | Size |
---|---|
Boolean | 1 byte |
Character | 1 byte for ANSI, 2 bytes for Unicode |
Embedded binaries | Schema-defined size |
Embedded strings | Schema-defined size + 1 |
Exclusive reference | 14 bytes |
Date | 4 bytes |
Decimal | 3-12 bytes (depending on precision) |
Integer | 4 bytes |
Point | 8 bytes |
Real | 8 bytes |
Shared reference | 10 bytes |
Time | 4 bytes |
Timestamp | 8 bytes |
The fixed header part of object records is 41 bytes in length. This header contains type, length, version references and timestamps, object identifier, and edition information. The trailer contains a repeat of the type and length fields.
Unbounded binary and string attributes (referred to as blobs and slobs) are stored externally to normal object records and are segmented to provide efficient use of object space as they change in size.
The fixed header part of a blob or slob is 24 bytes in size and continuation segments have a 4-byte link overhead. The minimum blob or slob segment size is 64 bytes and segment size is always a multiple of 64 bytes up to a maximum of 16K bytes.
If a blob or slob exceeds 16K bytes, all segments apart from the final segment will be 16K bytes in size. Each blob or slob attribute incurs an 8-byte overhead in the parent object, consisting of a 4-byte length and a 4-byte edition field.
The JADE database retains information about the physical structure of the database, such as timestamp and version information for each physical file and information about transaction journal files, which may be used when recovering a database. This information is referred to as control data, and is stored in the _control.dat database file.