Skip to content

How to model and partition data for Cosmos DB starting with the Adventure Works database.

License

Notifications You must be signed in to change notification settings

AzureCosmosDB/CosmicWorks

Repository files navigation

CosmicWorks

How to migrate a relational data model to Azure Cosmos DB, a distributed, horizontally scalable, NoSQL database.

This repo is used to support a presentation on how to migrate a relational database schema to a NoSQL database like Azure Cosmos DB. This repo contains a Powerpoint presetnation and a Visual Studio solution that represents the demos for this presenation with three projects in it:

  • modeling-demos: This contains the main app that shows the evolution of the data models from v1 to v4

  • change-feed-categories: This project uses change feed processor to monitor the product categories container for changes and then propagates those to the products container.

  • models: This project contains all of the POCO classes used in both other projects.

Source data

You can download all of the data for each of the 4 versions of the Cosmos DB databases as it progresses through its evolution from the data folder in this repository. You can see the contents of these storage containers below.

You can also download a bak file for the original Adventure Works 2017 database this session and app is built upon.

Provision the four versions of the Cosmos databases

To create a new Cosmos DB account with four databases and containers for each from this button below. This template provisions each container with autoscale with 4000 max throughput. To improve the performance of the import process you may want to increase the throughput to approx. 40,000 RU/s, then reduce it back to 4000 RU/s. To save on cost you can modify the ARM template to provision throughput at the database level rather than for each container.

Deploy To Azure

Loading data

If you want to load the data for each of these database versions into Cosmos you can use the Data Migration Tool or Azure Data Factory

About

How to model and partition data for Cosmos DB starting with the Adventure Works database.

Topics

Resources

License

Stars

Watchers

Forks