Achieving Sub-Millisecond Latencies With Redis by Using Better Serializers.

  • JSON serialization/deserialization is incredibly inefficient and costly
  • You end up using more space in storage (which is expensive in Redis since it’s an in-memory database)
  • You increase your overall service latency without any real benefit

Using JSON to store data in Redis will increase your latency and resource usage without bringing any real benefit.

One other “simple” optimization you can use is compression.

Using a random “JSON” object with different attributes
Using a random “JSON” object with different attributes
Using a small array of floats
Using a small array of floats
Using a big array of floats
Using a big array of floats

Further Reading

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store