A database service, or Database as a Service (DBaaS), lets a cloud provider manage the underlying server and database software while customers manage the databases hosted there. section 1.2.2
Mistake #38: installing a SQL Server virtual machine when a managed database service will suffice. The choice can increase operational work and cost, especially for a greenfield cloud application with uncertain capacity and a stretched DBA team. section 8.6 section 1.3
Choose the service boundary deliberately:
- AWS RDS and Azure SQL Database provide DBaaS, leaving the provider responsible for lower infrastructure layers. section 1.2.2
- Azure SQL Managed Instance provides a middle ground: customers manage the SQL Server instance while Azure manages the operating system and virtual machine. section 1.2.2
- Do not assume DBaaS removes SQL Server expertise; database design, development, and code optimization still affect performance. section 1.3
- Compare the premium for hosting, patching, securing, and optimizing the lower stack against the cost of operating infrastructure yourself. section 1.3
MagicChoc’s cloud application
MagicChoc planned an Azure application using Event Grid, Functions, and Kubernetes Service, with uncertain database capacity. Recommending an Azure SQL virtual machine instead of Azure SQL Database ignored the advantages of a cloud-native managed service. section 8.6
Listing 8.5 Creating an autoscaling Azure SQL Database
$sqlAdminName = 'MagicChocAdmin'
$sqlAdminPassword = 'Passw0rd!'
$credentials = $(New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $sqlAdminName,
$(ConvertTo-SecureString -String $sqlAdminPassword -AsPlainText -Force))
$serverParameters = @{
ServerName = 'processautomationsql'
Location = 'eastus2'
SqlAdministratorCredentials = $credentials
ResourceGroupName = 'MagicChocApps'
}
New-AzSqlServer @serverParameters
$databaseParameters = @{
ResourceGroupName = 'MagicChocApps'
ServerName = 'processautomationsql'
DatabaseName = 'AutoPro'
Edition = 'GeneralPurpose'
ComputeModel = 'Serverless'
ComputeGeneration = 'Gen5'
MinimumCapacity = 2
Vcore = 16
}
New-AzSqlDatabase @databaseParameters
Use the PowerShell listing to create a serverless, autoscaling Azure SQL Database with General Purpose, Gen5, minimum-capacity, and vCore settings. section 8.6
