Book Image

Learning Azure Cosmos DB

By : Shahid Shaikh
Book Image

Learning Azure Cosmos DB

By: Shahid Shaikh

Overview of this book

<p>Microsoft has introduced a new globally distributed database, called Azure Cosmos DB. It is a superset of Microsoft's existing NoSQL Document DB service. Azure Cosmos DB enables you to scale throughput and storage elastically and independently across any number of Azure's geographic regions.</p> <p>This book is a must-have for anyone who wants to get introduced to the world of Cosmos DB. This book will focus on building globally-distributed applications without the hassle of complex, multiple datacenter configurations. This book will shed light on how Cosmos DB offers multimodal NoSQL database capabilities in the cloud at a scale that is one product with different database engines, such as key-value, document, graph, and wide column store. We will cover detailed practical examples on how to create a CRUD application using Cosmos DB with a frontend framework of your choice. This book will empower developers to choose their favorite database engines to perform integration, along with other systems that utilize the most popular languages, such as Node.js. This book will take you through the tips and trick, of Cosmos DB deployment, management, and the security offered by Azure Cosmos DB in order to detect, prevent, and respond to database breaches.</p> <p>By the end of this book, you will not only be aware of the best capabilities of relational and non-relational databases, but you will also be able to build scalable, globally distributed,<br />and highly responsive applications.</p>
Table of Contents (14 chapters)
Title Page
Packt Upsell
Contributors
Preface
Index

Cosmos DB use cases


You can use Cosmos DB in scenarios which are highly distributed, mission critical, highly available, and easy to deploy. The following are the use cases offered by the Microsoft team:

  • IoT
  • Retail and marketing
  • Gaming
  • Web and mobile

Let's look over the use cases briefly.

IoT

IoT consists of various devices that emit data every fraction of a second. This places a need for high ingestion from multiple sources. Azure IoT hub can be used to receive the data from various IoT devices.

Once the data is ingested, you can use Azure HDInsight to process and derive real-time insight. You can then store this data in multiple sources, such as tables, to view in SaaS-based applications, DocumentDB to process the data for graphs and processing, and so on.

Let's look over the next use case.

Retail and marketing

Microsoft uses Azure Cosmos DB in the Microsoft e-commerce platforms Windows Store and Xbox Live. Azure Cosmos DB can be used to store product data, search the products, and perform the session, which is very important for e-commerce applications.

Azure Cosmos DB can also be used for event sourcing using its own change feed functionality. Change feed provides the amazing event generation mechanism to handle micro service communication.

You can refer to the following diagram about micro service communication:

Change feed is a concept introduced by RethinkDB; Packt authored a book on this called Mastering RethinkDB.

Let's look at the next use case, which is my favorite one, gaming.

Gaming

Games are highly mission critical and should be very much available at all times. That requires fast and highly available databases. Azure has already proved its worth in games such as Halo 5, The Walking Dead, and so on. Azure Cosmos DB performance can be used to handle millions of requests and to show real-time data feeds and social engagement.

Azure Cosmos DB provides an API that can be directly used in games, and with the help of database functions such as Hadoop, could be used for real-time analysis and feeds.

Let's look over the web and mobile use case.

Web and mobile applications

Azure provides various sets of tools such as key value stores, traffic manager, gateways, and of course Cosmos DB. These can be used in building social media applications, news feeds, and mobile applications using various frameworks.

Azure machine learning and Hadoop can be used as well to generate personalization reports, feeds, and recommendations, which is an amazing part of any modern application. Since most of the data is stored in JSON, it can be communicated and parsed across various scenarios such as the frontend, mobile, backend, and database.