Microsoft Documentation
Azure Table storage is a NoSQL key-attribute store that allows you to store large amounts of structured, non-relational data. It's designed for scenarios where you need flexible data schemas and high scalability. This document explains the core concepts of the Azure Table storage data model.
The fundamental entities in Azure Table storage are:
A table is a container for entities. All entities within a table share a similar structure (schema), but this structure can vary from entity to entity. You can have multiple tables within a storage account.
An entity is the basic unit of data in Azure Table storage. Each entity is a collection of properties. Every entity MUST have the following two properties:
PartitionKey
are stored together, which helps with query performance and scalability.
Together, PartitionKey
and RowKey
form the entity's unique identifier, known as the entity key.
In addition to PartitionKey
and RowKey
, an entity can contain up to 252 additional properties.
Properties are name-value pairs.
String
Int32
Int64
Double
DateTime
Boolean
Guid
Binary (Byte array)
DateTimeOffset
GeographyPoint
(for Geo-JSON)
All properties are stored as String
s or DateTime
s internally, and are converted to the appropriate .NET type when retrieved.
Azure Table storage does not enforce a schema for these 252 properties. An entity can have a completely different set of properties from another entity in the same table.
Note: Properties that are null
are not stored.
The PartitionKey
and RowKey
are critical for efficient data access and scalability.
PartitionKey
. This allows for massive scalability by distributing requests across multiple partitions.PartitionKey
are highly efficient as they target a specific partition. Queries across multiple partitions or without a PartitionKey
filter are less performant.PartitionKey
and RowKey
must be unique within a table.PartitionKey
: "User"RowKey
: "user123"Name
: "Alice Smith"Email
: "alice.smith@example.com"Age
: 30IsActive
: truePartitionKey
: "User"RowKey
: "user456"Name
: "Bob Johnson"Email
: "bob.j@example.com"RegistrationDate
: 2023-10-26T10:00:00ZPartitionKey
: "Product"RowKey
: "prodA789"ProductName
: "Gadget Pro"Price
: 99.99StockCount
: 150Azure Table storage supports the following operations on entities:
Update (replace)
or Merge (partial update)
operation.
You can perform batch operations to insert, update, or delete multiple entities in a single request.
However, batch operations are limited to entities within the same PartitionKey
.
Azure Table storage offers a flexible data model. However, be aware of the following limits:
PartitionKey
and RowKey
).
Best Practices: Design your PartitionKey
strategically to balance query performance and scalability. Consider partitioning by common query filters like date, user ID, or type.