Skip to main content

Data Types

TimeBase supports Basic and Complex data types:

TimeBase on one hand is a schema-oriented time-series database, where the principle of introspection allows using classes in the selected language as schemas. On the other hand you can take advantage of a sophisticated data modeling capabilities of the system, Luminary IDL, complex messaging format evolution and versioning, natural ability to store large volumes of time-series of heterogeneously structured messages.

TimeBase provides diverse ways of specifying field data types, as well as hints for encoding values for transmission and persistence. Main benefit of such a diversity is a more native representation of user's data model.

TimeBase supports special compressed encodings for small alphanumeric codes, which allows the data item to appear as text, while it is internally stored in extremely compressed form. Examples of alphanumeric codes include exchange codes, currency codes, liquidity provider codes, or any similar codes the user wishes to define.

INTEGER

The INTEGER data type represents a 64-bit numeric. INTEGERs can be constrained by specifying the minimum and maximum values. TimeBase offers a rich choice of encodings for the INTEGER data type.

info

Refer to Annotations for more information on data types mappings.

Encoding# BytesMinMaxDescription
SIGNED (8)1-127127A signed 8-bit value.
SIGNED (16)2-32,76732,767A signed 16-bit value.
SIGNED (32)4-231231A signed 32-bit value.
SIGNED (48)6-247247A signed 48-bit value.
SIGNED (64)8-263263A signed 64-bit value. This encoding can be omitted in field specifications, because it is the default for the INTEGER data type.
UNSIGNED (30)1 .. 40230 - 2A packed unsigned 30-bit value. The smaller the number, the less space it occupies.
UNSIGNED (61)1 .. 80261 - 2A packed unsigned 61-bit value. The smaller the number, the less space it occupies.
INTERVAL1 .. 51231A non-zero value between 1 and 231, with optimal encoding for representing time intervals in milliseconds.
CLASS "epam.rtc.timebase.samples.IntegerMessage" 'Sample Integer Message' (
"int_c_8" 'Non-nullable INTEGER:INT8' INTEGER NOT NULL SIGNED (8),
"int_n_8" 'Nullable INTEGER:INT8' INTEGER SIGNED (8),
"int_c_16" 'Non-nullable INTEGER:INT16' INTEGER NOT NULL SIGNED (16),
"int_n_16" 'Nullable INTEGER:INT16' INTEGER SIGNED (16),
"int_c_32" 'Non-nullable INTEGER:INT32' INTEGER NOT NULL SIGNED (32),
"int_n_32" 'Nullable INTEGER:INT32' INTEGER SIGNED (32),
"int_c_64" 'Non-nullable INTEGER:INT64' INTEGER NOT NULL SIGNED (64),
"int_n_64" 'Nullable INTEGER:INT64' INTEGER SIGNED (64),
"puint_c_30" 'Non-nullable INTEGER:PUINT30' INTEGER NOT NULL UNSIGNED (30),
"puint_n_30" 'Nullable INTEGER:PUINT30' INTEGER UNSIGNED (30),
"puint_c_61" 'Non-nullable INTEGER:PUINT61' INTEGER NOT NULL UNSIGNED (61),
"puint_n_61" 'Nullable INTEGER:PUINT61' INTEGER UNSIGNED (61)
)

CHAR/VARCHAR

The CHAR data type represents a single Unicode character. The VARCHAR data type represents a variable size string (text). An empty string is different from the NULL value.

info

Refer to Annotations for more information on data types mappings.

VARCHAR EncodingMax Length# BytesDescription
UTF864,5342 + length * (1 .. 4)A Unicode string is up to 64,534 characters long, encoded in UTF8. This encoding can be omitted in field specifications, because it is the default for the VARCHAR data type.
ALPHANUMERIC (n)n~0.75 * nThis encoding is highly optimized for storing small alphanumeric codes, such as typical currency or exchange codes. Strings that can be represented by this encoding are limited in length to n and can only be composed of characters whose ASCII codes are between 0x20 and 0x5F, inclusively. This includes the space character, [A-Z], [0-9] and !"#$%&'()*+,-./:;<=>?@[\]^_. Note, that lower-case letters are not supported.
ALPHANUMERIC108Equivalent to ALPHANUMERIC (10).
Name# Bytes
CHAR1
CLASS "epam.rtc.timebase.samples.VarcharMessage" 'Sample Varchar Message' (
"char_c" 'Non-nullable CHAR' CHAR NOT NULL,
"char_n" 'Nullable CHAR' CHAR,
"varchar_c_utf8" 'Non-nullable VARCHAR:UTF8' VARCHAR NOT NULL,
"varchar_n_utf8" 'Nullable CHAR:UTF8' VARCHAR,
"varchar_c_alpha10" 'Non-nullable VARCHAR:ALPHANUMERIC(10):long' VARCHAR NOT NULL,
"varchar_n_alpha10" 'Nullable VARCHAR:ALPHANUMERIC(10):long' VARCHAR,
"varchar_c_alpha5_s" 'Non-nullable VARCHAR:ALPHANUMERIC(5)' VARCHAR NOT NULL,
"varchar_n_alpha5_s" 'Nullable VARCHAR:ALPHANUMERIC(5)' VARCHAR
)

