Giter Site home page Giter Site logo

meeting-room's Introduction

meeting-room(회의실 예약 시스템)

동시성 문제해결 전략

문제: 동일한 회의실에 중첩된 일시로 예약 불가하며 다수의 사용자가 동시에 동일 날짜, 회의실에 예약할 때 일시가 중첩되어 예약될 수 없고 서버에서 먼저 처리되는 1건만 예약

분석

- 중복조건이 복잡하기 때문에 constraints로 중복조건을 만들기 어려움
- 다수의 쓰레드 혹은 클라이언트에서 동시 요청을 통해 중복여부를 체크하고, 데이터 저장을 진행한다면 중복 발생 가능
- DB의 ISOLATION을 SERIALIZABLE로 설정하면 문제해결은 가능하지만 동시 처리 성능이 급격히 하락

문제해결 전략

1. (어플리케이션) 일반적인 어플리케이션과 같이 중복 여부를 확인하고 일정을 저장하도록 함
2. (스케쥴 잡) 1초에 한번씩 동작하면서 중복된 일정이 있는지 확인
3. (스케쥴 잡) 중복된 일정이 있는 경우 CAL_ID(자동생성 ID)가 가장 작은 예약건만 찾고, 해당 일정과 겹치는 일정을 모두 삭제
  3.1 중복이 여러 그룹으로 발생할 수 있기 때문에, 3. 동작을 통해서는 하나의 그룹에 대한 중복 일정만 정리됨
  3.2 다시 한번 중복된 일정이 있는지 확인
  3.3 중복된 일정이 있는 경우 CAL_ID(자동생성 ID)가 가장 작은 예약건만 찾고, 해당 일정과 겹치는 일정을 모두 삭제 (3.1~3.3 반복)
4. (어플리케이션) 1. 에서 신규 일정 저장 이후 2초(스케쥴 잡이 중복 일정을 정리하는 시간을 기다림) sleep을 한 후, 등록한 일정 확인
  4.1 등록한 일정이 있는 경우 : 일정이 정상 저장된 케이스
  4.2 등록한 일정이 없는 경우 : 사용자의 일정이 다른 일정과 중첩되어 저장되면서 후 순위였기 때문에 삭제된 케이스

개선 가능성

- 일정에 상태 값을 추가하여, 신청/확정/취소 등으로 상태 관리를 하면 더 빠른 응답이 가능할 것으로 보임
- 비동기 처리를 통해 회의실 예약 저장 후 대기 화면을 보여주면서 예약 등록 상태를 0.5초 간격 등으로 Pooling 해서 확정/취소로 상태 변경 시 사용자에게 바로 안내하면 더 빠른 처리 가능

프로젝트 빌드 실행 방법

유레카 서버 빌드/기동

meeting-room-eureka\gradlew build
meeting-room-eureka\gradlew bootrun

meeting room api 서버 빌드/기동

meeting-room-api\gradlew build
meeting-room-api\gradlew bootrun

meeting room web 서버 빌드/기동

meeting-room-web\gradlew build
meeting-room-web\gradlew bootrun

접속 방법

http://localhost/calendar

meeting-room's People

Contributors

pay-snow-y avatar planetsy avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

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.