4. Database Schema

This chapter describes the database tables and schema used for data storage and management.

Database Integration Adapter automatically creates two database tables:

  • Data Tables store DDS samples and associated metadata for each registered Topic.

  • The Types Table stores type information for registered DDS types.

4.1. Data Tables

For each DDS Topic, Database Integration Adapter creates a data table with the structure detailed in the table below:

Table 4.1 Data Table Structure

Column Name

Type

Description

RTI_HISTORY_ID

INT/SERIAL (auto-increment)

Unique identifier for each sample. This column is created only when instance_history > 1. For more information, see Primary key configuration.

RTI_HISTORY_ORDER

INT

Per-instance ordering field used to identify the oldest stored sample when instance_history > 1. This column is only created when instance_history > 1.

sampleInfo_reception_timestamp_seconds

INT

Seconds portion of the sample reception timestamp.

sampleInfo_reception_timestamp_nanoseconds

INT

Nanoseconds portion of the sample reception timestamp.

sampleInfo_instance_handle

BINARY(16) / BYTEA

DDS instance handle. Always part of the primary key.

json_sample

VARCHAR

Contains the serialized JSON representation of the DDS sample data.

4.1.1. Primary key configuration

The primary key structure depends on the instance_history option:

  • instance_history = 0 or 1: Primary key is (sampleInfo_instance_handle)

    • Only the latest sample per instance is stored

    • New samples with the same instance handle replace existing ones

  • instance_history > 1 or instance_history = -1 : Primary key is (RTI_HISTORY_ID, sampleInfo_instance_handle)

    • Multiple samples per instance can be stored

    • RTI_HISTORY_ID ensures uniqueness across all samples

    • RTI_HISTORY_ORDER is used to find the oldest sample for replacement when the per-instance limit is reached

4.1.2. Table naming convention

Data tables are named using the pattern <topic_name>@<domain_id>.

For example, a Topic named ShapeType in domain 0 would create a table named ShapeType@0.

4.2. Types Table

Database Integration Adapter also creates a types table to track which DDS types have been registered. This table maintains type information for data processing and analysis. The structure of the types table is as follows:

Table 4.2 Types Table Structure

Column Name

Type

Description

topic_name

VARCHAR

Name of the DDS Topic.

type

VARCHAR

Name of the DDS type used by the Topic.

type_representation

VARCHAR or binary (database dependent)

Serialized type representation. Its storage type depends on the type_representation_format connection option:

  • XML: stored as string data

  • XCDR: stored as binary data