I have around 2 billion key-value pairs and I want to load them into Redis efficiently. I am currently using Python and used Pipe as documented by the redis-py. How can I speed the following approach up?
import redis
def load(pdt_dict):
"""
Load data into redis.
Parameters
----------
pdt_dict : Dict[str, str]
To be stored in Redis
"""
redIs = redis.Redis()
pipe = redIs.pipeline()
for key in pdt_dict.keys():
pipe.hmset(self.seller + ":" + str(key), pdt_dict[key])
pipe.execute()