Azure SQL Database Serverless is a new way to pay for your database, where you only pay for the compute resources you use, rather than having to provision a fixed amount of resources upfront. This can save you money if your database usage varies.
You can scale your database up or down as needed, without having to worry about provisioning or overprovisioning resources. This makes it perfect for applications with unpredictable workloads.
With Azure SQL Database Serverless, you can set a maximum cost per hour, and you'll never pay more than that. This gives you complete control over your costs and eliminates the risk of unexpected bills.
What Is Azure SQL Database Serverless
Azure SQL Database Serverless is a model that eliminates the need for managing the OS and software, but still requires knowing the capacity needed to meet workload requirements. It's designed to auto-scale based on threshold criteria to meet elastic scaling needs.
The serverless model is supported by SQL Server Database on Azure, and it's a great option for those who want to simplify their database management. You can create a serverless Azure database by following the instructions in the Microsoft documentation.
The billing for Serverless is different from DTU and Provisioned models. It charges per second your database runs, multiplied by the number of nodes you've selected. For example, if your max node amount is 4 and it costs $0.00045 per second, your total would be $0.00045 * 4.
Here's a breakdown of the costs for each model:
As you can see, the costs are quite different between the models, so it's essential to choose the right one for your needs.
Azure SQL Database Serverless Features
Azure SQL Database Serverless Features are designed to provide flexibility and scalability to your database needs.
You can choose from three service tiers: DTUs, Provisioned, and Serverless.
The Serverless model charges you per second your database runs times the number of nodes you have selected, with a cost of $0.00045 per second per node.
This model is ideal for workloads that have variable or unpredictable traffic.
To give you a better idea of the costs involved, a database with 100 DTUs costs $281.58 a month.
If you spin up your database on September 1st, your daily bill would be this amount divided by the number of days in the billing cycle.
The Serverless model eliminates the need to manage the OS and software, but you still need to know the capacity you need to meet your workload requirements.
Here's a breakdown of the three service tiers:
Working with Serverless Pools
To create a database in a serverless SQL pool, you need to go to the Synapse workspace and choose the serverless option. You can then give the database a name.
In Azure Data Factory, you need to create a linked service to Azure Synapse, but if you're using a serverless pool, ADF won't display your database in the list. To work around this, you can simply type the database name in manually.
To access data in the serverless pool, you need to create a dataset. This involves choosing Azure Synapse Analytics as the type and specifying the linked service you created earlier. You can either enter the table name or select it from the dropdown.
To use a credential in the FROM OPENROWSET clause of a view, you need to give the managed identity permissions to use this credential. This can be done with a SQL statement, such as the one used to add a server credential to the database.
In a serverless model, the onus of managing the OS and software gets eliminated, but you still need to know the capacity you need to meet the requirements of your workloads. A serverless pool can auto-scale based on threshold criteria to meet the elastic scaling needs of your workloads.
Here are the key components of a serverless pool:
- Pipelines - for orchestrating data processing
- Data Flow - for carrying out data manipulation without writing any code
- Spark (Notebooks and Jobs) - for combining live code and visualizations
- SQL Serverless (SQL-on-demand) - for querying data using a SQL-like syntax
- SQL Pools - for deploying a dedicated SQL DataWarehouse
- CosmosDB (via Synapse Link) - for working directly with data stored inside of Cosmos
To create a new database within your Synapse account, you need to create a SQL script and view one of the files within the data lake.
Creating and Deploying Serverless
You can create a serverless Azure database, which eliminates the need to manage the OS and software, but still requires you to know the capacity needed to meet your workloads' requirements.
To create a serverless database, you can choose from the following service tiers: DTUs, Provisioned, and Serverless. You can choose these options during database creation or change them later.
Azure Data Factory (ADF) can be used to read data from Azure Synapse Serverless SQL Pools, but it expects dedicated pools and doesn't display newly created databases in the list. To work around this, you can type in the database name yourself.
Synthesis
To create a seamless experience for our users, we need to synthesize the data from various sources. This can be done by creating a SQL Serverless view that queries multiple files from Azure Data Lake using a SQL like syntax.
With the ability to query multiple files, we can simplify our data access and reduce the complexity of our data infrastructure. This is achieved by using a script that can query the entire folder, rather than individual files.
We can also use Azure Data Factory to read data from Azure Synapse Serverless SQL Pools, but first, we need to create a database and a view in the serverless SQL pool. This involves creating a linked service to Azure Synapse, specifying the database and table name, and adding the managed identity to the database.
To access the data, we need to give the managed identity permissions to use the credentials, which can be done with a SQL statement that adds the login and user to the serverless pool. This allows us to preview the data and use it in a Copy data activity or in a data flow.
By synthesizing the data from various sources, we can create a unified view that can be queried from Power BI. This involves creating a SQL Serverless view that exposes the data, which can then be accessed from Power BI using the Azure SQL Database option.
Create a Serverless
To create a serverless database, you can use the Azure SQL Database service, which supports the serverless model. This model eliminates the need to manage the OS and software, but you still need to know the capacity required to meet your workload's needs.
In the serverless model, the database can auto-scale based on threshold criteria to meet elastic scaling needs. This is particularly useful for workloads that have variable or unpredictable usage patterns.
You can create a serverless Azure database by following the steps outlined in the article. This will allow you to take advantage of the serverless model and its benefits.
One of the key benefits of the serverless model is that it only charges you for the time your database is running, rather than a fixed monthly fee. This can help reduce costs and make it easier to scale your database up or down as needed.
Here are the key characteristics of the serverless model:
Keep in mind that the serverless model is not suitable for all workloads, and you should carefully consider your needs before choosing this option. However, for many applications, the serverless model can provide significant benefits in terms of cost and scalability.
SQL Service and Serverless
Azure SQL Database Service Tiers offer flexibility in scaling and pricing. You can choose from DTUs, Provisioned, and Serverless options.
The three options are: DTUs, Provisioned, and Serverless. Each has its own pricing model, with DTU and Provisioned charging on a monthly basis, while Serverless charges per second of usage.
Serverless is a more cost-effective option, especially for databases with variable workloads. If you're considering a Serverless database, keep in mind that it charges per second of usage, and the cost is calculated based on the number of nodes selected.
Here's a breakdown of the pricing for each option:
For example, a database with 100 DTUs would cost $281.58 per month. The daily bill would be this amount divided by the number of days in a billing cycle.
Synapse
Synapse is a comprehensive analytics solution that provides the ability to load, manipulate, and analyze data. It's a powerful tool that comprises several parts, including Pipelines, Data Flow, Spark, SQL Serverless, SQL Pools, and CosmosDB.
Azure Synapse includes Pipelines for orchestrating data processing, Data Flow for carrying out data manipulation without writing any code, and Spark for combining live code, visualizations, and text blocks. SQL Serverless allows for querying data using a SQL-like syntax without deploying SQL infrastructure, while SQL Pools enable deploying a dedicated SQL DataWarehouse.
To create a new SQL script within Synapse, you must first create a SQL script for creating a new database within your Synapse account. This involves viewing one of the files within the data lake and creating a new script.
Here are the different parts of Azure Synapse:
Azure Synapse also includes CosmosDB, which allows you to work directly with data stored inside of Cosmos. To do this, you can create a Synapse Link, which enables you to access CosmosDB data from within Synapse.
SQL Service
Azure Synapse Serverless SQL Pools offer a flexible way to manage your SQL databases. You can create a database and a view in the Synapse workspace, and then use Azure Data Factory (ADF) to read data from it.
To read data from Azure Synapse Serverless SQL Pools using ADF, you need to create a linked service to Azure Synapse. However, ADF expects dedicated pools, so you need to type in the name of your serverless database manually.
To access data in your database, you need to create a dataset in ADF. This involves specifying a name, choosing the linked service, and entering the table name or selecting it from the dropdown.
You also need to give the managed identity permissions to use the credentials in the FROM OPENROWSET clause of the view to connect to Cosmos DB. This can be done with a SQL statement that grants the necessary permissions.
Here are the three Azure SQL Database Service Tiers:
- DTUs: charge your account on a monthly basis, with a cost of $281.58 per month for a database with 100 DTUs.
- Provisioned: also charge on a monthly basis, with a cost that can be calculated by dividing the monthly cost by the number of days in a billing cycle.
- Serverless: charges per second your database runs, with a cost of $0.00045 per second per node, and a maximum of 4 nodes.
Remote Results and Serverless
The remote results of an Azure SQL Database serverless model are truly impressive. 20 threads were executed from a batch file within 3 seconds, as tracked by the rows in the TBL_CONTROL_CARD table.
We can see that the execution of prime numbers took 6 minutes and 12 seconds to complete, with each record having a time of discovery. The auto pause feature is crucial in saving costs, as it prevents the subscription from being charged when the CPU is paused.
The billing for an Azure Serverless Database is a combination of storage and compute, with the auto pause feature set to a low value for best savings. This is evident from the 13.56K v-Core seconds used during the test, which resulted in a charge of 94 cents during that hour.
The benefits of the serverless model are clear, with the ability to auto-scale based on threshold criteria to meet the elastic scaling needs of workloads. This is a significant advantage over traditional models, where the onus of managing the OS and software is eliminated.
Frequently Asked Questions
What is the latency of Azure SQL serverless?
Auto-resume latency for Azure SQL serverless is approximately 1 minute, while auto-pause latency is 1-10 minutes after the delay period expires
Sources
- https://endjin.com/blog/2021/05/how-to-use-azure-synapse-sql-serverless-to-connect-data-lake-and-power-bi
- https://sqlkover.com/read-data-from-azure-synapse-serverless-sql-pools-with-azure-data-factory/
- https://vitalidedkov.medium.com/azure-sql-database-configuration-standard-dtu-vs-vcore-provisioned-vs-vcore-serverless-6158776b4784
- https://www.sqlshack.com/create-a-serverless-azure-sql-database/
- https://www.mssqltips.com/sqlservertip/6273/going-serverless-with-azure-sql-database/
Featured Images: pexels.com