Q.66. Explain Azure Table Storage data model?

The Azure Table storage data model includes the following components.

  1. Storage Account
  2. Table
  3. Entities
  4. Entities and its properties

Figure depicts the Relationship between Storage Account, Tables and entities.



table storage data model

1. Storage Account


A Storage account is necessary to access Windows Azure table storage. Any number of tables can be created under a storage account. Note that tables are scoped by the storage account, which means two tables can have same names in different storage accounts. For each Azure subscription, we can create 100 storage accounts. There is no specific limit to how much data you can store within a table. The size is restricted by the Maximum allowable size which is currently 500 TB for a single storage account. A storage account can hold any combination of Windows Azure Tables, Blobs or Queues up to the allowable size of 500TB.

2. Table


A Windows Azure table is a collection of heterogeneous entities and is unlike rows of relational database tables. These tables do not enforce a fixed schema on entities, which allows us to define different sets of properties for different entities in a single Table. For example, information of customers and orders can be stored in the same table, even though both are different entities having different structures. Another example is we can store details of customer, supplier, family friends in the same table. The structure of such a table named - Contacts table is shown:

3.Entities


Every entity in Azure table has 3 system properties - a partitionkey, a rowkey, and a timestamp associated with it. The PartitionKey combined with the RowKey uniquely identifies an entity in a Table and the timestamp is a read-only system maintained property for tracking changes in entities.

Row Key


An entity's row key is partition’s unique identifier. PartitionKey and RowKey make queries execute faster.

4. Entity and its properties


Each entity property represents a single value in an entity. Each entity can be up to 1MB in size and can include up to 252 properties. Azure Table storage entities support the following data types: Byte array, Boolean, DateTime, Double, GUID, Int32, Int64 and String (up to 64KB in size).

Partition key


You can partition a table by using a specific key called Partition Key and it is a string property.