0

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.

Anish Karunakaran
  • 987
  • 3
  • 17
  • 39

2 Answers2

2

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.

Rob
  • 4,733
  • 3
  • 32
  • 29
  • How can i migrate data into the federated databse.. I am also facing a problem from identity not supported in federation. few of my tables contains identity specification and lots of data. Please reply if u have any insight relating to the problem. – Anish Karunakaran Jul 11 '13 at 05:18
1

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).

Alexander Galkin
  • 12,086
  • 12
  • 63
  • 115
  • Am using sql queries not EF. And in my code all are plain text as command type. – Anish Karunakaran Jun 27 '13 at 04:48
  • How can i migrate data into the federated databse.. I am also facing a problem from identity not supported in federation. few of my tables contains identity specification and lots of data. Please reply if u have any insight relating to the problem. – Anish Karunakaran Jul 11 '13 at 05:19