Skip to main content

Timescale

Overview

To replicate TimeBase streams to the Timescale database, use our open source Timescale connector.

Timescale is a relational database for time-series data, built as a PostgreSQL extension with full support of SQL features. To learn more, refer to Timescale Documentation.

TimeBase, being a time-series database, stores time-series events as messages. Each type of event has a personal message class assigned to it. Each message class has a set of fields (attributes) that characterize, describe, and identify each specific type of event. In object-oriented programing languages, messages can be seen as classes, each with a specific set of fields. Messages are stored in streams chronologically by their timestamps for each symbol. To learn more about TimeBase's main principles and data structure, refer to the Basic Concepts page.

To replicate TimeBase stream data to Timescale, we take fields, objects and classes from a particular TimeBase stream and unfold them so each field corresponds to a particular Timescale table column. In case of an ARRAY of objects, data is inserted in a Timescale table as a JSON object, that contains all array elements and their fields. EventTime, Id and Symbol are auto generated and common for all Timescale tables where EventTime + Id = PrimaryKey. EventTime is mapped on a TimeBase message timestamp, Symbol on a TimeBase message symbol, id is an auto generated sequence by PostrgeSQL. Timescale tables are named after TimeBase stream names. Tables rows are created for each TimeBase message in a chronological order. Data is replicated in batches (TIMEBASE_BATCH_SIZE parameter if the application config to set the number of messages in one batch).

info

To learn more about the replicator, configuration, deployment and the usage example, refer to the Replicator GitHub Repository.