GithubHelp home page GithubHelp logo

mysql_user_level_lock_demo's Introduction

MySQL을 이용한 분산락으로 여러 서버에 걸친 동시성 관리 예제코드

이 리포는 우아한형제들 기술블로그의 MySQL을 이용한 분산락으로 여러 서버에 걸친 동시성 관리 아티클의 예제 코드입니다.

MySQL 설치

Docker 설치 후

docker run --name mysql57 \
    -p 3306:3306 \
    -e MYSQL_ROOT_PASSWORD=root \
    -e MYSQL_ROOT_HOST='%' \
    --restart=unless-stopped \
    -d \
    mysql/mysql-server:5.7

MySQL 콘솔접속

docker exec -it mysql57 bash

데이터베이스 생성

create database user_lock

예제코드 결과 확인

  • DemoApplication.java 를 실행하여 api 서버를 실행합니다. api 서버가 실행될때 flyway 설정에 의해 데이터베이스의 내용이 초기화 됩니다.
  • woowa.demo.test 패키지에 있는 클래스들을 실행하여 실행 결과를 확인합니다.
  • 테이블의 내용을 초기화 하려면 직접 쿼리를 수행하거나 api 서버를 재시작 해주면 됩니다.

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.