Designing a Data access service using Azure Cosmos DB
As NoSQL databases are all about fast access and high scalability, the schema for NoSQL is denormalized and hence there is a high possibility of data redundancy. Let's map our requirements from Chapter 1, Designing and Architecting the Enterprise Application, to various entities. A quick refresher of various services from the architecture is shown in the following figure:
For easier understanding, we will represent entities in JSON before moving on to POCOs:
- User container: This container will hold all user profile information, such as the name and address. For this container, the
Email
field is used as a partition key:{ Â Â "Id": "1", Â Â "Name": "John", Â Â "Email": "John@xyz.com", Â Â "Address":[{"Address1":"Gachibowli...