Design a architecture for 100% availability Services-for any system (B/S,C/S) [English-Chinese version]
How to design an architecture which has a percent availability service?
Copyright, reproduced Please specify the source http://blog.csdn.net/yangzhenping , thank you!
This original non-translation, there is a need to design and deployment of this architecture, please private message me, thank you!
I've been thinking about how to design a 100% availability service, so we have the original version:
For example, there are multiple backup Web servers and database servers, and one synchronization server synchronizes data from primary database A to other replicas from the server
Here's the problem:
When database server a is not yet synchronized to B by dbsync server , a goes down and we may lose some of the data.
So how can we not lose data?
As above graph, there is some backup Web servers and database servers, also has one sync server to sync data from master Database server A to other slave database servers.
Then problem comes:
We may lost some data when some data on DBS A didn ' t sync Todbs B and it is outage!
How can we not be lose any data?
According to the design of the above problems encountered, I have designed the following architecture, of course, this architecture can continue to improve, the end of the article:
Based on above problem, I-design Another architecture like below, of course we can improve it again, talk it at the end of This article:
Web server A submits a SQL script request (containing RequestID, which is a Guid type) to the primary database server a, a The DBSync Service synchronizes this SQL script request to replica server B, and then executes the SQL script on a . Finally, the results are returned to Web server A.
The same database server receives a request from a , synchronizes this SQL script to the next replica server C , and then executes the result returned to the RCS result comparison server (all replica server The DBSync Service will return results to RCS).
RCS Result comparison the server compares the results of the primary database server and the results performed by the replica server based on the same RequestID :
If the primary DBS succeeds, the replica execution fails and theRCS is re-executed on the replica until it succeeds.
If the primary DBS execution fails and the replica fails, theRCS will not do anything.
If the primary DBS execution fails and the replica executes successfully, we have two options:
Select one: TheRCS is re-executed on the primary DBS until successful, and then notifies the user that the failed task he submitted earlier has now succeeded.
Option two:RCS rolls back the successful SQL script on the replica server and does nothing on the main DBS .
Web Server A request a SQL script (Contains RequestID, it ISA Guid type) to Master dbs A with DBS a its sync service would s Ync the Sqlscript to Slave B, then DBS A ' s Sync service would do the SQL script and thenreturn the result to Web Server a.
Also DBS B's Sync service receive the SQL script would syncthe SQL script to the next Slave DB server C and then execute the s QL script Andreturn toresult Compare server (Allslave DB server ' s DB Sync service'll return the result toRe Sult Compare Server).
Result Compare Server would Compare the result Usingrequestid, Compare the Mater ' s RequestID result to Slave ' s RequestID re Sult:
If Master execute pass, but Slave execute failure, the RCS Willrerun until pass on Slave.
If Master execute fail, and Slave execute failure, RCS Willdo nothing on Slave.
If Master execute fail, but Slave execute pass,
Option 1, RCS would rerun on Master until pass and notifyuser about this request pass when it pass.
Option 2, RCS would roll back the SQL script action to Slave,and do nothing on Master.
The end of the article by the way, this can continue to improve the availability of services, is to build a RCS of the backup server.
This article mainly provides a 100% availability architecture for the Web server and database server, of course, you can also apply it to the C/s architecture.
At the end of this article, you can improve it for a better service, that's deploy another RCS backup server.
This article provide a-to-deploy 100% high Availability Web server and database server, for course, you can also use it In C/s, not only b/s, thanks.
Copyright, reproduced Please specify the source http://blog.csdn.net/yangzhenping , thank you!
Design a architecture for 100% availability Services-for any system (B/S,C/S) [English-Chinese version]