Using SQL Data Sync to Synchronize On-Premises Database to Windows Azure

Have you ever thought of scaling your Web Application so that it can extend the usage to external parties or have you ever hit in any situation where you have some subset of your data in your on-premises SQL Server that you require it for other system that are external facing? Let’s take for example, if you have an intranet that is hosted within your own corporate network which store membership details that you all are keeping it for internal usage all along. Then on one fine day you all decide to explore the Cloud by putting your custom developed newsletter blasting system to the Cloud as you would prefer not to choked up the bandwidth in your corporate network. Therefore, how in this world could we have the best of the both world? How can we maintain a set of information but can be used in multiple systems in multiple locations but still maintain the integrity and consistency without any duplication within the dataset itself? SQL Data Sync Agent is here to save the woes of people who are facing such issue. Currently, the SQL Data Sync Agent is in the Preview stage and has not reached the General Availability stage therefore things may change but I anticipate that things wouldn’t be that far off as the current tool is really designed and developed to be simple and user friendly. More information on TechNet. Let’s take the following as an example. I have this 3 tables in one of my Web Application that is hosted in my corporate data centre which is hosted within the network and no external interface to the internet. Right now, I need to surface the membership table to one of the newly created database in Windows Azure so that the other application that is hosted on Windows Azure will be able to access these information. Creation of Windows Azure SQL Database Let’s navigate to Windows Azure Management Portal then select SQL Databases via the left hand corner navigation bar. If this Azure account is newly created, then you probably wouldn’t have any database created. Click on Create a SQL Database to continue. Key in the necessary information to continue the setup of the SQL Database on Windows Azure. If you do not have any SQL Database instance setup before, you will likely not have any SQL Server setup. Therefore, go ahead and select “New SQL Database Server”. Continue to define the SQL database server settings by entering your preferred username and password. Please note that this username and password is very important because it is the username you will be using to log on to the SQL Server Management Portal on Windows Azure Management Portal. Do note that you will need to ensure that you check that checkbox if you want other of your Windows Azure Services to access this database. An example will be, if you decided to host your Web Application to host onto one of the Virtual Machine while utilizing the Database hosted on Windows Azure SQL Database rather than loading and managing your own SQL Server instance on Virtual Machine. Go ahead and click on the “Tick” to proceed to create your SQL Database. The creation process should take less than one minute and you will know it is done when the database status is flag as “Online”. Installation of SQL Data Sync Agent (Preview) and Configuration of Sync Agent Go ahead and download the SQL Data Sync Agent if you have not done so and install on any of the computer within your corporate network which have access to the internal SQL Server. In my example, I will just install the SQL Data Sync Agent onto the SQL Server itself but it should be the same even if the two program seats on separate client. After installation, launch Microsoft SQL Data Sync Agent Preview found in the start menu as shown. You will be welcome by the simple and neat interface. You will notice that most of the controls are being gray out. What you are left with is to enter the Agent Key so that Windows Azure can communicate with your client that host the SQL Data Sync program. Upon clicking on the Submit Agent Key Configuration, a popup will appear as shown below. However, on first try, I have no idea what to key in. There after, I caught this message that I have highlighted. The key that is require can be retrieved from the SQL Data Sync web portal. Navigate back to the Windows Azure Management Portal, navigate to the SQL Databases and look at the bottom. You will notice there are other navigational items available. Click on Add Sync which will show two more options available. Select New Sync Agent. Give a name to the Sync Agent. Notice at the top, it actually prompt you that you will need your local client agent to be installed. Click on the “Tick” to proceed and this Sync Agent will be created. Notice the “Status” is currently flag as Offline because we have not configure the local agent to communicate with the one at Windows Azure. Our ultimate purpose is to get the key so that we can input into the configuration popup window at the local agent. So we click on the arrow at the Sync Agent to go into the detail page. Notice that at the bottom, there is this option “Manage Key” that is available. Click on it. Instructions is available at the top. Just click on the “Generate” button to generate the access key and click on the “Copy to Clipboard” button just beside the Generate button. When you are done, navigate back to the client that you install the local sync agent. Input the access key into the popup window. Once the key is validated to be valid, the other controls will be enabled. Click on “Register” to register the SQL Database in your organization. Enter the SQL Server details along with the targeted database that you want the Sync to take upon. Click on “Test Connection” to ensure that the connection can be established. Once verified, click “Save”. Now, you will notice that the SQL Database is being added to the list. In order to do a verification, click on “Ping Sync Service” to determine if the connection back to the Sync Agent at Windows Azure is reachable. Next navigate to the Windows Azure Management Portal. Right now, you should see the Sync Agent status will switch to “Online”. Click the arrow beside the Sync Agent to view the details inside. You should see the database and the SQL Server hostname. Creation of Sync Group and Objects Go back to the SQL Databases main menu and as usual click on “Add Sync” and select “New Sync Group” this time. Enter the details and select your desire region. Click the arrow to proceed and select the Hub Database and key in your desire credentials. Notice that there is this “Conflict Resolution”. What it actually does is in times of conflict, whose data should take the precedent. So it depends on which is your master database. If new information is mainly populate through the database server located within your organization, then select “Client Wins” else select “Hub Wins”. Click on the arrow to proceed. Now you will be prompt to select the referencing database. This time round, Windows Azure will need to know which database its needs to communicate with. In this case, it will be the database in the organization. Then select the Sync Direction on which how you want data to flow. Do you want the Windows Azure SQL Database to always read from the SQL Database in the Corporate Network or you may have changes that is always made on both end and you want synchronization between the two location? After you click on the “Tick”, it will go on to proceed the creation of the Sync Group. Then you will notice that the status will be shown as “Not Ready”. Fret not, it just means that you have not decide what to sync between the two SQL Database. Click on the Sync Group to view the details. You will notice the following. Select Sync Rules. You will be welcome with this page, by right you shouldn’t have any Sync Rules being added yet. Click on “Define Sync Rules”. Select one of the database. In this case, I select my SQL Server database that is located within the organization. You should see all the tables that you have that resemble the database back in the organization. Select the columns that you want to be Synchronized. For my case, I want the whole “Membership” table to be synchronize between the two data sources. Therefore, I check all the columns as shown in the table. After making the selection, click “Save” to commit your selection. Next, click on “Configure” on the top navigation and we will proceed with configuring the Automatic Synchronization of the data between the sources. Click on “ON” and define the Sync Frequency. Make sure to click on “Save” to commit the changes. Proceed to click on “Sync” to do a force synchronization between the two data sources so that we can see some results. Head back to the SQL Database on Windows Azure and click into the Database as shown. Click on “Set up Windows Azure firewall rules for this IP address” so that you will be able to connect into the management portal to manage the database. One of the magic charm bar will appear at the bottom with your IP address as the detail, just click Yes to proceed. Click on “Design your SQL database” to launch the SQL Database Management Portal. You will be prompted with the login screen to provide your credentials. Upon successful login, you should see the tables in your Windows Azure SQL Database. See the “Membership” table that was synchronized over. Let’s do some test by running query against this database. There, I have all the data synchronized over! This tool is really very useful and in any case, I could easily synchronized data from my on-premises database and treat the Windows Azure SQL Database as a passive node.