BINARY

The BINARY data type can be used for storing arbitrary raw data.

Name# Bytes
BINARYUp to 4,194,304 bytes
info

Refer to Annotations for more information on data types mappings.

CLASS "epam.rtc.timebase.samples.BinaryMessage" 'Sample Binary Message' (
"raw_data" BINARY
)

FLOAT

The FLOAT data type represents a floating-point number. The FLOAT type can be constrained by specifying the the minimum and maximum values.

info

Refer to Annotations for more information on data types mappings.

Encoding# BytesRangeDescription
BINARY (32)4±3.4 * 1038Single-precision number, encoded according to IEEE 754 binary32 format.
BINARY (64)8±1.8 * 10308Double-precision number, encoded according to IEEE 754 binary64 format. This encoding can be omitted in field specifications, because it is the default for the FLOAT data type.
DECIMAL2 .. 9±1.8 * 10308A decimal floating-point number, encoded with automatically chosen precision. This encoding works best with smaller decimal numbers, such as24.25 or 1234.5556.
DECIMAL (n)2 .. 9±1.8 * 10308A decimal floating-point number, encoded with user-defined precision n, where n represents the number of fractional digits. This encoding works best with smaller decimal numbers, such as24.25 or 1234.5556. Numbers are rounded at encoding time to the specified number of fractional decimal digits. n can be between0 .. 14, inclusively.
DECIMAL648±0.000000000000000×10−383 to ±9.999999999999999×10384See DECIMAL(64) to learn more. Can be used by both LONG and DOUBLE data types.
CLASS "epam.rtc.timebase.samples.FloatMessage" 'Sample Float Message' (
"float_c_32" 'Non-nullable FLOAT:IEEE32' FLOAT NOT NULL BINARY (32),
"float_n_32" 'Nullable FLOAT:IEEE32' FLOAT BINARY (32),
"float_c_64" 'Non-nullable FLOAT:IEEE64' FLOAT NOT NULL BINARY (64),
"float_n_64" 'Nullable FLOAT:IEEE32' FLOAT BINARY (64),
"float_c_dec" 'Non-nullable FLOAT:DECIMAL' FLOAT NOT NULL DECIMAL,
"float_n_dec" 'Nullable FLOAT:IEEE32' FLOAT DECIMAL,
"float_c_dec2" 'Non-nullable FLOAT:DECIMAL(2)' FLOAT NOT NULL DECIMAL (2),
"float_n_dec2" 'Nullable FLOAT:DECIMAL(2)' FLOAT DECIMAL (2),
"float_n_dec64" 'Nullable FLOAT:DECIMAL64' FLOAT DECIMAL64
)

BOOLEAN

info

Refer to Annotations for more information on data types mappings.

The BOOLEAN data type represents a Boolean (logical) value, which is either TRUE or FALSE.

Name# BytesMinMax
BOOLEAN101
CLASS "epam.rtc.timebase.samples.BooleanMessage" 'Sample Boolean Message' (
"bool_c" 'Non-nullable BOOLEAN' BOOLEAN NOT NULL,
"bool_n" 'Nullable BOOLEAN' BOOLEAN
)

TIMESTAMP

info

Refer to Annotations for more information on data types mappings.

The TIMESTAMP data type represents an absolute, time zone-independent, number of millisecond passed from 1/1/1970.

Name# BytesMinMax
TIMESTAMP82-63263
CLASS "epam.rtc.timebase.samples.TimeMessage" 'Sample Time Message' (
"date_c" 'Non-nullable DATE' TIMESTAMP NOT NULL,
"date_n" 'Nullable DATE' TIMESTAMP,
"tod_c" 'Non-nullable TIMEOFDAY' TIMEOFDAY NOT NULL,
"tod_n" 'Nullable TIMEOFDAY' TIMEOFDAY
)

