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.
- Visual Studio 2012 or later with C#. Download a free version at Visual Studio Downloads.
- NuGet 2.7 or later. To get the latest version, see Installing NuGet.
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:
Download the Elastic DB Tools for Azure SQL - Getting Started sample from MSDN. Unzip the sample to a location that you choose.
To create a project, open the ElasticScaleStarterKit.sln solution from the C# directory.
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).
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.
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.
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.
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
Splitting an existing shard: The capability to split shards is provided by the split-merge tool. For more information, see Moving data between scaled-out cloud databases.
Merging existing shards: Shard merges are also performed by using the split-merge tool. For more information, see Moving data between scaled-out cloud databases.
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.
For more information about elastic database tools, see the following pages:
- Elastic database tools documentation map
- Code samples:
- Blog: Elastic Scale announcement
- Microsoft Virtual Academy: Implementing Scale-Out Using Sharding with the Elastic Database Client Library Video
- Channel 9: Elastic Scale overview video
- Discussion forum: Azure SQL Database forum
- To measure performance: Performance counters for shard map manager