Singapore SQL Server User Group Sept Meetup

September User Group Meeting Speaker profile: Prakash S Sawant, Microsoft Technology Solution Specialist with ten years of experience in providing database solutions; Prakash is a subject matter expert in SQL Server Migration/ Upgrade and Performance Tuning. Prakash is also an active member for the development of content and methodology for the SQL Server 2008 R2 Upgrade and Application Compatibility Testing program. He has worked with more then 100+ Lab participants across India, USA, APAC and Middle East to assess Upgrade readiness and provide guidance on Upgrades from SQL Server 2000/2005 to SQL Server 2008. He has also created and delivered trainings for Microsoft’s SQL Server support engineers from various verticals. ...

Singapore SQL Server User Group July Meetup

Date: July 28th, 2011 Time: 7:00PM – 9:00 PM Registration starts at 6:30 PM Venue: NTUC Building 22CF-12 Microsoft Office One Marina Boulevard Speaker profile: Renaud HARDUIN is ESSILOR European IT Singapore Developement Service Manager, in Singapore (ESSILOR ITSS / 38 people / 6 teams). He is in charge of Europe IT Development Team and provides support for various Business Support. Renaud is MVP on SQL/BI since 2005. Michael LABASTIDA is ESSILOR BI Technical Leader & BI Expert In charge of one of the major BI ESSILOR Project in ESSILOR ITSS. ...