TIMEOFDAY

info

Refer to Annotations for more information on data types mappings.

The TIMEOFDAY data type represents a time of day in a millisecond resolution.

Name# BytesMinMax
TIMEOFDAY8086399999
CLASS "epam.rtc.timebase.samples.TimeMessage" 'Sample Time Message' (
"date_c" 'Non-nullable DATE' TIMESTAMP NOT NULL,
"date_n" 'Nullable DATE' TIMESTAMP,
"tod_c" 'Non-nullable TIMEOFDAY' TIMEOFDAY NOT NULL,
"tod_n" 'Nullable TIMEOFDAY' TIMEOFDAY
)

ENUM

info

Refer to Annotations for more information on data types mappings.

The ENUM data type contains the list of indexes of predefined values.

Name# BytesMinMax
ENUM80264
ENUM "epam.rtc.timebase.samples.SampleEnum" 'Sample Enum' (
"RED" = 1,
"GREEN" = 3,
"BLUE" = 4
)
CLASS "epam.rtc.timebase.samples.EnumMessage" 'Sample Enum Message' (
"enum_c" 'Non-nullable ENUM' "epam.rtc.timebase.samples.SampleEnum" NOT NULL,
"enum_n" 'Nullable ENUM' "epam.rtc.timebase.samples.SampleEnum"
)

ARRAY

info

Refer to Annotations for more information on data types mappings.

ARRAY data type may contain all data types with the exception of CHAR.

Name# BytesTypes
ARRAYUp to 4,194,304 bytesINTEGER, BINARY, FLOAT, BOOLEAN, TIMESTAMP, TIMEOFDAY, OBJECT, ARRAY, ENUM
CLASS "epam.rtc.timebase.samples.SampleArrayMessage" 'Sample Array Message' (
"int_array_nullable" 'Integer Array (Nullable)' ARRAY(INTEGER),
"int_array" 'Integer Array' ARRAY(INTEGER NOT NULL),
"enum_array_nullable" 'ENUM Array (Nullable)' ARRAY("epam.rtc.timebase.samples.SampleEnum"),
"enum_array" 'ENUM Array' ARRAY("epam.rtc.timebase.samples.SampleEnum" NOT NULL),
"object_array_nullable" 'Object Array (Nullable)' ARRAY(OBJECT("epam.rtc.timebase.samples.CustomAttribute")),
"object_array" 'Object Array' ARRAY(OBJECT("epam.rtc.timebase.samples.CustomAttribute") NOT NULL) NOT NULL,
"poly_object_array" 'Polymorphic Object Array' ARRAY(OBJECT("epam.rtc.timebase.samples.CustomAttribute", "epam.rtc.timebase.samples.DeltaAttribute") NOT NULL) NOT NULL,
"nested_array" 'Nested Array' ARRAY(ARRAY(OBJECT("epam.rtc.timebase.samples.CustomAttribute", "epam.rtc.timebase.samples.DeltaAttribute")))
);

OBJECT

info

Refer to Annotations for more information on data types mappings.

OBJECT defines a structure, consisting of a determined sequence of fields. Objects can include other objects, arrays of objects, arrays with unlimited nesting. Objects do not allow circular object references.

Name# Bytes
OBJECTUp to 4,194,304 bytes
CLASS "epam.rtc.timebase.samples.SampleObjectMessage" 'Sample Object Message' (
"object" 'Object' "epam.rtc.timebase.samples.CustomAttribute" NOT NULL,
"object_nullable" 'Object (Nullable)' "epam.rtc.timebase.samples.CustomAttribute",
"poly_object" 'Polymorphic Object' OBJECT("epam.rtc.timebase.samples.CustomAttribute", "epam.rtc.timebase.samples.DeltaAttribute") NOT NULL,
);

NULL Values

Data TypeNULL Value
BOOLEAN-1
BYTEByte.MIN_VALUE
SHORTShort.MIN_VALUE
INTEGERInteger.MIN_VALUE
INT48-140737488355328L
LONGLong.MIN_VALUE
PINTERVAL0
FLOATFloat.NaN
DOUBLEDouble.NaN
DECIMALDecimal64Utils.NULL
TIME_OF_DAY-1
DURATIONInteger.MIN_VALUE
TIMESTAMPLong.MIN_VALUE
ENUM-1
ALPHANUMERICLong.MIN_VALUE