Wednesday 30 January 2013

Migrating to Windows Azure

 
At times we need to migrate our existing applications to cloud. While migrating our application we also need to migrate the database related to this application.
Following the best practices it is always suggested that you migrate the database before migrating the application.
In this article we will see what are the steps typically followed to migrate an existing database to SQL Azure.
As usual for any activity we need to follow the cycle of


For this simple migration activity also let us follow the same cycle.
So, let us start with step 1
Planning:
In this step we will do two things:
·         Identify tools for migration
·         Identify the migration steps
Tools for Migration:
The most common tool use to migrate a SQL database to SQL Azure is: SQL Azure Migration Wizard.
Using this tool we can:
a.       Analyze
b.      Revise
c.       Migrate Schema
d.      Migrate Data
From any on-premise database to SQL Azure database or SQL database for cloud.
So, now out of the two step of planning,
ü  Identify tools for migration
·         Identify the migration steps
The first step is over.
Now we need to identify the steps to migrate the data.
Following are the 5 steps that should be followed for migrating a database from on-premise to cloud.

Now, that we are done with identify tool to migrate and listed out the steps.
The first phase of planning is done.
ü  Identify tools for migration
ü  Identify the migration steps
















Now, let’s look at the second phase analysis phase.
Analysis:
In this phase you basically analyze the requirements, for example:


Size of database is critical because of following reasons:
a.       Currently SQL Azure Database have a size limit for a 50GB so if our database is larger, then we need to partition into multiple databases.
b.      Also, large data takes a long time to transmit and so we may face a delay in the data transmission.
These two factors should be analyzed properly and if needed based on these, the plan may need to be modified.



Let’s now, see how the version of database is a critical factor in the database migration from on-premise to azure environment.
a.       Are you moving from SQL Server 2008 or SQL Server 2008 R2? If yes, the database migration to SQL Azure should not take a long time.
b.      If your existing version of on-premise database is an earlier version of SQL Server, it is recommended you “stage” your migration by moving your database over to SQL Server 2008 R2 first, and then up into the cloud on SQL Azure. 
    So, based on these factors also you need to revisit you plan.    
           
Now that we have seen how the size of database and version of database affect the analysis phase, let us now see how the complexity of database affects the analysis.
Before venturing into this, let us first understand what a simple database is?
A simple database is one which deals mostly with data. It may contain a few SPs, triggers, etc.
A complex database on the other hand depend on database server features like  Windows authentication, SQL Agent jobs, replication, full text search, XML indexing, distributed transactions, and transparent data encryption.
If your database is a complex database, you cannot migrate it to SQL Azure , because some of the features of complex database are not yet supported by SQL Azure.

So, by the end of anlysis phase you have completed the analysis of the database and also, updated the plan for any changes.
Next we will see the Execution phase.



3 comments: