Here's an example of a complete session using the Redis protocol in the old RESP2 mode involving the following steps: enabling tracking redirecting to another connection, asking for a key, and getting an invalidation message once the key gets modified. The two connections model is the only one that is also supported for RESP2 (which lacks the ability to multiplex different kind of information in the same connection). Many data connections can redirect invalidation messages to the same connection, this is useful for clients implementing connection pooling. For this reason when a client enables tracking, it can specify to redirect the invalidation messages to another connection by specifying the "client ID" of a different connection. However many client implementations may prefer to implement client-side caching using two separated connections: one for data, and one for invalidation messages. Using the new version of the Redis protocol, RESP3, supported by Redis 6, it is possible to run the data queries and receive the invalidation messages in the same connection. This way we can ignore database numbers reducing both the memory usage and the implementation complexity. So if a client is caching the key foo in database 2, and some other client changes the value of the key foo in database 3, an invalidation message will still be sent. ![]()
0 Comments
Leave a Reply. |