Started by Bell GrantNov 5, 2021

Open
Redis strings vs Redis hashes to represent JSON: efficiency?

0 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 0 VIEWES SHARE

I want to keep a JSON payload into Redis. There may be without a doubt 2 ways I will do that:

1. One using simple string keys and values.

key: user, value: payload (The whole JSON blob which can be 100-200 kb)

   SET user:1 payload

2. Using hashes

HSET user:1 username "someone"
HSET user:1 location "NY"
HSET user:1 bio "STRING WITH OVER 100 lines"

Keep in mind that if I use a hash, the price length isn't always predictable. They are now not all short along with the bio instance above.

0 Replies

You must be Logged in to reply
Techiio

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

facebooklinkdeintwitter

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Copyright techiio.com @2020 Kolkata, India
made with by Abhishek & Priyanka Jalan
Copyright techiio.com @2020
made with by Abhishek & Priyanka Jalan