Modeling data
The best way to get accustomed to various data models offered by Cosmos DB would be to implement inherently relational domain models using the provided NoSQL data access APIs. This way, it is easier to grasp the benefits of different data models. In this section, we will be creating the main aggregate roots of our domain on Cosmos DB using the SQL API access model and we will implement the repository classes that we will use in our web applications to access these document collections. Finally, we will also talk about denormalized and referenced data.
For this exercise, let's create a relational data model for our auction applications.
In this setup, we have three big clusters of data:
- Vehicles, which includes the manufacturer, model, year, engine specifications, and some additional attributes describing the car
- Users, which consists of the sellers and buyers of the cars sold through auctions
- Auctions, which consists of some metadata about the...