Singapore SQL Server User Group April Meetup

Date: April 28th, 2011 Time: 7:00PM – 9:00 PM Registration starts at 6:30 PM Venue: NTUC Building 22CF-12 Microsoft Office One Marina Boulevard Speaker profile: Renaud HARDUIN is ESSILOR European IT Singapore Developement Service Manager, in Singapore (ESSILOR ITSS / 38 people / 6 teams). He is in charge of Europe IT Development Team and provides support for various Business Support. Renaud is MVP on SQL/BI since 2005. Michael LABASTIDA is ESSILOR BI Technical Leader & BI Expert In charge of one of the major BI ESSILOR Project in ESSILOR ITSS. Alvin Lau is your average Joe in the application space and is a large advocate of .NET technologies since 2005. In his spare time, he runs SGDOTNET, a Singapore-based .NET user group, and loves to share his experience and knowledge. His area of interests includes ASP.Net, Agile development, SharePoint and Microsoft BI. ...

SG SQL User Group - SQL Server Technology update and security with Il-Sung Lee

Topic: SQL Server Technology update & roadmap – focus on TDE, integration with SAP, SQL Server Audit, security best practices & resources A deeper look at SQL Server Security – investments, developments, benchmarks, performances where possible. Date: March 18th, 2011 Time: 7:00PM – 9:00 PM Registration starts at 6:30 PM Venue: NTUC Building 22CF-12 Microsoft Office One Marina Boulevard, Singapore 018989 Please confirm your attendance by sending email to SGSQL@LIVE.COM Speaker profile: Il-Sung Lee, Senior Program Manager, SQL Server Engine Security, Microsoft Corp. Il-Sung Lee is a Senior Program Manager for the Engine team in the SQL Server product group and is the PM owner for SQL Server Engine Security component. Il-Sung has over thirteen years of experience in the database industry as a developer and a program manager focusing on database security and database communications. His current focus is to advance the capabilities of SQL Server in areas such as authentication, authorization, cryptography, audit, and data leak prevention. He is a regular presenter at TechEd and SQLPASS and has spoken at numerous other domestic and international conferences over the past several years. Il-Sung graduated with an M.Eng degree from McGill University and subsequently worked for several years at IBM in their Information Management group prior to joining Microsoft, initially with the SQL Server Protocols team before moving to the Core Security Infrastructure area. We welcome for any feedback to improve interaction and activity in our user group. We are looking for a brave speaker too! If you have anything to share, something interesting from your daily jobs, please share and present for us. Send your thought to SGSQL@LIVE.COM. If you have changed to another role or not around in Singapore anymore and want to be removed from our list, please email us at SGSQL@LIVE.COM. Thank you and have a nice day ahead!

{Community} Technology Update 2010

The Singapore user group communities, Professional .NET User Group, SQL Server User Group, and Windows IT Pros User Group, once again, have come together to bring to you a day of in-depth sessions and demonstrations of the newMicrosoft SQL Server 2008 R2 and Visual Studio 2010. Microsoft SQL Server 2008 R2 is packed with a wealth of new features and capabilities that can help organizations to scale with confidence on a trusted platform, improve IT and developer efficiency, and enable self service business intelligence. The benefits of the enhanced capabilities extend to application and multi-server management, complex event processing, master data services and powerful BI tools. Microsoft Visual Studio 2010 is an integrated environment that simplifies the whole development lifecycle, from design to development. Developers can use existing skills to model, code, debug and deploy a growing number of applications types. With SQL Server 2008 R2 and Visual Studio 2010, users will be able to create compelling applications that deliver business value soonest while maintaining the quality and integrity of your IT assets. Why should you attend the event: ...