1 unstable release
0.0.1 | Apr 25, 2023 |
---|
#37 in #pull
17KB
389 lines
Why HMGET
and not HGETALL
My thinking is that with the redis HGETALL
all command
the upstream to downstream data rate is is more shifted
towards the downstream part the with HMGET
. Let me explain.
When sending data to a redis instance the HGETALL
command
will ruffly send the same static amount of bytes for
every type. The byte length of the response redis sends back,
actually depends on the number of fields, field names and
the length of the actual field value. So if you where to
push
and pull
x objects to and from redis your upstream
bandwidth would only be partially used with repercussion for
your downstream bandwidth. In a one to one data link, like
many server clusters have, it would be more efficient to use
both up and downstream bandwidth to leverage the available.
Using HMGET
reduces the downstream bandwidth consumption by
the number of fields and field names in bytes and there fore
increases the upstream bandwidth consumption by the same amount.
The HMGET
command seamed to be a good balance between both
up and downstream bandwidth.
Dependencies
~7–16MB
~204K SLoC