Azure Cosmos DB: Let's talk about Azure Cosmos DB
Azure Cosmos DB is a No SQL database and is an expansion of Document DB features. In a few words with Cosmos DB, we can handle our data using document (JSON), key-value and graph database globally.
Benefits of Cosmos DB
Scalability | Horizontal scale – out, easy way to reduce capacity quickly |
Performance | Enterprises can increase performance NoSQL database by adding resources. |
High Availability | NoSQL are by design high available databases, without the complexity |
Global Availability | By automatically replicating data across multiple servers, this minimize latency and ensure consistent application experience. |
Flexible Data Modelling | Developers can leverage the data types and query options that are most fit to their application. It offers a more agile development. |
Deploy your first Azure Cosmos DB
http://cloudopszone.com/wp-content/uploads/2018/05/cosmosdb_create1.png
Create your first collection
In this step, from the Main blade, we can select Quick Start to create our first data collection. As we can see in the following image there are a lot of blends in platforms, such as.Net, Xamarin, Python, etc.
http://cloudopszone.com/wp-content/uploads/2018/05/cosmosDb_Platform.jpg
Add a collection
Let's say that we are an a.Net developer, we have to select tab - [.NET] and click [Create 'Items' collection].
http://cloudopszone.com/wp-content/uploads/2018/05/Create-Collection.jpg
Download and run your .NET app
On the second step, we can Download and run the .NET app from Visual Studio. So, click [download] to get the project on our computer.
When we unzip the files we can see one folder src = Source Code and one file todo.sln = Solution File.
http://cloudopszone.com/wp-content/uploads/2018/05/download-and-run-your-app.jpg
Open solution using Visual Studio
When we open solution for first time, it's good to Rebuild first the code, from the Build - Rebuild Solution.
To see if the app is working click the button Google Chrome to run the Web App.
http://cloudopszone.com/wp-content/uploads/2018/05/button.jpg
And, finally, it works.
http://cloudopszone.com/wp-content/uploads/2018/05/it-works.jpg
Working with data
At the final step, you can see how data manipulation works. Click [Open Data Explorer] button
http://cloudopszone.com/wp-content/uploads/2018/05/working-with-data.jpg
Add a New Document
After Data Explorer opens, we can create a new document
http://cloudopszone.com/wp-content/uploads/2018/05/new-document.jpg
The document structure will be as follows :
http://cloudopszone.com/wp-content/uploads/2018/05/document.jpg
Configure Scale & Settings
Scale
On Scale we can change the Throughput, by default is 400 we can increase or reduce that number, at the same time we can see the estimated spend in USD.
http://cloudopszone.com/wp-content/uploads/2018/05/scale.jpg
Settings
On Settings, there is a Time to Live to set which impact query results while the index transformation occurs. See, more details here.
http://cloudopszone.com/wp-content/uploads/2018/05/Settings-1.jpg