# Cosmos DB
#cloud #Azure #databases
Azure SQL Database is a high-performance, reliable, fully managed, and secure relational database based on the latest stable version of the Microsoft SQL Server database engine provided by Azure.
Azure Cosmos DB is flexible as it stores data in atom-record-sequence (ARS) format which is then abstracted and projected as an API, which you specify when you’re creating your database. Your choices include SQL, MongoDB, Cassandra, Tables, and Gremlin. This allows the user to keep the native API (i.e. no changes to the application code).
# Managed Database engines:
Azure provides fully managed database capabilities for SQLServer, MySQL and PostgreSQL databases which provides the following benifits:
- Built-in high availability with no additional cost.
- Predictable performance and inclusive, pay-as-you-go pricing.
- Scale as needed, within seconds.
- Ability to protect sensitive data at rest and in motion.
- Automatic backups.
- Enterprise-grade security and compliance.
# Azure Database for MySQL
Azure Database for MySQL offers several service tiers, and each tier provides different performance and capabilities to support lightweight to heavyweight database workloads. You can build your first app on a small database for a few dollars a month, then adjust the scale to meet the needs of your solution. Dynamic scalability enables your database to transparently respond to rapidly changing resource requirements. You only pay for the resources you need, and only when you need them.
# Azure Database for PostgreSQL
Azure Database for PostgreSQL is a relational database service in the cloud. The server software is based on the community version of the open-source PostgreSQL database engine. Your familiarity with tools and expertise with PostgreSQL is applicable when you’re using Azure Database for PostgreSQL.
Azure Database for PostgreSQL is available in two deployment options: Single Server and Hyperscale (Citus).
Single Server All those capabilities require almost no administration, and all are provided at no additional cost. You can focus on rapid application development and accelerating your time to market rather than having to manage virtual machines and infrastructure. You can continue to develop your application with the open-source tools and platform of your choice, without having to learn new skills.
The Single Server deployment option offers three pricing tiers: Basic, General Purpose, and Memory Optimized. Each tier offers different resource capabilities to support your database workloads. You can build your first app on a small database for a few dollars a month, then adjust the scale to meet the needs of your solution. Dynamic scalability enables your database to transparently respond to rapidly changing resource requirements. You only pay for the resources you need, and only when you need them.
Hyperscale (Citus) The Hyperscale (Citus) option horizontally scales queries across multiple machines by using sharding. Its query engine parallelizes incoming SQL queries across these servers for faster responses on large datasets. It serves applications that require greater scale and performance, generally workloads that are approaching, or already exceed, 100 GB of data.
The Hyperscale (Citus) deployment option supports multi-tenant applications, real-time operational analytics, and high-throughput transactional workloads. Applications built for PostgreSQL can run distributed queries on Hyperscale (Citus) with standard connection libraries and minimal changes.
# Azure SQL Managed Instance (MI)
SQL Managed Instance (SQL MI) provides native Virtual Network (VNet) integration while Azure SQL Database enables restricted Virtual Network (VNet) access using VNET Endpoints and SQL MI also helps bridge the gap between Azure SQL Database and On-premises SQL Server due to being built on an instance scoped configuration model.
Azure SQL Managed Instance (MI) is similar to The Azure SQL-Database on the following topics: Management
- Backup
- Availability
- Host Accessibility
- License
However the key differences are:
1. Recovery model
Azure SQL Database: From automated backups only.
SQL MI: From automated backups and from full backups placed on Azure Blob Storage.
2. Active Geo-replication
SQL Database: Supported. In all service tiers other than Hyperscale.
SQL MI: Not supported. alternative solution is
Auto-failover groups.
3. Auto-failover groups
SQL Database: Supported. In all service tiers other than Hyperscale.
SQL MI: Supported.
4. Auto-scale
SQL Database: Only supported in Serverless model.
SQL MI: Not supported. You need to choose reserved compute and storage (vCore or max storage).
5. Automatic tuning (indexes)
SQL Database: Supported.
SQL MI: Not supported.
6. Elastic jobs
SQL Database: Supported.
SQL MI: Not supported.
SQL Agent can be used instead.
7. Long-term backup retention (LTR)
SQL Database: Supported. keep automatically taken backups up to 10 years.
SQL MI: Not supported yet. Manual backups as a temporary workaround.
8. Hyperscale architecture
SQL Database: Supported.
SQL MI: Not supported.
9. SQL Server Profiler
SQL Database: Not supported.
SQL MI: Supported.
10. Cross-database transactions
SQL Database: Not supported.
SQL MI: Supported.
11. Database mail (DbMail)
SQL Database: Not supported.
SQL MI: Supported.
12. Linked servers
SQL Database: Not supported.
SQL MI: Supported.
13. Service Broker
SQL Database: Not supported.
SQL MI: Supported.
14. SQL Server Agent
SQL Database: Not supported.
SQL MI: Supported.
15. SQL Server Auditing
SQL Database: Not supported.
SQL MI: Supported.
# REFERENCES:
# Azure database documentation
- Azure Analytics Services
- Azure Cosmos DB documentation
- Azure SQL Database documentation
- Azure SQL Managed Instance documentation
- Azure Database for MySQL documentation
- Azure Database for PostgreSQL documentation
# Migrating database workloads to Azure
- Migrate SQL workloads to Azure
- Migrate SQL Workloads to Azure SQL Databases
- Migrate SQL Workloads to Azure SQL Managed Instances
- Migrate on-premises MySQL databases to Azure Database for MySQL