Redis 6 will use the new protocol RESP3 to provide client-side caching

2020-07-31 02:15:12 0 Comment 1077 views


Antirez, the founder and core developer of Redis, introduced in his blog the new features that will be provided in Redis 6-Client side caching (client side caching).

Redis 6 will use the new protocol RESP3 to provide client-side caching

antirez meansThe new Redis protocol RESP3 will be the most important feature in Redis 6, and explained why he is so eager to improve the Redis protocol, there are two main reasons, one is because he hopes to provide more for clients Semantical responses (semantical replies) to develop functions that are difficult to achieve using the old protocol; another reason is that antirez considers the most important one, to achieve Client side caching (client side caching) function. This feature is very common, but Redis has not yet provided it.

When users need to perform fast storage or fast fetching operations, they need to store a small part of the information in the client memory. This is to reduce the delay of the program acquiring datalate. This feature is very important in large-scale applications, because the closer the data is to the application, the faster the program can get the data.

Inspired by Ben Malec’s speech, antirez thought that most of the data that needs to be stored and retrieved frequently can be directly placed in the server’s memory, so that Redis can complete part of the work for the client and make the client Caching is simpler and more effective. This is the concept of Client side caching.

However, there is a problem that needs to be solved in this idea, how to control the effective time of data? If the program allows, although you can directly set the valid time of the data, the data will become invalid after a period of time. But antirez said that most applications cannot accept the risk of providing outdated data, so they must find a more idealPlan to control the expiration time of data.

So antirez decided to develop a new protocol, RESP3, to add new features to the protocol to support the client-side caching function, and to ensure that the data stored in the client-side memory is invalidated when it receives an invalidation notification from the server.

In addition, when the connection between the client and the server is interrupted, the client cannot receive the data failure notification, which may cause service problems. In response to this situation, the general approach is to re-establish the connection between the client and the server and update the current cache of the client. Antirez indicates that it is the best situation to keep the connection all the time, but in order to reduce the risk, the Redis server will send an invalidation notification to other clients when it disconnects from the client.

This feature called "Client side caching" is not yet officialDetermine the name, it may eventually become "Tracking". The Redis author also stated that these features will be adjusted before the Redis 6 release candidate, and hope that the community can actively feedback.

Because the Client side caching function needs to use the RESP3 protocol to support implementation, antirez said that it will find a way to enable this function through the RESP2 protocol.

Read the original text: