https://stackoverflow.com/questions/61529777/redis-pipeline-vs-mget
Redis pipeline vs mget
I'm looking into using either MGET or pipeline, but I can't seem to find the information on MGET that I'm looking for My use case is to replace 50 GET calls with either MGET or pipeline What I fo...
stackoverflow.com
https://stackoverflow.com/questions/42706480/redis-mget-limitations/42709273
Redis MGET Limitations
We're planning to use MGET for one of our Systems. During benchmarking, we were able to retrieve values for 1 Million Keys in one MGET call in lettuce and were quite surprised. What I've been tryi...
stackoverflow.com
Redis는 single thread 동작을 하기 때문에, 어떠한 single command라고 해도 명령어 실행이 끝나기 전까지는 다른 redis client에 대한 block이 발생한다.
이런 현상은 list 단위의 key 조회 명령어인 mget에도 동일하게 적용된다.
반면에 pipeline 방식은 일괄 처리를 위한 명령어일 뿐, mget과 같은 단일 동작을 위한 기능을 가진 명령어가 아니기 때문에 block이 일어나지 않는다.
어느 정도의 일괄 조회는 상관 없으나 만약 대량의 key 조회가 필요하다면,
pipeline을 사용한 일괄 조회가 더 낫다.
* 그런데 공식 문서에서 언급된 부분은 아직 찾지 못했다. 하지만 꽤 많은 글에서 위와 같은 한계점이 있다고 언급하고 있다.
'공부 - 개념, 철학 > Redis' 카테고리의 다른 글
[Redis] Python으로 Redis 사용하기 (0) | 2020.04.04 |
---|---|
[Redis] Redis 란 (0) | 2020.02.24 |