Question

Am very new to azure federation.In my project there is an existing SQL azure database and now we want to use azure federation for scaling that database.

How can I achieve this on my existing table myCustomer. Am planning to federate the table based on customer_Id. any relevant tutorial available?.From where should i begin.

By Federation do I have to change my existing queries used in the project.?

Thanks.

Was it helpful?

Solution

A rough summary of the changes you need to make to federate your database are:

  • Decide on an id you will federate on (e.g. user id)
  • For each table you wish to federate alter your table schema so the federation key is part of the primary key, and annotate the table so it knows which column is the federation key.
  • For each query that is run against a federated table you need ensure that the connection used is redirected towards the correct federation.

This last step is currently done by adding the USE FEDERATION statement to your queries. It can be a little tricky to implement if you are using Entity Framework or Linq. Something else to be cautious of in this area is making sure the USE FEDERATION statement is re-run if your transient error handling kicks in.

The links Alexander posted are all good to read.

OTHER TIPS

Did you read the article by George Huey in MSDN Magazine?

It covers transition from an existing SQL or Azure SQL DB to a DB with federations in the section called "Migrating Database Schema from SQL Server or SQL Azure to SQL Azure Federation".

Right after that I would recommend to read the tutorial on data querying (part1, part2).

You will have to change your queries if they want to access the data from federations. Basically, every federation is an independent SQL database and you have first to establish connection to correct federation before querying for data.

There are also some peculiarities how to use federations with Entity Framework, partially due to additional overhead for connection to federation instance, and partially because federations do not provide support for MARS operations (article).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top