September 26, 2021

Databases in Azure

Azure has several database options including:

  • Cosmos DB
  • Azure SQL Database
  • Azure Database for MySQL
  • Azure Database for PostgreSQL

Cosmos DB

This is a NoSQL database option. An Advantage of Cosmos DB is the turnkey global distribution. NoSQL databases have 4 types:

  1. key-value
  2. Column
  3. Document
  4. Graphs

1 of 4 | key-value

Stores data that is tied to a unique key. Pass in the key and the database returns the data. Commonly used because the value can be just about anything.

2 of 4 | Column

NoSQL databases are called keyspaces, which contain rows and columns like a normal table, but each row can have its own set of columns. But you aren’t tied to a particular schema.

This is commonly used for storing user-profile info for a web application.

3 of 4 | Document

Can be structured file types. JSON, XML, HTML, etc. They scale horizontally very well.

4 of 4 | Graph

Stores data in nodes and the relationships between the nodes, commonly used in social media. Graph databases are extremely fast.

Creating a Cosmos DB

Start by picking the API that you want to use. Doing so determines the type of database that you will get. The database API types are

  • Core (SQL) – creates a Document database that you can query using SQL syntax.
  • Azure Cosmos DB for MongoDB API – Used to migrate to Cosmos DB from a MongoDB (Document type).
  • Cassandra – Used to migrate to Cosmos DB from Cassandra (Column type).
  • Azure Table – Used to migrate to Cosmos DB from Azure Table storage (key-value type).
  • Gremlin – Used to migrate to Cosmos DB from Gremlin (Graph type).

Azure SQL Database

PaaS version of Microsoft SQL. It has 3 deployment options:

  1. Single database – runs on a hosted SQL server instance that is fully managed by Microsoft. You just deal with the database itself. There are TWO purchasing models for Single database:
    1. Database Transaction Unit (DTU) Model
    2. Virtual Core (vCore) Model
  2. Elastic Pool – SKIPPED
  3. Managed Instance – SKIPPED


Azure Database for MySQL

Secured at rest and transit

Three pricing plans (same as PostgreSQL):

  • Basic plan
  • General Purpose plan
  • Memory optimized plan

Azure Database for PostgreSQL

Three pricing plans (same as MySQL):

  • Basic plan
  • General Purpose plan
  • Memory optimized plan