SQL – Creating a SQL Server AlwaysOn on Amazon EC2, Part 6

In this last post of the AlwaysOn series I’m going to build a simple C# console application to demonstrate how a  business app can benifit from using an AlwaysOn enabled database.

In Visual Studio I’m going to create a Console Application project:

1To be flexible in changing connection strings and SQL queries I’m going to use an external XML config file – App.config. For that I need to include few additional namespaces into my Program.cs code:

App1 Continue reading

SQL – Creating a SQL Server AlwaysOn on Amazon EC2, Part 1

I was keen to test SQL Server AlwaysOn feature for some time now. And in this post I’ll share some of the configuration steps that I have encountered by bringing AlwaysOn cluster on Amazon EC2.

There is a really helpful Amazon whitepaper related to this topic [AlwaysOn], but I’ve decided to make my life complicated and chose to use Free Tier micro instances [t1.micro]. As a result I had to change the networking design quite significantly.
Micro instances have a restriction on the network interfaces: each instance can have 2 network adapters at most and each adapter can have a maximum of 2 IPs enabled. This is a purely EC2 limitation, in Windows I can configure as many IPs as I want, but they won’t be able to interact with the network. EC2 will be filtering out invalid IP addresses.

OK, so lets start with the high level design. I want to have two SQL servers located in the separate sites [separate Amazon Availablity Zones], belonging to the same SQL AlwaysOn Group. Because AlwaysOn is based on Windows Failover Cluster I need that as well, just without a shared storage. And I also need a Domain Controller, puting it in yet another site.
Continue reading