Redis bulk Insert

1,593 views
Skip to first unread message

manish singh

unread,
Sep 14, 2018, 11:20:23 AM9/14/18
to Redis DB
Hello Team ,
Our requirement is to push 0.6 million key/value pair data to Redis and use it is as cache storage.
Can you guys help me to have code sample to insert data in redis in batches usinf Node Js and AWS Lambda 

Also let me know what would be latency and IOPS for Redis.becuase we have to insert in redis in within 5 minutes

Regards
Manish

CharSyam

unread,
Sep 14, 2018, 11:40:56 AM9/14/18
to redi...@googlegroups.com
Try pipeline :)

2018년 9월 15일 (토) 오전 12:20, manish singh <singh.m...@gmail.com>님이 작성:
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Salvatore Sanfilippo

unread,
Sep 14, 2018, 12:59:29 PM9/14/18
to redi...@googlegroups.com
Try this

https://redis.io/topics/mass-insert

You can insert half million keys in ~1 second probably.
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at https://groups.google.com/group/redis-db.
> For more options, visit https://groups.google.com/d/optout.



--
Salvatore 'antirez' Sanfilippo
open source developer - Redis Labs https://redislabs.com

"If a system is to have conceptual integrity, someone must control the
concepts."
— Fred Brooks, "The Mythical Man-Month", 1975.

manish singh

unread,
Sep 14, 2018, 3:18:22 PM9/14/18
to Redis DB
I am new to it.
Can you please tell in details
how to use pipleine with node js syntax

manish singh

unread,
Sep 16, 2018, 10:13:04 AM9/16/18
to Redis DB
Can spmone provide me sample code for bulk redis insert in node please

Narendra Kumar

unread,
Sep 17, 2018, 2:26:09 AM9/17/18
to redi...@googlegroups.com
Hi,

File: assume that your file(CSV/TXT) contains data in below format where name acts as key and age act as value

name, age
tom,35
jerry,5
jacj,25

remove header from file and use shell commands to insert bulk data using pipe as below.


cat filename | awk -F',' '{print " SET \""$1"\" \""$2 "\"\n"}'| redis-cli --pipe


Regards
Narendra Kumar

To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.

To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.


Abdul Muttaleb Maruf

unread,
Oct 29, 2020, 10:10:23 PM10/29/20
to Redis DB
Hi,

Im trying to run a mass insertion in Redis instance (5.0.8) with tls enabled

I am running this command

cat import.txt | redis-cli -h <my_host> -p <port> --tls --cert my.crt --key my.key --cacert proxy.pem -a <password> --pipe

However, I keep getting "No replies for 30 seconds: exiting." error from redis.


I tried the same import.txt to another instance without TLS enabled and it worked. 
Do I need to follow any special step for TLS?


BR

Maruf


Reply all
Reply to author
Forward
0 new messages