====== Redis Distributed Lock ====== * [[https://redis.io/topics/distlock|Distributed locks with Redis – Redis]] ===== Lettuce 기반 ===== * [[nosql:redis:lettuce|Lettuce - Redis Java Client]] 는 공식적으로 분산 Lock 기능을 제공하지 않음.직접 구현 필요. * [[https://docs.spring.io/spring-integration/reference/html/redis.html|Spring Integration Redis Support]] 에서 lettuce 기반 분산 락 구현을 볼 수 있음. * [[https://tanzu.vmware.com/developer/guides/spring-integration-lock/|Working With the Spring Distributed Lock | VMware Tanzu Developer Center]] * Spin lock 과 pub/sub 기반이 있는데 spin lock 은 락을 획득할 때까지 계속해서 락을 획들할 수 있냐고 물어보는 방식이고, pub/sub 은 락 획득 실패시 메시징 기반으로 기다렸다가 획득가능해졌다는 메시지를 받으면 획득하는 방식. * pub/sub 방식이 더 좋다. ===== Redisson ===== * [[nosql:redis:redisson|Redisson]]은 기본적으로 pub/sub 기반 분산 Lock을 제공해준다. ===== 참조 ===== * [[https://dzone.com/articles/distributed-lock-implementation-with-redis|Distributed Lock Implementation With Redis - DZone Java]] * [[https://dzone.com/articles/spring-boot-configure-jetty-server-using-gradle-sp|How to Configure the Jetty Server in Spring Boot Using Gradle [Video] - DZone Java]] * [[https://redislabs.com/ebook/part-2-core-concepts/chapter-6-application-components-in-redis/6-2-distributed-locking/|6.2 Distributed locking | Redis Labs]] * [[https://comsystoreply.de/blog-post/distributed-locks-with-redis-reinvent-the-wheel-but-with-monitoring-review|Distributed locks with Redis - reinvent the wheel but with monitoring Review]] * [[http://antirez.com/news/101|Is Redlock safe? - ]] * [[https://mono.software/2017/05/19/Redis-Distributed-Locking-for-Pragmatists/|Redis distributed locking for pragmatists | Mono Software]] * [[https://hyperconnect.github.io/2019/11/15/redis-distributed-lock-1.html|레디스와 분산 락(1/2) - 레디스를 활용한 분산 락과 안전하고 빠른 락의 구현 | Hyperconnect Tech Blog]] * [[https://charsyam.wordpress.com/2022/12/31/%ec%9e%85-%ea%b0%9c%eb%b0%9c-%eb%b6%84%ec%82%b0-%eb%9d%bd%ec%97%90-%eb%8c%80%ed%95%b4%ec%84%9c/|[입 개발] 분산 락에 대해서… | Charsyam's Blog]]