Get started with elastic database tools

This document introduces you to the developer experience by helping you to run the sample app. The sample creates a simple sharded application and explores key capabilities of elastic database tools. The sample demonstrates functions of the elastic database client library.

To install the library, go to Microsoft.Azure.SqlDatabase.ElasticScale.Client. The library is installed with the sample app that's described in the following section.

Prerequisites

Download and run the sample app

The Elastic DB Tools for Azure SQL - Getting Started sample application illustrates the most important aspects of the development experience for sharded applications that use elastic database tools. It focuses on key use cases for shard map management, data-dependent routing, and multi-shard querying. To download and run the sample, follow these steps:

  1. Download the Elastic DB Tools for Azure SQL - Getting Started sample from MSDN. Unzip the sample to a location that you choose.

  2. To create a project, open the ElasticScaleStarterKit.sln solution from the C# directory.

  3. In the solution for the sample project, open the app.config file. Then follow the instructions in the file to add your Azure SQL Database server name and your sign-in information (user name and password).

  4. Build and run the application. When prompted, enable Visual Studio to restore the NuGet packages of the solution. This downloads the latest version of the elastic database client library from NuGet.

  5. Experiment with the different options to learn more about the client library capabilities. Note the steps the application takes in the console output and feel free to explore the code behind the scenes.

    Progress

Congratulations--you have successfully built and run your first sharded application by using elastic database tools on SQL Database. Use Visual Studio or SQL Server Management Studio to connect to your SQL database and take a quick look at the shards that the sample created. You will notice new sample shard databases and a shard map manager database that the sample has created.

Important

We recommend that you always use the latest version of Management Studio so that you stay synchronized with updates to Azure and SQL Database. Update SQL Server Management Studio.

Key pieces of the code sample

  • Managing shards and shard maps: The code illustrates how to work with shards, ranges, and mappings in the file ShardManagementUtils.cs. For more information, see Scale out databases with the shard map manager.

  • Data-dependent routing: Routing of transactions to the right shard is shown in DataDependentRoutingSample.cs. For more information, see Data-dependent routing.

  • Querying over multiple shards: Querying across shards is illustrated in the file MultiShardQuerySample.cs. For more information, see Multi-shard querying.

  • Adding empty shards: The iterative adding of new empty shards is performed by the code in the file CreateShardSample.cs. For more information, see Scale out databases with the shard map manager.

Other elastic scale operations

Cost

The elastic database tools are free. When you use elastic database tools, you don't receive any additional charges on top of the cost of your Azure usage.

For example, the sample application creates new databases. The cost for this depends on the SQL Database edition you choose and the Azure usage of your application.

For pricing information, see SQL Database pricing details.

Next steps

For more information about elastic database tools, see the following pages: