Database mirroring: "witness" server what is it for?

001 picture 001 · May 6, 2010 · Viewed 17k times · Source

What is a witness server used for? Why use it?

Answer

Remus Rusanu picture Remus Rusanu · May 6, 2010

The witness is the one that brings the third vote into the mix in order to create a quorum. Principal and mirror each has one vote, so they can tie 1:1 and no decision can be made. With a witness there can be a quorum established 2:1 or 1:2 (or o:2 if the principal is unreachable) and therefore a decision can reached who should be the new principal. The net effect is that witnesses make automatic failover possible, because the mirror together with the witness can form a majority and decide to fail over if contact with the principal is lost.