11.1 High availability and Network Load Balancing

Source: Internet
Author: User
Tags failover node server

11.1 High availability and Network Load Balancing


11.1.1 Concept of high availability

High Availability (High-availability) is a series of technology totals that reduce downtime and increase protection of business data.

The following two factors need to be considered when planning for high availability:

RTO (Recovery time Objective, i.e. target recovery times)

RTO indicates how much downtime the business system tolerates, usually calculated with the following formula, and the larger the value, the less time it takes to get down to the system. For example, for a business system running on a 24*365, 99.999% means less than 5 minutes of downtime per year.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/5B/26/wKiom1UABXrCj5oJAACt9yjRSvE910.jpg "title=" Highly available algorithm. jpg "alt=" wkiom1uabxrcj5ojaact9yjrsve910.jpg "/>

Of course, regular scheduled maintenance times (i.e. windows) are generally not counted as downtime. For example, operating hours are limited to business systems from 7 o'clock in the morning to 10 o'clock (i.e. 7*15), and downtime maintenance after work is not counted as downtime.


RPO (Recovery point Objective, target recovery points)

RPO indicates how much data loss is tolerated. Typically, you can make your data non-lost by just doing a backup. However, when a disaster occurs, recovering from a backup causes the database to be unavailable at this stage, and if the recovery time is particularly long, the loss may be more severe than the loss of a small amount of data. Especially for databases with very large data volumes, there is a need to pre-empt the weight between recovery time and data loss to make adequate plans.


Typically, there is a conflict between RTO and RPO, which needs to be weighed against a number of factors, such as business requirements, investment size, and so on, to develop SLAs (service level agreement, or SLA).



11.1.2 AlwaysOn High Availability Solution

Starting with SQL Server 2008, Microsoft uses the word AlwaysOn in high availability, disaster recovery technology. In SQL Server 2012, Microsoft explicitly typed in an AlwaysOn sign.

SQL Server AlwaysOn is a "comprehensive high availability and disaster recovery solution." With AlwaysOn, you can increase application availability and gain a better return on your hardware investment by simplifying your deployment and management of high availability.

SQL Server AlwaysOn provides availability at the following 2 levels.

Database-level availability

AlwaysOn availability groups allow a set of databases to be synchronized to a maximum of 4 read replicas, which is a new feature introduced by SQL Server 2012. SQL Server 2014 increases the number of read replicas to 8.

AlwaysOn availability groups are a kind of "hot backup" technology. The primary server's data is automatically synchronized to the other replicas, and the primary and secondary replicas are basically kept in real-time synchronization. When the system detects a failure of the primary server, the secondary replica can become the new primary server immediately.


Instance-level availability

AlwaysOn failover cluster instances can implement failover (fail-over) between up to 16 nodes (Enterprise Edition supports 16 nodes, Standard Edition supports only 2 nodes).

A failover cluster is a "cold backup" technology. The secondary node does not synchronize data from the primary node, and only one copy of the data is saved in the shared storage. When the primary node fails, the secondary node promotes the primary node and obtains data from the shared storage before starting the SQL Server service in the new primary node server.



11.1.3 Other High Availability solutions

Database Mirroring

Database mirroring is a database-level high-availability technology formally introduced by SQL Server 2005 SP1.

Mirroring is a "warm backup" technology. The principal server and the mirror server are running the SQL Server service concurrently, and the mirror server restores the backup data from the principal server and obtains a small amount of meta data. When the principal server fails, the mirror server can quickly load all the required metadata and then become the new principal server.

There are many deficiencies in database mirroring technology, so the online manual for SQL Server 2012 has affirmed that mirroring technology will be removed in a future release.


Log shipping

Log shipping relies on traditional Windows technology with SQL Server agent.

The primary server periodically generates a backup file, and the secondary server periodically accesses the Windows folder to read and copy the backup files and then periodically restores them to the local database. In fact, the log shipping technology only realizes automatic backup and automatic restore on the primary server and the secondary server respectively.


Other assistive Technologies

Backing up the database, when a failure occurs, manually restoring the data to the server, which brings the database back online, can also be counted as a technical means of achieving high availability.

Replication is not considered a high-availability solution, but its functionality allows for high availability. Replication uses publish-subscribe mode, where the primary server publishes data to the secondary server to enable availability between these servers.



11.1.4 Network Load Balancing

The database engine is a special Windows service. In order to implement transactions, access requests from clients are usually associated and sequential, and the service stores some data states on its own, so this type of service is called a "stateful service" (Stateful services).

For read-only databases, access requests from clients do not need to implement transactions, and each access request does not depend on other access requests. All the information required for each request is included in the request, and the service provided by the read-only database does not need to hold the data state requested by the client, so this type of service is called a "stateless service" (stateless services).

Other Windows services, such as IIS (Internet Information Service), can also be designed as stateless services. At this point, although the IIS service does not need to save the data state requested by the client, the IIS service can be obtained from an external (for example, a database).

In general, stateless services can be pooled, creating multiple services of the same type as an application pool (application pool), with algorithms that distribute client requests evenly across multiple services. This scale-out technique can be referred to as Network Load Balancing (balancing, referred to as NLB).

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6C/3E/wKioL1VCFN6BfdSMAACXb1WZ4SI183.jpg "title=" pooling. png "alt=" Wkiol1vcfn6bfdsmaacxb1wz4si183.jpg "/>


Load balancing gives the client a sense of continuity, just like high-availability technology. For example, when a client connects to an IIS pool and one of the IIS servers in the pool fails, the client's connection is redirected to the other IIS servers in the pool.

A part of the load Balancing feature in highly available technology. For example, a secondary replica of an AlwaysOn availability group can provide read-only access, thereby allocating a subset of read-only access requests to applications such as reports.



This article from "SQLServer2014 series" blog, declined reprint!

11.1 High availability and Network Load Balancing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.