Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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. any relevant tutorial available?.From where should i begin.

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

Thanks.

share|improve this question

2 Answers

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

share|improve this answer
Am using sql queries not EF. And in my code all are plain text as command type. – Anish Karunakaran 4 hours ago

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.