📜 ⬆️ ⬇️

Bidirectional transactional data replication

"MSSQL load distribution on 2 servers"


Good afternoon, habrazhiteli, so I decided to write about my history “Distribution of the load of MSSQL on 2 servers by the method of bidirectional transactional data replication”. And not just 2 servers, but what would they work like mirrors. Anyone interested, I invite you to read.
Who wants to go straight to the point
And of course, data replication came to the rescue. After reviewing the types of replication, let's consider the architecture that suits us best.
In our case, we were chasing the load distribution between 2 servers. Well, and walked through the logical chain of "load distribution - 2 server mirrors - minimum delays - transactional replication." And since there was little experience at all, again I went to msdn. And then I went into the article, started reading one, went through a couple of explanations of the terms, and was completely distracted. In other ways, like me from the main topic ...
First, I had the type of transactional replication as "Peer-to-Peer Transactional Replication ". I do not know how many, but I often first look at the topology in the form of a diagram, and then I just get a grasp of it. This time, again, I got caught by my own mistake.
image
I looked at this topology, well, I liked it, that on the left there is a “read-write” to both servers, everything is beautiful, the load is distributed. In case of a fall, for a while, one server will cope.
Well, in joy, I began to customize, or rather get a grasp of the setting and try it on test bases. At first, I visited this page and I liked the phrase “ When setting up the topology of active databases to add the first and second nodes (node ​​A and node B), the following procedure is used. The next procedure is then used to add node C and all subsequent nodes . ” In particular, these 2 phrases “the next procedure ” and “the next procedure ” and further in the text about the three-node peer-to-peer topology.
And then, by luck, I decided to return to the page where I started and read about this topology and again I’ve come across the key phrase “ On the left, update operations are partitioned between two servers. If the database contains a product catalog, you can, for example, create a custom application that directs updates of product names starting with letters from “A” to “M” to node A, and updates of products starting with letters from “H” to “I "- on node B. Then updates are replicated to another node ." So this is not what I wanted, and it means that when server “A” crashes, there will be only a part of the data.
And again, in sadness and grief, a long surf through the expanses of links, although the decision was under the nose. I stumble on the article " Bidirectional Transactional Replication ." And again, a smile on his face, and again his hands are torn into battle. And when I read the setting of this replication, a little smile subsides, and I understand that I do not understand anything in the setting of replication. After several hours of reading, trial and error, the situation begins to clear up. In the configuration of bidirectional replication, most of it is described in the configuration through the procedures, I will show my own configuration method according to which this topology works for me.

Well, let's start. I advise you first do this on the test bases . Basically I will throw links, well, describe the " pitfalls " that may occur on the way
image

Well, almost everything. I will welcome any advice and criticism.

')

Source: https://habr.com/ru/post/170213/


All Articles