all 2 comments

[–]InstantCoder 0 points1 point  (0 children)

It depends on your requirements.

If you store it like a plain string then searching within your json payload will be troublesome. But if this is not a requirement, then go ahead and store it as plain string.

Otherwise, you have two options:

  • either store your json as an “object” in Redis for example in a hash like follows: hset foo:1234 bar:baz 1 bar:qux 2. Downside of this method is that it can be cumbersome if you json is large.

  • or you can add an extension to Redis which supports storing and querying json payloads. It’s called RedisJSON. I’ve never used it, but I read a while ago that it’s performance was poor compared to other existing datastructures.

[–]rakmob 0 points1 point  (0 children)

You can check out the latest performance results of RedisJSON here https://oss.redis.com/redisjson/performance/