Understanding database mirroring
Database mirroring is a technology used for both HA and DR, which allows for rich configuration. Mirroring is largely replaced by other features of MS SQL Server, mainly Always On Availability Groups. Mirroring should not be considered a primary HA/DR option for new deployments; however, it's still important to understand mirroring, especially because of migrations from older SQL Server installations, which may still use mirroring for HA/DR.
Mirroring uses up to three server roles:
- Principal
- Mirror
- Witness
The principal server holds the database that is mirrored. This database has to be configured with the Full Recovery model in order to participate in the mirroring configuration. The mirror server holds a mirrored copy of the database, but unlike replication or log shipping, this database is not available for user access. The witness server can be configured in case you would like to utilize automatic failover...