Why is AlwaysOn NOT A TRUE loadbalancer?

2025-03-29

Why is AlwaysOn NOT A TRUE loadbalancer?


Many people regard AlwaysOn as a db loadbalance solution. But actually it is not.   Let me explain a little bit as follows.


In AlwaysOn, there are TWO kinds of connectionstrings. One is the normal connectionstrings which will connect to the primary, the other is the read-only connectionstrings which will connect to the secondary. Now here pops up the question: when a client program wants to connect to the back-end database, who decides to use which kind of connectstrings? The answer is obvious: the developer or the programmer who have the right to modify the source code, not the so-called route list. However on the market most applications have only ONE normal connectstring and you are not allowed to modify the source code. How do you use AlwaysOn to achieve load balancing under such conditions?


By the way, as far as I know, the same problem also exists in RAC.


However, in our solution , there is only ONE connectionstring while our GW(abbr for cluster gateway, a middleware and a key componenet of our solution) will simultaneously connect to each db node in the cluster. When the client issues a sql request, our GW   will receive it and analyze it. If the request contains only the read-only selects, it will be sent to the secondary node(read-only), otherwise to the MAIN node(equivalent to the primary in AlwaysOn).


By the way, our solution is called DBTwin Active-active Database Cluster.


Hope I have made myself clear.


For more details, please contact me:

My WhatsApp account is: Gary Shen +886 902068876

My Telegram account is: Gary Shen +86 18260489381


Or visit our website: http://www.zhetides.com


阅读78
分享