A
A
andrei242017-05-27 13:11:36
API
andrei24, 2017-05-27 13:11:36

Cdn to backend?

There is a site the main audience: Australia, Europe.
Backend server with api hosted in Australia.
ping user from Australia 50 ms, from Europe 350 ms. Which is very long.
Deploying a server in Europe is not a problem, but how to make users from Europe send requests to it? And what about the database? do master - master ?
If you do balancing on nginx, then again, first the request goes to the server of Australia, then we determine the ip and go to the server of Europe. In theory, it will take even longer.
at the dns level. Again, where to place the dns server? If ping to it can also be large

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Entelis, 2017-05-27
@andrei24

Balancing in such cases is done on dns. As far as I remember, Amazon Route53 definitely knows how to geo-balance, but you can also look for some other service.
The main problem in this story is the issue of database synchronization.
master-master disgustingly works even between data centers in the same city - across the continent this is a stillborn idea
. In my opinion, this issue cannot be solved by purely admin tools - this is an extremely serious change in the project architecture and is very expensive to develop and support.
It is necessary to decide:
a) how realistic the data should be consistent. (if not much - you're lucky)
b) how much data needs to be synchronized (in events per second and in megabytes per second)
And then proceeding from this already sit down to think.

X
xmoonlight, 2017-05-27
@xmoonlight

1. SPA
2. Packet transmission of information in JSON format: several data at once
3. Compression of all traffic
4. Establish a logical connection (if any) between two different audience groups (by geolocation) and only synchronize this information between two different GEO- sites.
5. Using GEO-DNS, based on the user's IP address, direct to the nearest GEO site.

S
Svetlana, 2017-05-28
@Esmi

If you need a CDN only for API and database, then it will not suit you. CDN is needed for caching static: pictures, music, videos, fonts, js, css, html, etc., i.e. files that do not change with each request. Databases and APIs are dynamic because the data changes with each request.
If you need quick access to the database and at the same time its synchronization, I think you should look towards cloud services. This should be cheaper than buying a second server in Europe, setting up user balancing + database synchronization.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question