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.