Availability of large sites technical architecture, high availability architecture of the 5 site data

5.5 high availability of data

Means to ensure high availability of data storage and data backup is mainly failover mechanisms.

Data backup is to ensure that there are multiple copies of data, a copy of any failure will not result in the permanent loss of data, in order to achieve complete data persistence.

The failover mechanism is guaranteed when a copy of the data is inaccessible, the other copy can quickly switch to access data, to ensure that the system is available.

 

Cache is not data storage services, the cache server downtime caused by loss of cached data resulting in server load pressure is too high should be resolved through other means, rather than improve availability caching service itself.

 

For stand-alone cache servers in the cluster goes down, if the larger cache server cluster, then the cache data loss due to downtime stand-alone database load ratio and pressure changes are small, the impact on the entire system is also smaller.

A simple means of expanding the size of the cache server cluster is distributed throughout the site to share the same cache clusters, and the product does not require a separate application to deploy its own cache server, only you need to apply for a shared cache cluster cache resources can be.

And each application may be buffered by a logical or physical partitioning manner deployed on multiple servers, a cache server downtime due to any failure affects only a small part of the cache data application, database, and application performance will not load a major impact.

 

5.5.1 CAP principle

 

Several layers of meaning high availability data

 

Data Persistence

Ensure sustainable data storage, data loss will not occur in all cases. To back up data redundancy

 

Data Accessibility

Data storage equipment damage, the need to quickly switch to another storage device, almost no end user perception.

 

Data consistency

In the case of multiple copies of data, if the network, server or software failure, success will lead to a partial replica is written, a copy of the written part of the failure.

This can lead to data inconsistencies between the various copies of the data content of conflict.

For example, the data update operation failed to return, in fact, the data storage server has been updated successfully.

 

CAP principle states that a service providing data storage system can not meet at the same time data consistency (Consistency), data availability (Availibility), patience partition / partitions fault tolerance (Patition Tolerance, the system has the scalability across a network partitions) three condition

 

In large web applications, data is always rapid expansion of the scale, and therefore the future scalability zoning patience is essential, become larger, the number of machines will become large, then the network and server failures occur frequently, to want to ensure that the application is available, it is necessary to ensure high availability of distributed processing system.

 

So large sites usually choose to strengthen the distributed storage system availability (A) and scalability (P), and to some extent give up consistency (C).

In general, data inconsistencies usually occurs when the system is highly concurrent writes or unstable state of the cluster (failover, cluster expansion ...), the applications require data to distributed data processing system is inconsistent understanding and a sense of compensation and error correction, in order to avoid the application system data is incorrect.

CAP principle is important for scalable, distributed system design, system design and development process, not properly cater to the various needs of an attempt to create a perfect product, it may make the design into the dilemma, unsustainable.

 

Specifically, data consistency can be divided into the following points:

 

Strong data consistency

Each copy of the data in the physical storage is always the same;

Results of operations and operational data update response is always the same, that the operation in response to the notification update fails, then the data must not be updated, rather than in an indeterminate state.

 

Consistent user data

I.e., each copy of the data stored in the physical data may be inconsistent, but the end user to access, by error correction and checking mechanism to determine a consistent and correct data back to the user.

 

Eventually consistent data

This is a weaker data consistency, i.e., physical storage data can be inconsistent, the end user access to the data may also be inconsistent (continuous access to the same user, the different result; or simultaneous access to different users, different results) , but the system after a period of time (usually a relatively short period of time) of self-recovery and correction, data will eventually reach agreement.

 

Because it is difficult to meet the strong data consistency, sites often general terms of cost, technology, business scenarios, combined with application services and other data monitoring and error correction, the storage system to achieve the same user, end-user access to ensure the correctness of the data.

 

5.5.2 Data Backup

Cold standby data: periodically copy the data stored to the archive and to some physical storage medium if the storage system is damaged, then recover data from a storage device in cold standby.

Cold standby agreement does not guarantee the final data, because it is backed up regularly, if system data is lost, after starting from the last backup point update data will be permanently lost can not be restored from a backup.

 

But also can not guarantee data availability, data recovery from cold storage equipment takes a long time, and this time can not access the data, the system will not be available.

 

Cold standby is generally used in the daily operation and maintenance, and in real-time online business website, it is also the need for hot standby data to provide better data availability.

 

Tracking data into two categories: synchronous and asynchronous hot standby mode hot standby mode.

Asynchronous mode refers to a write operation asynchronous multiple copies of data is completed, the application receives a data write operation is successful service system response, just write a successful storage system will asynchronously write other copies (this process is likely It will fail).

 

 In the asynchronous writing, the storage server is divided into a main storage server (Master) and from the storage server (the Slave), under normal circumstances, application server connected to only the main memory, when data is written to by the main storage server agent module writes after the data is written to return the machine memory system immediately write operation success response, and then writes the data to synchronize the asynchronous thread from the storage server.

 

Synchronous mode refers writes multiple copies of data synchronization is complete, ie write data service application receives a successful response system, multiple copies of data already written a successful operation.

But when the application receives data written in response to the failed operation, there may be some or all copies of copies have already written a success (because of network or system failure, unable to return to operating a successful response)

 

 After synchronization embodied hot standby time, in order to improve performance, concurrent client application writes data to a plurality of storage servers at the same time, and then wait for all storage servers returning operation success response, and then notifies the application that the write was successful.

 

In this case, the server does not store the master points, and the like to complete, easy to manage and maintain. Storage service client in writing multiple copies of data, the concurrent operation, which means that the total write multiple copies of data latency is the slowest response in response to that storage server delay, rather than multiple storage servers and the response delay. And its performance is almost asynchronous hot standby mode.

 

Hot standby mechanism relational database known as the Master-Slave synchronization mechanism. Master-Slave data backup mechanism will not only solve problems, but also to improve the performance of database systems, in practice, usually used separate read and write access methods Slave and Master database, the Master database write-only access, read-only access Slave database.

 

5.5.3 failover

 

Guess you like

Origin www.cnblogs.com/wozixiaoyao/p/11497762.html