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

Getting started with Azure


To start with Azure, first you need to visit Microsoft Azure and create a new free account or use your existing Hotmail account. The free account comes with a credit and you can use that credit for 12 months. You need to add your credit card information and verify it. Microsoft Azure won't charge you without the required action from the user's side:

When your account is created, log in into the Azure portal. Once your login is successful, you should see a screen similar to the following:

Let's understand the components and functionalities of each module in brief.

Azure components are divided into the following major components:

  • Compute modules
  • Data management modules
  • Networking module
  • Big data module
  • Caching and messaging module
  • Identity module
  • Mobile service module
  • Internet of things

Let's look over each of them.

Compute modules

As the name suggests, the job of this module is to provide a set of tools and services to do computing. Here is the list of services which are provided under compute modules:

As seen in the preceding screenshot, these components mainly consist of virtual machines and containers, but as per the requirements you can join them together as well.

For example, a virtual machine with more disks and snapshots along with containers is used for continuous delivery.

Let's look over the next component, the data management modules.

Data management modules

Data management modules consist of SQL Server, Azure Cosmos DB, Redis, PostgreSQL, and data warehouses. You can deploy these data management modules and use them in your app.

Here is the complete list of data management modules:

We are going to cover Azure Cosmos DB in an upcoming section. Microsoft Azure started to support MySQL and PostgreSQL in the current version (only at the time of writing this book).

Let's look over the networking module.

Networking module

The Azure traffic manager is in charge of directing the request of a user cleverly to an accessible data center. The procedure includes finding the closest data center to the user who makes the demand for the web application, and if the closest data center is not accessible because of different reasons, the traffic manager deviates the demand to another data center.

Be that as it may, rules are set by the administrator of the application regarding how the traffic manager should act in such cases. The virtual network permits a system between nearby machines at your commencing place and a virtual machine in Azure's data center. IPs to virtual machines can be appointed for identity and accessibility purposes. Virtual network setup requires a virtual private network device.

Azure also provides an application gateway which is very useful in micro services application development.

Following is the list of networking modules Azure supports at the time of writing this book:

Let's look over the big data and business intelligence modules.

Big data modules

The extensive measure of data can be stored and retrieved using Windows Azure. Azure offers HDInsight, which is a Hadoop-based service to determine and sense out enormous information stored as big data. Companies regularly need to oversee extensive measures of information which are not fundamentally relational in nature. Hadoop is used by many organizations nowadays, and it is used in Azure too.

In this manner, Azure offers Hadoop benefits on their platform for their customers. The term big compute alludes to high-performing calculations. This is accomplished by executing code in parallel on many machines in the meantime.

The components offered by big data modules are shown in following screenshot:

As you can see, Azure offers big data services ranging from storage using Hadoop clusters to performing analytics over big data, performing log analytics to determine errors, and generating reports based on your data.

Azure also provides machine learning web services to be used as smart algorithms to train and derive sense out of data.

Let's look over the caching and messaging modules.

Caching module

The Windows Azure caching service helps you to build a high-end, scalable, and dedicated cache for your website.

Azure cache is offered in three different types:

  1. Basic: A cache size less than 1 GB comes with this type.
  2. Standard: A cache size ranging from 1 GB to 10 GB comes with this type.
  3. Premium: A cache size more than 5 GB and less than 150 GB comes with this type.

Let's look over the messaging module.

Messaging module

Windows Azure offers two options for handling the interactions between two apps:

  • Message queues
  • Service bus

Generally, service-oriented architecture or SOA-based applications use service buses to perform the communication between various services.

Distributed and independent services, such as micro services, use message queues to perform the communication between them. The developer can choose one according to their needs and requirements.

Let's look over the identity module.

Identity module

This component is all about the administration of users, validation, and authentication/authorization. The active directory stores the data of clients getting to the application and, furthermore, the association's data within the organization. It can synchronize with the related data on nearby machines dwelling on-premises for effective sessions.

Here are the security and identity modules provided by Azure:

Microsoft Active Directory is one of the most mature and popular authentication and authorization modules on the market.

Let's look over the mobile service module.

Mobile service module

Windows Azure offers a simple platform to create portable mobile applications. You can begin the development of your mobile app using the Azure mobile SDK. There are so many libraries already available in Azure SDK such as notification, authentication, and so on. You can focus on your business logic and Azure SDK will help you in the common routines to ship your app faster.

Windows Azure provides a very easy platform to develop mobile applications. You can simply start using mobile development tools after logging in to your account. You don't have to write big custom code for the mobile application if you use this service. The push notifications can be sent, data can be stored, and users can be authenticated in less time.

Please refer to the following screenshot for the full list of mobile service modules:

As you can see, the list of modules is enough for mobile app developers to bootstrap their application quickly and easily.

Let's look over the last, and one of my favorite, modules: the internet of things (IoT)!

IoT modules

IoT is a hot subject right now and Azure is one of the first providers in the cloud market to facilitate such services. IoT modules allow developers to deploy services such as IoT device communication, networking, and device allocation to the hub.

Refer to the following list of modules provided by Azure for IoT purposes:

There are other modules, along with add-ons such as developer tools, monitoring tools, Bing Maps application programming interfaces (APIs), and so on.

I hope this provides you with brief but useful insight into Azure. Let's dive into Azure Cosmos DB now.