Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,34 @@ The deployment will automatically:

## Source Data

The sample data represents 4 versions of the Cosmos DB databases as they progress through the migration from a relational database to a highly scalable NoSQL database:
The sample data represents 5 versions of the Cosmos DB databases as they progress through the migration from a relational database to a highly scalable NoSQL database leveraging the latest advanced features:

* [Cosmic Works version 1](https://github.com/AzureCosmosDB/CosmicWorks/tree/main/data/database-v1)
* [Cosmic Works version 2](https://github.com/AzureCosmosDB/CosmicWorks/tree/main/data/database-v2)
* [Cosmic Works version 3](https://github.com/AzureCosmosDB/CosmicWorks/tree/main/data/database-v3)
* [Cosmic Works version 4](https://github.com/AzureCosmosDB/CosmicWorks/tree/main/data/database-v4)
* [Cosmic Works version 1](https://github.com/AzureCosmosDB/CosmicWorks/tree/main/data/database-v1) - Relational-style normalized data model
* [Cosmic Works version 2](https://github.com/AzureCosmosDB/CosmicWorks/tree/main/data/database-v2) - Basic denormalization with optimized partition keys
* [Cosmic Works version 3](https://github.com/AzureCosmosDB/CosmicWorks/tree/main/data/database-v3) - Advanced denormalization with embedded categories
* [Cosmic Works version 4](https://github.com/AzureCosmosDB/CosmicWorks/tree/main/data/database-v4) - Complete denormalization with customers and orders co-located
* [Cosmic Works version 5](https://github.com/AzureCosmosDB/CosmicWorks/tree/main/data/database-v5) - **NEW**: Advanced features including hierarchical partitioning, computed properties, and enhanced change feed

## New in V5: Advanced Cosmos DB Features

Version 5 demonstrates the latest Azure Cosmos DB capabilities for modern NoSQL applications:

### 🚀 Featured Capabilities
- **Hierarchical Partitioning**: Multi-level partition keys for better data distribution and query performance
- **Global Secondary Indexes**: Alternative access patterns without data duplication
- **Computed Properties**: Automatic calculation and indexing of derived fields
- **All Versions and Deletes Change Feed**: Comprehensive operation tracking with before/after states

### 🎯 Interactive Demos
- **[l]** Hierarchical Partitioning - Regional data distribution strategies
- **[m]** Computed Properties - Calculated field indexing and querying
- **[n]** Advanced Change Feed - Comprehensive change tracking with business rules
- **[o]** Cross-region Queries - Performance comparisons across partition strategies

### 📚 Learning Resources
- [V5 Features Documentation](./docs/V5-FEATURES.md) - Detailed guide to new capabilities
- Real-world use case examples and migration guidance
- Performance optimization recommendations
- Best practices for advanced NoSQL data modeling

Perfect for developers transitioning from relational databases to modern NoSQL architectures, or those looking to leverage the latest Cosmos DB innovations for high-performance, globally distributed applications.
126 changes: 126 additions & 0 deletions data/database-v5/customer
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
[
{
"id": "CUSTOMER-001",
"type": "customer",
"customerId": "CUSTOMER-001",
"region": "North America",
"title": "Mr.",
"firstName": "John",
"lastName": "Smith",
"emailAddress": "john.smith@adventure-works.com",
"phoneNumber": "555-0101",
"creationDate": "2023-01-15T00:00:00Z",
"addresses": [
{
"addressLine1": "123 Main Street",
"addressLine2": "Apt 101",
"city": "Seattle",
"state": "WA",
"country": "USA",
"zipCode": "98101",
"location": {
"type": "Point",
"coordinates": [-122.3328, 47.6061]
}
}
],
"password": {
"hash": "hash123",
"salt": "salt123"
},
"salesOrderCount": 5
},
{
"id": "CUSTOMER-002",
"type": "customer",
"customerId": "CUSTOMER-002",
"region": "Europe",
"title": "Ms.",
"firstName": "Sarah",
"lastName": "Johnson",
"emailAddress": "sarah.johnson@adventure-works.com",
"phoneNumber": "555-0102",
"creationDate": "2023-02-10T00:00:00Z",
"addresses": [
{
"addressLine1": "456 Oak Avenue",
"addressLine2": "",
"city": "London",
"state": "",
"country": "UK",
"zipCode": "SW1A 1AA",
"location": {
"type": "Point",
"coordinates": [-0.1276, 51.5074]
}
}
],
"password": {
"hash": "hash456",
"salt": "salt456"
},
"salesOrderCount": 8
},
{
"id": "CUSTOMER-003",
"type": "customer",
"customerId": "CUSTOMER-003",
"region": "Asia Pacific",
"title": "Dr.",
"firstName": "Hiroshi",
"lastName": "Tanaka",
"emailAddress": "hiroshi.tanaka@adventure-works.com",
"phoneNumber": "555-0103",
"creationDate": "2023-03-05T00:00:00Z",
"addresses": [
{
"addressLine1": "789 Cherry Blossom Street",
"addressLine2": "Building 2, Floor 5",
"city": "Tokyo",
"state": "",
"country": "Japan",
"zipCode": "100-0001",
"location": {
"type": "Point",
"coordinates": [139.6917, 35.6895]
}
}
],
"password": {
"hash": "hash789",
"salt": "salt789"
},
"salesOrderCount": 12
},
{
"id": "CUSTOMER-004",
"type": "customer",
"customerId": "CUSTOMER-004",
"region": "North America",
"title": "Mrs.",
"firstName": "Maria",
"lastName": "Garcia",
"emailAddress": "maria.garcia@adventure-works.com",
"phoneNumber": "555-0104",
"creationDate": "2023-04-20T00:00:00Z",
"addresses": [
{
"addressLine1": "321 Sunset Boulevard",
"addressLine2": "Suite 200",
"city": "Los Angeles",
"state": "CA",
"country": "USA",
"zipCode": "90028",
"location": {
"type": "Point",
"coordinates": [-118.2437, 34.0522]
}
}
],
"password": {
"hash": "hash321",
"salt": "salt321"
},
"salesOrderCount": 3
}
]
128 changes: 128 additions & 0 deletions data/database-v5/product
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
[
{
"id": "PRODUCT-001",
"categoryId": "BIKES",
"subCategoryId": "MOUNTAIN",
"categoryName": "Bikes",
"subCategoryName": "Mountain Bikes",
"sku": "MTB-001",
"name": "Mountain Explorer Pro",
"description": "Professional mountain bike for extreme terrains",
"price": 1299.99,
"tags": [
{
"id": "TAG-001",
"name": "Professional"
},
{
"id": "TAG-002",
"name": "Mountain"
}
]
},
{
"id": "PRODUCT-002",
"categoryId": "BIKES",
"subCategoryId": "ROAD",
"categoryName": "Bikes",
"subCategoryName": "Road Bikes",
"sku": "RDB-001",
"name": "Speed Demon Carbon",
"description": "Ultra-lightweight carbon fiber road bike",
"price": 2499.99,
"tags": [
{
"id": "TAG-003",
"name": "Carbon"
},
{
"id": "TAG-004",
"name": "Lightweight"
}
]
},
{
"id": "PRODUCT-003",
"categoryId": "ACCESSORIES",
"subCategoryId": "HELMETS",
"categoryName": "Accessories",
"subCategoryName": "Safety Helmets",
"sku": "HLM-001",
"name": "AeroSafe Pro Helmet",
"description": "Professional cycling helmet with advanced ventilation",
"price": 79.99,
"tags": [
{
"id": "TAG-005",
"name": "Safety"
},
{
"id": "TAG-006",
"name": "Ventilation"
}
]
},
{
"id": "PRODUCT-004",
"categoryId": "ACCESSORIES",
"subCategoryId": "LIGHTS",
"categoryName": "Accessories",
"subCategoryName": "Bike Lights",
"sku": "LGT-001",
"name": "UltraBright LED Set",
"description": "High-intensity LED front and rear light set",
"price": 45.99,
"tags": [
{
"id": "TAG-007",
"name": "LED"
},
{
"id": "TAG-008",
"name": "Safety"
}
]
},
{
"id": "PRODUCT-005",
"categoryId": "COMPONENTS",
"subCategoryId": "WHEELS",
"categoryName": "Components",
"subCategoryName": "Wheels & Tires",
"sku": "WHL-001",
"name": "Carbon Fiber Wheelset",
"description": "Lightweight carbon fiber wheelset for road bikes",
"price": 899.99,
"tags": [
{
"id": "TAG-009",
"name": "Carbon"
},
{
"id": "TAG-010",
"name": "Performance"
}
]
},
{
"id": "PRODUCT-006",
"categoryId": "COMPONENTS",
"subCategoryId": "BRAKES",
"categoryName": "Components",
"subCategoryName": "Brake Systems",
"sku": "BRK-001",
"name": "Hydraulic Disc Brake Set",
"description": "Professional hydraulic disc brake system",
"price": 299.99,
"tags": [
{
"id": "TAG-011",
"name": "Hydraulic"
},
{
"id": "TAG-012",
"name": "Precision"
}
]
}
]
Loading