how to store an image to redis using java / spring

Gene Diaz picture Gene Diaz · Jul 29, 2013 · Viewed 11.4k times · Source

I'm using redis and spring framework on my image upload server. I need to store the images to redis. I have found the following question but it was for python.
how to store an image into redis using python / PIL

I'm not sure if it's the best way but I would like to know how to do it in java (preferably using spring framework). I'm using spring-data-redis which uses jedis.

I would like to know if it is a good strategy to store images in redis.

Answer

Jahaja picture Jahaja · Jul 30, 2013

Redis is binary safe so, in the case of Jedis, you can use BinaryJedis to store binary data just as any other kind of value that you store in Redis.

And no, I don't think storing images in Redis, and thus in-memory, is a good strategy. That would have to be a very special use-case.