K
K
kurdyukov2015-12-10 00:39:40
Domain Name System
kurdyukov, 2015-12-10 00:39:40

Backend from several servers, is the scheme reliable?

I am designing a server architecture for the backend of a mobile application, the data is mostly dynamic, I decided to use apache + mod_php + mysql. I would like to achieve maximum fault tolerance and fast response from any regions of the Russian Federation.

I decided to take two VPS as balancers in different regions, I plan to use HAProxy and link them in Anycast DNS. In each of the two regions, I plan to have two VPS not very powerful with Apache + PHP + MySQL, if I don’t have enough over time, I’ll add more. The databases will also be synchronized with each other through the balancer.

1. How is the layout? working at all? I haven’t dealt with Anycast DNS yet, so there are doubts, if one balancer goes down, DNS will still select this server because it is closer to the client?
2. If you follow this scheme, then configure HAProxy as leastconn or in another way?
3. Is it possible to prescribe in HAProxy that let's say two servers are the main ones, so that the load between them is only distributed, but if suddenly these servers are overloaded or go down, then send requests to others, from another region?

Here is a diagram to make it clearer.
3eaf45aea65e48c9bc7d12384567e828.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav Barsukov, 2015-12-10
@slavabars

Your issue of balancing at the DNS level is solved without the intervention of any software. it's enough just to spread the DNS to different servers
server 1 - ns1.domen.com ns2.domen.com
server 2 - ns1.domen.com ns2.domen.com
The scheme is reliable, but yours is not correct. Because no synchronization between nodes.

P
Puma Thailand, 2015-12-10
@opium

depends purely on how you will sink everything

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question