SQL Server Always On availability groups provide high availability for SQL Server databases by replicating databases from a primary SQL Server replica to one or more secondary replicas.
For a Windows Server VPS setup, the normal high-availability architecture is:
App server ↓ Availability Group Listener ↓ Primary SQL Server replica ↔ Secondary SQL Server replica ↓ Windows Server Failover Cluster ↓ Quorum witness
The important rule:
Always On is high availability. It is not a replacement for backups.
A good production setup needs:
- at least two Windows Server VMs;
- private networking between SQL nodes;
- Active Directory or a carefully designed cluster identity model;
- Windows Server Failover Clustering;
- SQL Server edition that supports the required AG features;
- same SQL Server version and patch level on replicas;
- comparable CPU, RAM, and disk layout;
- database in FULL recovery model;
- full and log backups before joining secondary databases;
- listener DNS/IP planning;
- quorum witness planning;
- firewall rules for SQL, cluster, and database mirroring endpoints;
- tested manual and automatic failover;
- backup and restore process independent of the AG.
If you are using SQL Server Standard edition, you are usually talking about a Basic Availability Group: two replicas, one database, and limited secondary capabilities.
If you need multiple databases failing over together, readable secondaries, backup offload to secondaries, more replicas, or advanced routing, you likely need SQL Server Enterprise.
Quick verdict
| Situation | Recommended path |
|---|---|
| One critical database on SQL Server Standard | Basic Availability Group |
| Multiple databases must fail over together | Enterprise Availability Group |
| Need readable secondary replicas | Enterprise Availability Group |
| Need backups on secondary replicas | Enterprise Availability Group |
| Need lowest-cost DR with manual recovery | Log shipping may be simpler |
| Need instance-level failover, jobs, logins, SQL Agent, linked servers | Consider Failover Cluster Instance or another architecture |
| Need automatic failover between two local nodes | Synchronous commit + automatic failover + WSFC quorum |
| Need DR across distance/regions | Asynchronous commit with manual/forced failover planning |
| Small app with light SQL usage | Start with backups first; HA may be overkill |
| Business-critical SQL workload | Always On + backups + monitoring + documented failover runbook |
Simple rule:
Backups protect data. Always On reduces downtime. Monitoring tells you when either one is failing.
What Always On availability groups do
An Always On availability group is a SQL Server high-availability and disaster-recovery feature.
It replicates selected user databases from a primary replica to one or more secondary replicas.
The primary replica accepts read-write traffic.
Secondary replicas receive transaction log records from the primary and apply them to local database copies.
Depending on edition and configuration, secondary replicas can be used for:
- failover;
- read-only workloads;
- backup offload;
- disaster recovery;
- reporting workloads;
- maintenance flexibility.
A listener gives applications a stable connection name.
Instead of connecting to a physical SQL Server VM, applications connect to:
sql-prod-listener.yourdomain.local
During failover, the listener moves to the new primary replica.
The application should reconnect to the listener and continue against the new primary database.
What Always On does not do
Always On does not protect against every database problem.
It does not replace:
- full backups;
- differential backups;
- transaction log backups;
- restore testing;
- corruption detection;
- security controls;
- application-level retry logic;
- monitoring;
- patching discipline;
- runbooks.
If a user deletes rows, that delete can replicate.
If a bad deployment changes data, that change can replicate.
If an application corrupts data logically, the corruption may replicate.
The AG keeps databases available.
Backups let you go back in time.
You need both.
SQL Server editions: Standard vs Enterprise
Always On capability depends heavily on SQL Server edition.

SQL Server Standard: Basic Availability Groups
SQL Server Standard supports Basic Availability Groups.
A Basic AG is useful for one important database that needs a failover replica.
But it has limits:
- two replicas only;
- one availability database per basic AG;
- no read access on the secondary replica;
- no backups on secondary replica;
- no DBCC integrity checks on secondary replica;
- only Standard edition support;
- cannot be upgraded in place to an advanced Enterprise AG.
For a small business with one core database, Basic AG can be enough.
For a serious multi-database application, it usually becomes limiting.
SQL Server Enterprise: Advanced Availability Groups
SQL Server Enterprise supports full Always On availability groups.
Use Enterprise when you need:
- multiple databases in one AG;
- databases failing over together;
- multiple secondary replicas;
- readable secondary replicas;
- backup offload to secondary replicas;
- read-only routing;
- larger HA/DR topology;
- more flexible failover design;
- distributed availability groups;
- contained availability groups;
- advanced SQL Server HA features.
Enterprise costs more, but it avoids many Standard edition limits.
Do not design a multi-database production architecture around Standard edition if the application expects all databases to fail over together.
Always On vs Failover Cluster Instance vs log shipping
SQL Server has multiple high-availability and disaster-recovery patterns.
Availability Group
Best for:
- database-level failover;
- one or more replicated databases;
- listener-based application failover;
- readable secondaries on Enterprise;
- local HA and remote DR patterns.
Trade-off:
- does not protect instance-level objects automatically;
- logins, SQL Agent jobs, linked servers, credentials, and server-level settings must be managed separately;
- requires careful database eligibility and synchronization.
Failover Cluster Instance
Best for:
- instance-level failover;
- shared storage environments;
- applications that depend heavily on SQL instance name and server-level objects;
- scenarios where the entire SQL instance should move together.
Trade-off:
- depends on shared storage or storage replication design;
- failover is instance-level rather than database-level;
- different infrastructure model.
Log shipping
Best for:
- low-cost disaster recovery;
- delayed copy protection;
- simple warm standby;
- manual failover tolerance;
- environments where HA complexity is not justified.
Trade-off:
- no automatic failover;
- usually more manual;
- recovery point depends on log backup frequency;
- connection redirection is not automatic unless you build it.
For many SMB workloads, log shipping plus good backups can be more realistic than a full Always On architecture.
Do not choose Always On just because it sounds enterprise-grade.
Choose it when the recovery objective justifies the complexity.
Recommended architecture on a Windows VPS

