Giter Site home page Giter Site logo

redis_distributed_lock's Introduction

redis_distributed_lock

코프링 + Redis를 이용한 분산락을 구현

개발환경

  • Java 17
  • Kotlin 1.8.22
  • Spring Boot 3.1.3
  • Gradle 8.0
  • docker 20.10.17
  • docker-compose 2.6.1
  • (Optinal) Jprofiler 14

테스트 방식

  1. 락을 사용하지 않은 상태에서 동시성 이슈 확인
  2. 스핀락을 사용해서 동시성 이슈 해결 확인
  3. Redisson을 이용한 PUB/SUB방식으로 동시성 이슈 해결 확인

테스트 결과

  • 스핀락 사용시 Profile
    스핀락 Profile

  • Redisson 사용시 Profile
    Redisson Profile

결론

분산 애플리케이션에서 Redis를 이용한 락을 획득하는 방법을 구현해봤다.
스핀락의 경우 간단하게 구현이 가능하지만, CPU 사용량이 많아지므로 Redisson을 이용한 PUB/SUB 방식을 추천한다.

TODO

AOP를 이용해 락 획득 및 Unlock을 구현한다. 구현완료
JProfiler를 대체할 프로파일링툴 찾기(visualvm)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.