edit-icon download-icon

Data model

Last Updated: Apr 23, 2018

Overview

The data model of Table Store is defined by Table, Row, Primary Key, and Attribute, as shown in the following diagram.

Data model

  • A table is a set of rows, and a row consists of the primary key and attribute.

  • The primary key and attribute columns consist of names and values.

  • All rows in a table must contain primary key columns with the same number and name. However, the number, name, and data type of attribute columns within the rows can vary.

  • Each attribute column can contain multiple versions, and each version (that is, the timestamp) corresponds to a column value, which is different from that of a primary key column.

    Note: Timestamp is the sum of the milliseconds counted from 1970-01-01 00:00:00 UTC to the time when data is written.

Example

The following example illustrates two rows in a table. The ID column is the primary key column.

ID Type ISBN PageCount Length
‘4776’ timestamp = 1466676354000, value = ‘Book’ timestamp = 1466676354000, value = ‘123*45678912345’ timestamp = 1466676354000, value = 666 -
‘6555’ timestamp = 1466676354000, value = ‘Music’ - - timestamp = 1466676354000, value = 400; timestamp = 1466762754000, value = 500
  • ID is the primary key of the given table. Rows with the ID of '4776' and '6555' have different attributes and can be stored in the same table.

  • The attribute column Type of the row with ID '4776' only has one version. The version is 1466676354000 and the data is 'Book'.

  • The attribute column Length of the row with ID '6555' has two versions. The data of version 1466676354000 is 400 and the data of version 1466762754000 is 500.

Thank you! We've received your feedback.