The Timeline model is designed for message data. This model can meet the specific requirements of message data, such as message order preservation, storage of large numbers of messages, and real-time synchronization. The Timeline model also supports tokenization and BoolQuery. The model is suitable for message scenarios such as instant messaging (IM) and Feed streams.

Architecture

The Timeline model provides clear core modules in a simple design. You can easily use the Timeline model to implement your services in different methods as required. The architecture of the model includes the following components:
  • Store: a unit used to store Timeline data. A store is similar to a table in database services.
  • Identifier: an identifier used to identify Timeline data.
  • Meta: the metadata used to describe Timeline data. The metadata is stored in a free-schema structure and can contain any column.
  • Queue: stores the messages in a Timeline. A Timeline can include one or multiple queues.
  • SequenceId: the serial number of a message body in the Queue. The SequenceId values must be incremental and unique. The Timeline model generates SequenceId values by using an auto-increment column. You can also specify SequenceId value manually.
  • Message: the message body in the Timeline. The message is stored in a free-schema structure and can contain any column.
  • Index: includes Meta Index and Message Index. You can customize indexes for any columns in Meta or Message to provide BoolQuery.

Functions

The Timeline model supports the following features:
  • Management of Meta data and messages, including basic data operations such as create, read, update, and delete.
  • BoolQuery and tokenization for Meta data and messages.
  • Two configuration methods for SequenceId values: auto-increment column and manual setting.
  • Timeline Identifier that contains multiple columns.
  • Compatibility with the Timeline model V1.x. The TimelineMessageForV1 examples of the Timeline model can be used to read messages from and write messages to the Timeline model V1.x.

If you use Tablestore SDK for Java 4.12.1 or later (in which the Timeline model is integrated), add the following dependency to use the Timeline model:

<dependency>
    <groupId>com.aliyun.openservices</groupId>
    <artifactId>tablestore</artifactId>
    <version>4.12.1</version>
</dependency>
If you use Tablestore SDK for Java earlier than 4.12.1, add the following dependency to use the Timeline model:
<dependency>
    <groupId>com.aliyun.openservices.tablestore</groupId>
    <artifactId>Timeline</artifactId>
    <version>2.0.0</version>
</dependency>