Reference Documentation
Resource Limits
This section details the various resource limits you might encounter when using Azure Database for MySQL. Understanding these limits is crucial for planning and optimizing your database deployments.
| Resource | Description | Limit |
|---|---|---|
| vCores | Virtual CPU units for compute. | Varies by pricing tier (e.g., 2, 4, 8, 16...). |
| Memory | RAM allocated to the server. | Proportional to vCores, e.g., 1 vCore = 2 GB RAM. |
| Storage | Maximum data storage capacity. | Up to 16 TB (depending on tier and region). |
| Connection Limit | Maximum concurrent connections. | Depends on tier and server configuration (e.g., 300-1500+). |
| I/O Operations Per Second (IOPS) | Throughput for storage. | Varies with storage size and tier. |
Supported MySQL Versions
Azure Database for MySQL supports specific versions of the MySQL Community Edition. Choosing the right version is important for compatibility and access to new features.
- MySQL 5.6
- MySQL 5.7
- MySQL 8.0
When creating a new server, you select the desired major version. Azure Database for MySQL does not support in-place upgrades between major versions (e.g., 5.7 to 8.0). Migration strategies are required for such upgrades.
Networking
Securely connect to your Azure Database for MySQL instance using various networking options.
Firewall Rules
By default, Azure Database for MySQL is protected by a firewall. You must configure firewall rules to allow access from specific IP addresses or IP address ranges.
You can configure firewall rules through the Azure portal, Azure CLI, or REST API.
# Example: Allowing access from a specific IP address using Azure CLI
az mysql server firewall-rule create --resource-group myresourcegroup --server myservername --name allow_my_ip --start-ip-address 203.0.113.25 --end-ip-address 203.0.113.25
Virtual Network Service Endpoints
Service endpoints extend your Azure Virtual Network (VNet) to the Azure Database for MySQL service. This enables you to restrict network access to only your VNet resources.
Private Link
Azure Private Link provides a secure and private connection to Azure Database for MySQL from your VNet. It ensures that traffic between your VNet and the database stays entirely within the Microsoft Azure backbone network.
Security Considerations
Azure Database for MySQL offers robust security features to protect your data.
Authentication
Supports MySQL native authentication and Azure Active Directory (Azure AD) authentication.
Authorization
Standard MySQL user roles and privileges are managed within the database. Azure AD roles can be used for administrative access.
Encryption
- Encryption at rest: All data, backups, and transaction logs are encrypted at rest using AES-256.
- Encryption in transit: SSL/TLS is used to encrypt connections between your application and the database server.
Performance Tuning
Optimize the performance of your Azure Database for MySQL instance:
- Right-sizing: Choose the appropriate pricing tier (Basic, General Purpose, Memory Optimized) and compute size based on your workload.
- Indexing: Ensure proper indexing of your tables to speed up query execution.
- Query Optimization: Analyze and optimize slow-running queries using tools like
EXPLAIN. - Connection Pooling: Implement connection pooling in your applications to reduce the overhead of establishing new connections.
- Monitoring Metrics: Regularly monitor key performance metrics like CPU utilization, memory usage, IOPS, and connection count.
Monitoring and Alerting
Azure Database for MySQL integrates with Azure Monitor for comprehensive monitoring.
Metrics
Key metrics include:
- CPU utilization
- Memory utilization
- Storage utilization
- IOPS and throughput
- Connections
- Query performance
Activity Log
The Azure Activity Log records subscription-level events, such as the creation or deletion of servers and changes to firewall rules.
Diagnostic Settings
Configure diagnostic settings to send logs and metrics to Log Analytics, Storage Accounts, or Event Hubs for deeper analysis.
Alerts
Set up alerts based on metric thresholds to be notified of potential issues before they impact your applications.
Backup and Restore
Azure Database for MySQL automatically performs full, incremental, and transaction log backups of your data.
Backup Retention
Backup retention periods can be configured from 7 to 35 days. Geo-redundant backups are available for enhanced data durability.
Point-in-Time Restore (PITR)
You can restore your server to any point in time within your configured backup retention period. This is invaluable for recovering from accidental data corruption or deletions.
Geo-Restore
If geo-redundancy is enabled, you can restore your server to a different Azure region.
API Reference
Azure Database for MySQL can be managed programmatically using:
- Azure REST API: A RESTful API for managing Azure resources.
- Azure CLI: A command-line interface for managing Azure resources.
- Azure SDKs: Libraries for various programming languages (Python, .NET, Java, etc.).
Refer to the Azure Database for MySQL REST API documentation for detailed information on available operations.