Redis mimics MASTER / MASTER? or something different?

I read a lot of posts here and surfed the Internet, but maybe I am not asking the right question. I know that Redis is currently the master / subordinate until Cluster becomes available. However, I was wondering if anyone could tell me how I want to configure Redis logically to meet my needs (or if this is not the right tool).

Scenerio:

we have 2 sites on opposite ends of the USA. We want customers to be able to write on each site with a large volume. Then we want each client to be able to read on his site. However, we want the data to be accessible from a record on the sister site at <50ms. Given that we have a lot of bandwidth. Is there a way to configure redis to meet our needs? our maximum recording size will be on the order of 5k, usually much smaller. The main thing is how I can have 2 wizards that synchronize with each other, even if it is not supported by default.

+6
source share
3 answers

The trap with Tomโ€™s answer is that you donโ€™t start any cluster, you just write to two servers. This is a problem if you want to ensure consistency between them. Think about what happens when your client fails to record to the remote server. Are you canceling recording to local? What happens to the application when you cannot write to the remote server? What happens when you cannot read from local?

The second catch is a basic physics question that Joshua raises. For a circular trip, you say a theoretical minimum of 38 ms, leaving a theoretical maximum processing time at both ends (of the three systems) of 12 ms. I would say that there are too many expectations, and the bandwidth has nothing to do with the delay in this case. You may have a 10 GB handset, and these timings are still saved. However, transmitting 5k across a 12 ms continent also requires a lot. Are you sure that you have the ability to connect to transmit 5 thousand data in 50 ms, not to mention 12? I have been on private circuits without use on the continent and have seen ping times exceeding 50 ms and ping does not transmit 5k data.

How will you maintain the synchronization of two unrelated servers? If you really need sub-50 ms latency on the continent, the above theoretical option means that you have 12 ms to run the synchronization algorithms. Even one request to check data on another server means that you are outside the window of 50 ms. If the data is not synchronized, how do you fix it? Given the timings above, I donโ€™t see how it is possible to synchronize in less than 50 ms.

I would recommend reviewing the basic design requirements. In particular, why is this a requirement? Latent 50ms roundtrip across the continent is usually a sign of marketing or a lack of attention to detail. I would say that if you analyze the requirements, you will find that this 50 ms window is excessive and unnecessary. If this is not the case, and data synchronization is actually important (probably), then someone will need to determine whether it is worth the significant additional effort to write the synchronization code or even save 50 ms in the window. Data synchronization with a delay between sub-losses of 50 ms is not a simple problem.

If you donโ€™t need synchronization, why not just start one server? You can use a slave on the other side of the continent for recovery purposes. Of course, this all the same means that at best you have 12 ms to get the data back and forth. I will not count on 50 ms + trip + latency + 5k / 10k data transmission over the continent.

+11
source

It is approximately 19 ms at the speed of light to cross the United States. <50 ms will be difficult to achieve.

http://www.wolframalpha.com/input/?i=new+york+to+los+angeles

+11
source

This is probably best handled as part of your client - just ask the client to write both nodes. Usually you do not need to write synchronously, so sending an additional command should not affect the performance that you get from the local node.

+2
source

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


All Articles