Setting up Azure Cosmos DB
Ok, let's take it one by one. Let's start with setting up of a cosmos DB cluster. But before that lets discuss some general info about cosmos db.
What is cosmos DB?
If you search Wikipedia, you will get following result.
So, I can understand that it's a Microsoft provided NoSQL datastore which provides different properties as mentioned in its description. I am not going into the details of these properties in this article as it's beyond the scope of it. I would only discuss about how to set it up.
Now, let's jump on to the setup of cosmos DB.
How to setup cosmos DB?
In order to do it, you need an azure account. In order to create a free one, you can use: Create Your Azure Free Account Today | Microsoft Azure you would get 200 dollars of free credits.
- Once you have the account, you would see something like this, click on select Create a resource.
- Then, you would see this screen mentioned below, Select Azure cosmos DB.
- Next screen is going to ask you to select API option, select the Create option within the Core (SQL) - Recommend section. Azure Cosmos DB provides five APIs: Core (SQL) and MongoDB for document data, Gremlin for graph data, Azure Table, and Cassandra. Currently, you must create a separate account for each API. Learn more about the SQL API.
- Optionally, you can add more details in the following tabs, Network latency, Backup Policy, Encryption, Tags.
- Click review and create...
Database seems clear but what is container?
An Azure Cosmos DB container is a schema-agnostic container of arbitrary user-generated entities and stored procedures, triggers and user-defined-functions (UDFs).
Now, let's talk about container creation:
- For creating container go to Data explorer section, select new container, then a window would pop up on the right side
- Select ok, a new DB instance can be seen under data explorer.
- Click on the items under database and then click on new item tab.
- Add following Json:
- Wikipedia
- Microsoft cosmos DB docs.
Comments
Post a Comment