Azure Tables SDK for Java
Build table storage applications using the Azure Tables SDK for Java. Works with both Azure Table Storage and Cosmos DB Table API.
Installation
Client Creation
With Connection String
With Shared Key
With SAS Token
With DefaultAzureCredential (Storage only)
Key Concepts
- TableServiceClient: Manage tables (create, list, delete)
- TableClient: Manage entities within a table (CRUD)
- Partition Key: Groups entities for efficient queries
- Row Key: Unique identifier within a partition
- Entity: A row with up to 252 properties (1MB Storage, 2MB Cosmos)
Core Patterns
Create Table
Get Table Client
Create Entity
Get Entity
Update Entity
Upsert Entity
Delete Entity
List Entities
Query with OData Filter
Batch Operations (Transactions)
List Tables
Delete Table
Typed Entities
Error Handling
Environment Variables
Best Practices
- Partition Key Design: Choose keys that distribute load evenly
- Batch Operations: Use transactions for atomic multi-entity updates
- Query Optimization: Always filter by PartitionKey when possible
- Select Projection: Only select needed properties for performance
- Entity Size: Keep entities under 1MB (Storage) or 2MB (Cosmos)
Trigger Phrases
- "Azure Tables Java"
- "table storage SDK"
- "Cosmos DB Table API"
- "NoSQL key-value storage"
- "partition key row key"
- "table entity CRUD"