For a two-node SQL Server Always On setup:
Private network: 10.20.0.0/24 SQL01: Windows Server SQL Server instance Primary replica initially SQL02: Windows Server SQL Server instance Secondary replica initially AD / DNS: Domain controller and DNS WSFC: SQLCLUSTER Availability Group: AG_APP01 Listener: sql-app01-listener Quorum: File share witness or cloud witness
A common Raff-style design:
App VM ↓ private network SQL AG listener ↓ SQL01 + SQL02 ↓ Private network replication ↓ Quorum witness
Do not place the application and both SQL replicas on the same failure boundary if the goal is high availability.
If all components fail together, the AG does not protect the business.
What you'll need
Prepare:
- two Windows Server VMs for SQL replicas;
- one domain controller or existing Active Directory environment;
- SQL Server installed on both SQL nodes;
- matching SQL Server version, edition, and patch level;
- private network between SQL nodes;
- static private IPs;
- DNS working correctly;
- Windows Server Failover Clustering feature;
- domain account for SQL Server service if Kerberos/listener requirements apply;
- SQL Server Management Studio;
- database in FULL recovery model;
- recent full and log backups;
- firewall plan;
- quorum witness;
- listener name and IP address;
- maintenance window for setup and failover testing.
For production, use dedicated SQL Server VMs.
Do not run SQL Server Always On replicas on domain controllers.
Step 1 — Decide the AG model
Before touching Windows clustering, decide the SQL Server AG model.
Ask:
- Standard or Enterprise?
- One database or many?
- Automatic failover or manual failover?
- Synchronous or asynchronous commit?
- Local HA or remote DR?
- Listener or direct connection strings?
- Readable secondary needed?
- Backup offload needed?
- How much data loss is acceptable?
- How much downtime is acceptable?
- Who performs failover?
- How will applications reconnect?
Do not build the cluster first and decide the business requirements later.
Step 2 — Prepare Active Directory and DNS
For most Windows SQL Server Always On deployments, Active Directory makes the architecture cleaner.
Prepare:
- domain-joined SQL01 and SQL02;
- DNS records working;
- time sync healthy;
- service accounts documented;
- cluster computer object permissions planned;
- listener name planned;
- SPN planning if Kerberos is required.
Check domain join:
(Get-WmiObject Win32_ComputerSystem).Domain
Check DNS:
Resolve-DnsName SQL01 Resolve-DnsName SQL02
If DNS is unhealthy, stop.
SQL Server clustering and listeners depend on reliable name resolution.
Step 3 — Prepare both SQL Server VMs
Both SQL replicas should be comparable.
Match:
- Windows Server version;
- SQL Server version;
- SQL Server edition;
- cumulative update level;
- collation where application requires it;
- data drive layout;
- log drive layout;
- TempDB design;
- service account model;
- firewall rules;
- SQL Server configuration.
Recommended folder layout:
D:\SQL\Data L:\SQL\Logs T:\SQL\TempDB B:\SQL\Backups
If you use a single disk, keep the folder structure consistent on both nodes.
Always On setup is easier when file paths match.
Step 4 — Install Windows Server Failover Clustering
Run on both SQL nodes:
Install-WindowsFeature Failover-Clustering -IncludeManagementTools
Verify:
Get-WindowsFeature Failover-Clustering
Then run cluster validation.
From one node:
Test-Cluster -Node SQL01,SQL02
Review the validation report.
Do not ignore storage, network, or system warnings without understanding them.
For an AG without shared storage, storage warnings may need interpretation, but network and system failures should be fixed.
Step 5 — Create the Windows Server Failover Cluster
Create the cluster:
New-Cluster -Name SQLCLUSTER -Node SQL01,SQL02 -StaticAddress 10.20.0.50
Check:
Get-Cluster Get-ClusterNode
Expected:
SQL01 Up SQL02 Up
Use a private IP for cluster communication and listener traffic where possible.
Avoid exposing SQL cluster endpoints directly to the public internet.
Step 6 — Configure quorum witness
A two-node cluster needs a witness to avoid split-brain behavior.
Common witness options:
- file share witness;
- cloud witness;
- disk witness if shared storage exists.
For a two-VM setup, a file share witness is common.
Example:
\\DC01\SQLClusterWitness
Configure:
Set-ClusterQuorum -FileShareWitness "\\DC01\SQLClusterWitness"
Check:
Get-ClusterQuorum
Do not run a two-node production cluster without understanding quorum.
If both nodes disagree about who should be online, quorum determines which side can continue.
Step 7 — Open required firewall paths
Plan firewall rules intentionally.
Common SQL AG communication includes:
| Purpose | Common port |
|---|---|
| SQL Server client connections | 1433 or configured SQL port |
| Database mirroring endpoint for AG data movement | 5022 by convention |
| WSFC / RPC / cluster communication | Windows cluster/RPC ports |
| SMB for file share witness | 445 |
| DNS | 53 |
| Kerberos | 88 |
| LDAP / AD | 389 / 636 where applicable |
Open only between trusted private IPs.
Example database mirroring endpoint rule:
New-NetFirewallRule ` -DisplayName "SQL Always On Endpoint 5022" ` -Direction Inbound ` -Protocol TCP ` -LocalPort 5022 ` -RemoteAddress "10.20.0.0/24" ` -Action Allow
Do not expose port 5022 or SQL Server listener ports publicly unless there is a very specific, protected architecture.