Skip to content

Spreading your SQL Server wings with Azure SQL Edge

Reading Time: 3 minutes

In this post I want to cover spreading your SQL Server wings with Azure SQL Edge. As part of a series of posts about spreading your SQL Server wings with the Microsoft Intelligent Data Platform.

You can find out more about this series of posts in an introductory post I published about the series.

By the end of this post, you will have a good overview of all of Azure SQL Edge. In addition, how your SQL Server background can come in handy with it.

Since I covered spreading your SQL Server wings with Azure SQL Database I thought it was only fair I covered Azure SQL Edge as well. Because I feel that other members of the Azure SQL family tend to get more attention.

To help with some jargon here, Azure SQL refers to the collection of the below Azure SQL database services that are available in Azure:

Microsoft provides a dedicated experience in the portal which allows you to deploy any of the above members of the Azure SQL family. Which you can see below.

Azure SQL deployment options
Azure SQL deployment options

Azure SQL Edge

Azure SQL Edge is a version of the SQL database engine that is designed to be deployed on IoT (Internet of Things) devices.

It is based on SQL Server 2019. Which means that by default all new databases are created using the SQL Server 2019 compatibility level. You can lower the compatibility level all the way down to SQL Server 2008 if required.

Even though Azure SQL Edge is lightweight and portable it still includes features to help perform data streaming and time-series processing. Similar to Azure Stream Analytics.

Like a famous British comedian once said, and there’s more. You can also deploy ONNX models to Azure SQL Edge as well.

Which I think is a nice touch. Especially when it means you can have streaming capabilities and a SQL Server database running on devices like sensors.

Azure SQL Edge Docker container

In reality there are two different deployment modes for Azure SQL Edge. Because you can deploy containers running Azure SQL Edge as well. Including local Docker containers.

Which can be very useful when testing functionality. For example, I created a local container with Docker Personal.

First, I configured a new Docker container based on the Azure SQL Edge image. I then restored the AdventureWorks 2019 database within the container and checked it exists using Azure Data Studio.

Overview of Azure SQL Edge container within Azure Data Studio to help with spreading your SQL Server wings with Azure SQL Edge
Overview of Azure SQL Edge container within Azure Data Studio

To test the waters I ran the sys.dm_db_index_physical_stats DMV. Since I ran it a lot when I was heavily focused on SQL Server performance tuning. Which worked nicely.

So, I decided to take it one step further and ran various scripts from the diagnostic scripts for SQL Server 2019 created by Glenn Berry. Which worked fine.

Only thing that surprised me a bit is that the build number was not on Glenn’s list.

Microsoft Azure SQL Edge Developer (RTM) - 15.0.2000.1574 (X64)  	Jan 25 2023 11:33:34  	Copyright (C) 2019 Microsoft Corporation 	Linux (Ubuntu 18.04.6 LTS) <X64>

Being able to deploy Azure SQL Edge locally introduces some interesting testing possibilities. For example, you can deploy a container locally and then test streaming functionality using various mechanisms.

CI/CD for Azure SQL Edge

You can perform CI/CD on the databases within a SQL Edge container using either a state-based or migration-based approach when working with a local container.

In addition, Microsoft provides a guide on working with SQL Database DACPAC and BACPAC packages in SQL Edge.

Another interesting point to consider is that you can potentially look to work with tSQLt to perform unit testing as well. Since it is based on SQL Server 2019.

Which can be handy. Especially if looking to perform CI/CD with either Azure DevOps or GitHub Actions

Final words

I hope this post about spreading your SQL Server wings with Azure SQL Edge has helped some of you get a better understanding it. Because it has some interesting possibilities.

If it has piqued your interest, I highly recommend experimenting with it running in a local Docker container first. In addition, it is worth looking at the full guide about the supported features of Azure SQL Edge.

Of course, if you have any comments or queries about this post feel free to reach out to me.

Published inAzure SQL EdgeSQL Server

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *