Introduction
In this article, we will understand the business model and requirement and create Cosmos DB and collection accordingly with the use of the portal as well as .NET Code.
Please go through my previous articles of this series,
Business Model
There is a product-based company in India that provides value-added services (VAS), like mobile recharge, bill payment, and so on. The entire recharge process covers the following procedure,
- The end user (who wants to recharge his mobile) visits the recharge store and asks the store-keeper to make a recharge, for example, a Vodafone top-up of Rs. 100.
- The storekeeper sends a request to this company.
- The company sends a request to the service provider (Cyberplat).
- The service provider (Cyberplat) sends a request to the provider (Vodafone).
- The provider (Vodafone) makes a recharge and sends the response back to the service provider (Cyberplat).
- Service Provider (Cyberplat) sends the same response to the company and the company reverts to the recharge store and finally sends it to the end user.
Requirement
As mobile is very common for individuals, hence the volume of recharge transactions also will be high and it requires high storage to persist all the transactions and it should be accessible without latency.
So let's see how we can create database and collection for the same.
Step 1
- Login to Azure Portal
- Click on 'Azure Cosmos DB' service under all services
- It shows the Cosmos Account which we have created in Day 1
- Click on the 'utilitybillpayments' account

Step 2
- Click on 'Overview' and it will show account basic information like Resource Group, Subscription URI etc.
- Click on 'AddCollection'

Step 3
- Insert a suitable name for Databaseid, in our scenario, we have defined 'Recharge' or select existing if already created
- Insert collectionid, here we have inserted 'Prepaid'
- As of now keep storage capacity to Fixed, in the coming articles will discuss in detail about this.
- Throughput - Let's keep it 1000 as of now.
- Click on 'OK' button and it will take some time to create database 'Recharge' and collection 'Prepaid'.

Step 4
- Now you can see Database 'Recharge' and under that 'Prepaid' as a collection
- Explore 'Prepaid' collection and you can find 'Documents'
- Click on 'Documents' and it will explore all existing documents, currently, we haven't created any document hence showing empty.

In the third step, we have seen throughput (400 - 10000 RU/s) and we kept 1000 as it is which is by default selected. The question is what is 'RU/s' and how can we calculate for our requirement.
RU/s means Request Units per Second. On an average how many requests we expect for our Cosmos DB irrespective of Create, Read, Update and Delete. We do not need to worry as we have online calculator through which we can get throughput value.
Go to the below link,
https://www.documentdb.com/capacityplanner
Step 1
- This is the online calculator which provides Request Units in Azure Cosmos DB
- The first thing it asks to 'Upload Document' to consider the size











Abhishek MishraPosted Oct 5, 2018, 4:17 AM
Awesome. Enjoyed reading