> For the complete documentation index, see [llms.txt](https://dailyjournal.gitbook.io/cloud-computing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dailyjournal.gitbook.io/cloud-computing/cloud-computing-platforms/microsoft-azure/database.md).

# Databases

## Relational Databases <a href="#azure-sql" id="azure-sql"></a>

{% embed url="<https://www.microsoft.com/en-us/sql-server/blog/wp-content/uploads/2022/11/Picture4-1.webp>" %}

### Azure SQL <a href="#azure-sql" id="azure-sql"></a>

*Azure SQL* is the collective name for a family of relational database solutions based on the Microsoft SQL Server database engine.

{% hint style="info" %}

#### Single Database <a href="#single-database" id="single-database"></a>

This option enables you to quickly set up and run a single SQL Server database. You create and run a database server in the cloud, and you access your database through this server. Microsoft manages the server, so all you have to do is configure the database, create your tables, and populate them with your data. You can scale the database if you need more storage space, memory, or processing power. By default, resources are pre-allocated, and you're charged per hour for the resources you've requested. You can also specify a *serverless* configuration. In this configuration, Microsoft creates its own server, which might be shared by databases belonging to other Azure subscribers. Microsoft ensures the privacy of your database. Your database automatically scales and resources are allocated or deallocated as required.

#### Elastic Pool <a href="#elastic-pool" id="elastic-pool"></a>

This option is similar to *Single Database*, except that by default multiple databases can share the same resources, such as memory, data storage space, and processing power through multiple-tenancy. The resources are referred to as a *pool*. You create the pool, and only your databases can use the pool. This model is useful if you have databases with resource requirements that vary over time, and can help you to reduce costs. For example, your payroll database might require plenty of CPU power at the end of each month as you handle payroll processing, but at other times the database might become much less active. You might have another database that is used for running reports. This database might become active for several days in the middle of the month as management reports are generated, but with a lighter load at other times. Elastic Pool enables you to use the resources available in the pool, and then release the resources once processing has completed.
{% endhint %}

{% hint style="info" %}

* Azure SQL Managed Instance provides features not available in Azure SQL Database. If your system uses features such as linked servers, Service Broker (a message processing system that can be used to distribute work across servers), or Database Mail (which enables your database to send email messages to users), then you should use managed instance.&#x20;
* To check compatibility with an existing on-premises system, [Data Migration Assistant (DMA)](https://www.microsoft.com/download/details.aspx?id=53595) tool helps to analyzes databases on SQL Server and reports any issues that could block migration to a managed instance.<br>
  {% endhint %}

{% hint style="info" %}
Azure Database Migration Service

* Service that migrates databases to the cloud with no application code changes.
  {% endhint %}

Features of **Azure Database for MySQL & MariaDB**

* Built-in high availability with no additional cost.
* Predictable performance, using inclusive pay-as-you-go pricing.
* Easy scaling that responds quickly to demand.
* Secure data, both at rest and in motion.
* Automatic backups and point-in-time restore for the last 35 days.
* Enterprise-level security and compliance with legislation.

## Non-Relational Database

### Azure Storage <a href="#azure-storage" id="azure-storage"></a>

Azure Storage is a core Azure service that enables you to store data in:

#### **Blob containers** - scalable, cost-effective storage for binary files.

* supports
  * Block blobs - contains up to 50,000 blocks, each of size up to 100 MB, giving a max total of \~4.7 TB.
  * Page blobs - a collection of fixed size 512-byte pages, can hold up to 8TB of data.
  * Append blobs - updating and deletion is not supported and can have a size of 195 GB.

#### **File shares** - network file shares such as you typically find in corporate networks.

* Azure Files enables you to share up to 100 TB of data in a single storage account.&#x20;
* The maximum size of a single file is 1 TB, but can be configured to set quotas to limit the size of each share below this figure.&#x20;
* Azure File Storage supports up to 2000 concurrent connections per shared file.
* supports
  * ***Server Message Block*****&#x20;(SMB)** file sharing is commonly used across multiple operating systems (Windows, Linux, macOS).
  * ***Network File System*****&#x20;(NFS)** shares are used by some Linux and macOS versions. To create an NFS share, you must use a premium tier storage account and create and configure a virtual network through which access to the share can be controlled.

#### **Tables** - key-value storage for applications that need to read and write data values quickly.

* An Azure Table enables you to store semi-structured data.
* Azure Table Storage splits a table into partitions. Partitioning is a mechanism for grouping related rows, based on a common property or partition key.
* Partitions are independent from each other, and can grow or shrink as rows are added to, or removed from, a partition. A table can contain any number of partitions.
* When you search for data, you can include the partition key in the search criteria. This helps to narrow down the volume of data to be examined, and improves performance by reducing the amount of I/O (input and output operations, or *reads* and *writes*) needed to locate the data.

### Azure Data Lake Storage Gen2

* Azure Data Lake Store (Gen1) is a separate service for hierarchical data storage for analytical data lakes, often used by so-called *big data* analytical solutions that work with structured, semi-structured, and unstructured data stored in files.
* Systems like Hadoop in Azure HDInsight, Azure Databricks, and Azure Synapse Analytics can mount a distributed file system hosted in Azure Data Lake Store Gen2 and use it to process huge volumes of data.
