skip to content

What is the difference between a SQL Server failover cluster instance and an Always On availability group, and what does each one fail over?

level: middleimportance: must knowfreq 68%

answer

  1. instance level versus database level
  2. shared storage versus separate copies
  3. what lives in master and msdb
  4. listener and read-intent routing

basics

~20 s

A failover cluster instance is one SQL Server instance on shared storage that restarts on another node: whole-instance protection, one copy of data. An availability group keeps separate copies of chosen databases on several instances and fails over just those.

solid answer

~50 s

A **failover cluster instance (FCI)** is a single SQL Server instance installed across Windows Server Failover Cluster nodes, with its data and log on shared storage. On failure another node starts the instance against the same disks, so logins, Agent jobs and every database move together, but the storage is one copy and a single point of failure, and passive nodes are not readable. An **availability group (AG)** ships the log of a chosen set of user databases to secondary replicas, each with its own instance and storage; it fails over that group of databases, offers readable secondaries and backups on secondaries, and clients follow it through the **listener**. Logins and jobs in `master` and `msdb` do not move with an AG, so they are kept in sync by hand unless it is a **contained availability group** (SQL Server 2022 and later).

go deeper

for a junior

Recall that a failover cluster instance protects an instance on shared disks and an availability group protects databases by copying their log.

for a middle

Explain shared versus separate storage, what fails over in each, how the listener routes read-intent sessions, and what stays behind in master and msdb.

for a senior

Show you know the operational traps: unsynchronised logins and jobs after failover, read-only routing that ignores a missing database name, and FCI-hosted replicas that cannot fail over automatically.

for a principal

Weigh one copy on shared storage against several copies with their licensing, storage and synchronisation costs, and decide which failures each layer must cover.

## Failover cluster instances A **failover cluster instance (FCI)** is one installation of SQL Server spread across the nodes of a **Windows Server Failover Cluster (WSFC)**. Only one node owns the instance at a time. Its system and user databases sit on **shared storage**: cluster disks, a SAN, Storage Spaces Direct or an SMB file share. When the active node fails, or is restarted for patching, the cluster starts the SQL Server service on another node against the same disks, and crash recovery runs as after any restart. What that buys and what it costs: - **Protection level: the instance.** Logins, SQL Server Agent jobs, linked servers and every database come back together, because they are the same files. - **One copy of the data.** The shared storage is a single point of failure; the FCI relies on the storage layer for data protection. - **No readable standby.** Passive nodes have not started SQL Server, so they cannot serve queries. - **Same name after failover.** Clients connect to the FCI's virtual network name, which moves with the instance. ## Availability groups An **Always On availability group (AG)** protects a set of **user databases**, not an instance. A primary replica sends the transaction log of each database to up to eight secondary replicas, each on its own instance and its own storage, so there are several independent copies. Each replica has an availability mode (synchronous or asynchronous commit) and a failover mode, and the group fails over as a unit. The databases must use the FULL recovery model. On Windows the AG still relies on a WSFC for health monitoring and quorum (on Linux, a cluster manager such as Pacemaker), but not on shared storage. ## Side by side | | Failover cluster instance | Availability group | |---|---|---| | Protects | The whole instance | A group of user databases | | Storage | Shared by all nodes | Separate per replica | | Copies of data | One | One per replica | | Readable standby | No | Yes, if configured | | Failed-over resources | Server, instance and databases | Databases only | | Client endpoint | Virtual network name | Availability group listener | ## Connecting through the listener The **availability group listener** is a virtual network name with one or more IP addresses that always points at the current primary. Two connection-string settings matter: - `ApplicationIntent=ReadOnly` marks a session as read-intent. If the replicas have a read-only routing URL and the primary has a `READ_ONLY_ROUTING_LIST`, the listener sends such sessions to a readable secondary. The connection must also name a database in the group, directly or as the login's default database. - `MultiSubnetFailover=True` makes the client try all the listener's IP addresses in parallel, which shortens reconnection after a failover; the documentation recommends it even for a group on a single subnet. ## Readable secondaries A secondary configured with `ALLOW_CONNECTIONS = READ_ONLY` or `ALL` can serve reports and backups. Queries there are mapped to **snapshot isolation** whatever isolation level or locking hint they ask for, so readers never block the redo thread with shared locks. The data is slightly behind the primary, usually by seconds, because a change becomes visible only after redo applies it. Enabling read access adds a 14-byte versioning pointer to modified rows on the primary, and a long query on the secondary can delay ghost-record cleanup on the primary. ## What does not move with an AG Objects stored in the system databases stay behind on each instance: 1. Logins and server-level permissions in `master`. 2. SQL Server Agent jobs in `msdb`, which must also check whether their replica is currently primary before doing work. 3. Linked servers and other server-level objects defined in `master`. A **contained availability group**, introduced in SQL Server 2022, carries its own `master` and `msdb` copies named after the group, so logins and jobs created through the group's listener fail over with it. SQL Server 2025 allows contained AGs inside a distributed availability group. ## Combining them An FCI can host one replica of an AG, for example an FCI in the primary datacenter for local instance failover and a standalone replica elsewhere for disaster recovery. A replica hosted on an FCI supports only manual AG failover, so this pairing is chosen for DR rather than for automatic database-level failover.

  • In SQL Server, why is a replica hosted on a failover cluster instance limited to manual availability-group failover?
    SQL Server does not support automatic availability-group failover for a replica hosted on an FCI; the FCI handles node failures itself, and any move to another replica must be manual. Designs that need automatic database-level failover use standalone instances as the synchronous replicas and keep the FCI plus AG combination for disaster recovery.
  • What does enabling a readable secondary cost the SQL Server primary?
    Modified rows on the primary gain a 14-byte row-versioning pointer, which can cause page splits, and a long query on the secondary can hold back ghost-record cleanup on the primary because the secondary still needs old row versions. The versions themselves are generated on the secondary, in its own tempdb.

  • A failover cluster instance keeps a second copy of the data on each node.
  • Every availability group fails logins and SQL Server Agent jobs over automatically.
  • Passive nodes of a failover cluster instance can serve read-only queries.
  • An availability group needs shared storage, just like a failover cluster instance.
  • A readable secondary shows a change as soon as the primary commits it.

Assumes SQL Server 2025; contained availability groups, which fail over logins and Agent jobs with the group, exist from SQL Server 2022.