Integration Tables Concepts
Concepts for the Integration Tables API
The integration table is the core element of an event streaming platform. The following sections detail the information necessary to use the FairCom Integration Tables API actions effectively.
The debug field is a JSON array to which a JavaScript transform can append debugging information for troubleshooting purposes. It is designed as a flexible storage space for developers to add variable values, intermediate steps, or other relevant data during the transformation process. The transform system ensures the debug field is always an array before running each JavaScript transform, even if its initial value is null or another non-array JSON type, to preserve information from previous steps. To save space in the record, the platform automatically sets the debug field to null if it remains an empty array after all transformations are complete.
["some debug message",
{
"debugSource": "transformSteps",
"transformStepName": "step1",
"message": "variable2 = 33561"
},
{
"variable1": "myString",
"variable2": 33561
},
"End of transform step"
]
Each integration table record contains the fields shown in Figure 1, “Integration table fields”.
Each record is automatically given a unique ID in the
"id"field.The server’s current UTC time is recorded in the
"create_ts"field.The incoming payload is stored in the
"source_payload"field.Unlimited transform processes can store their results in any field (other than the built-in fields).
Error messages and transform logs are stored in the
"error"and"log"fields.
Since the MQTT engine requires additional fields to track message data and since any integration table can be connected to the MQTT engine, each integration table contains MQTT fields.
Plugins can also add fields to each integration table. This occurs automatically when such a plugin is added to FairCom Edge. It is done invisibly in the background with no performance impact because of the FairCom Hot Alter Table feature.
The SQL and JSON DB APIs should only write to the "source_payload" field and user-defined fields. They can query all fields.
Field name | Field type | Nullable | Indexed | User Writable | Description | |||
|---|---|---|---|---|---|---|---|---|
|
| The server automatically populates its value with the server's transaction ID when a record is inserted or updated. | ||||||
|
| N | Y | The server automatically populates its value with a millisecond-precision UTC date and time when a record is inserted. | ||||
|
| N | N |
| ||||
|
| N | Y | The identity field uniquely identifies each record. The server automatically populates its value with a unique, incremented integer when a record is inserted. | ||||
|
| Y | N |
| ||||
|
| Y | Y | |||||
|
| Y | Y | Foreign key to the unique identifier of a row in the | ||||
|
| Y | (MQTT 5) The publisher can specify a string that identifies the type of content in the MQTT payload (i.e. | |||||
|
| Y | (MQTT 5) The publisher can assign unique correlation data to a message that subscribers should use when they reply to the message. | |||||
|
| Y | (MQTT 5) The publisher optionally defines a number of seconds before a message expires. The server does not deliver messages to subscribers after they expire. The server always retains expired messages in the integration table until the table's retention policy removes them. | |||||
|
| Y | Foreign key to the unique identifier of a row in the | |||||
|
| Y | (MQTT) The publisher assigns a unique packet identifier to each QoS 1 and QoS 2 message to ensure its packets are processed together. | |||||
|
| Y | (MQTT 5) The publisher can specify the format of the payload.
| |||||
|
| Y | (MQTT) The publisher can set the QoS of each message it publishes:
| |||||
|
| Y | (MQTT 5) The publisher can assign a response topic to a message, which is the topic subscribers should use for replies. | |||||
|
| Y | (MQTT) The publisher can set the retained message flag on an MQTT message to tell the server to deliver it automatically to new subscribers of that message's topic. The server only delivers the last retained message to new subscribers, but the integration table contains the history of which messages are marked as retained messages.
| |||||
|
| Y | Contains | |||||
|
| Y | Y | Foreign key to the unique identifier of a row in the | ||||
|
| Y | (MQTT 5) The publisher can add user-defined properties to a message. These properties are metadata about the message. The properties are stored in this field as an array of JSON objects. | |||||
Plugin fields | plugin-defined | Y | N | A plugin can add additional fields. Each field is prefixed with a unique prefix — for example, MQTT uses the prefix | ||||
|
| Y | N | Y | The | |||
Transform fields | transform-defined | Y | The transform pipeline assigned to an integration table may add fields to store its results. | |||||
User-defined fields | user-defined | Y | N | Y | An application can create additional fields. The field names must not conflict with FairCom Edge field names. |
Warning
These fields should not be manually updated.
Field | Description |
|---|---|
| The name of the database the data was pulled from. |
| The unique identifier of the record in the source table. |
| The name of the owner of the source table the data was pulled from. |
| The name of the table the data was pulled from. |
The metadata field is a JSON object that attaches supplementary information to a record in an integration table. It is a flexible storage space that allows you to attach context, flags, or other relevant data that isn't part of the main data in the record. A JavaScript transform can access and manipulate this field through the record.metadata variable. The transform system ensures the metadata field is always an object before running each JavaScript transform step, and to optimize storage, the platform automatically sets the metadata field to null if it remains an empty object after all transformations are complete.
metadata:{
"myProperty": "myValue",
"propertyFromAPreviousStep": 27
}Integration tables are the heart of FairCom Edge. They are database tables that are enhanced and optimized for inserts, transformation processes, queries, and forwarding data asynchronously to output services. They make it possible to bridge data across otherwise incompatible protocols, data serialization formats, data shapes, and data types. All integration tables are created with only insert and read permissions. This is because an integration table is an immutable, audit log of events.
Input services insert data into integration tables. Output services read and deliver data from the integration tables.
Input services insert records, they are not allowed to change or delete records because that would destroy the integrity of the audit log. When an input source submits data for insertion, automatic transforms are created and stored in the record with the original data. It becomes read-only and can be queried by SQL and JSON DB APIs.
When an input service is configured, it is assigned to an existing integration table or it creates a new integration table. MQTT automatically creates an integration table for each new topic it creates. Integration processes can be refined and integration tables can be renamed to better label the data they hold. The "configureTopic" and "alterIntegrationTable" actions in the API are used to rename an integration table.
Figure 2, “The integration table” identifies the FairCom Edge components that interact with the integration table.