Code Monkey home page Code Monkey logo

starcoffee's Introduction

StarCoffee

스타벅스 App 을 클론한 프로젝트 입니다.

MSA 아키텍처 컨셉을 차용하여 하나의 애플리케이션에 각각의 Service 는 독립적으로 구현되어 있으며 비즈니스 로직은 WebClient 를 통해서 소통하고 있습니다.

기술스택

  • Java11
  • Spring boot 2.7 (Gradle)
  • MyBatis
  • MySQL
  • Redis
  • Kafka

프로젝트 구조

  • 준비중

프로젝트 목표

  • MSA 아키텍처 컨셉을 고려한 구현
  • 분산 트랜잭션을 위한 분산락 구현
  • 대용량 트래픽 처리를 고려한 서비스 구현
  • 성능을 고려한 단위/통합 테스트 학습
  • CI/CD를 통한 배포 경험과 모니터링 구축

기술적 이슈 및 고도화

  • UUID
  • AOP를 이용한 로직 분리
  • Redission을 활용한 분산 락
  • 푸시 알림 메세지 기능
  • DB 실행계획 분석을 통한 SQL 성능 튜닝
  • 고가용성을 위한 DB replication
  • ngrinder 성능 테스트
  • 로드밸런싱
  • CI/CD 환경구성 : Jenkins

DB Diagram

  • 준비중

starcoffee's People

Contributors

truelightwater avatar f-lab-bot avatar flab-true avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

flab-true

starcoffee's Issues

`logCardRepository.updateAmount(cardId, balance);` 로직에서 `Cucurrency` 문제가 발생할 가능성이 높습니다.

          `logCardRepository.updateAmount(cardId, balance);` 로직에서 `Cucurrency` 문제가 발생할 가능성이 높습니다.

낙관론적락 vs 비낙관론적락을 적용하여 DB에서 Lock 적용 혹은 Version을 검토해 주세요.

JPA Framework에서 락을 지원하는 방법으로 컨셉을 이해하셔도 좋겠습니다.

Originally posted by @flab-true in #19 (comment)

Service Layer에서 유효한 `Member`만 리턴하시고, 값이 없는 경우는 `예외`를 적용해 주세요.

          Service Layer에서 유효한 `Member`만 리턴하시고, 값이 없는 경우는 `예외`를 적용해 주세요. 

Controller 로직이 비대해지는 것 같습니다.

Member memberInfo = memberService.login(id, password);

유효한 Member를 Controller argument로 받는 방법이 있습니다. spring argument resolver 란 무엇이고, 동작 방식을 남겨주세요. 향후 argument resolver로 개선되면 좋겠습니다.

Originally posted by @flab-true in #1 (comment)

1. HTTP Request `/mycard`를 호출한 결과값과, doPay 메서드에서 `confirmMyCard` 호출한 결과 값이 다릅니다. 왜 그럴까요? 설명해주세요.

          1. HTTP Request `/mycard`를 호출한 결과값과, doPay 메서드에서 `confirmMyCard` 호출한 결과 값이 다릅니다. 

왜 그런지 설명을 바랍니다.
2. 비지니스 로직을 재사용하려면 Controller LayerconfirmMyCard 호출 보다는 @Service의 로직을 재사용하는 방법으로 개선해 주세요.
3. ArgumentResolve 이용하여 파라미터를 조금 더 유연하게 가져가는 방향은 어떠세요?

public PayResponse doPay(@RequestBody PayRequest payRequest, Card cardInfo ) {
     return payService.runPay(payRequest, cardInfo);
}

Originally posted by @flab-true in #19 (comment)

MessageDigest를 사용하여 암호화 하고 있는데요. `공객 키` 방식에서 `MessageDigest`는 어떤 목적으로 사용되고 있을까요?

          MessageDigest를 사용하여 암호화 하고 있는데요. `공객 키` 방식에서 `MessageDigest`는 어떤 목적으로 사용되고 있을까요?

작성 로직은 동일한 텍스트에 대하여 항상 값은 해시 값을 만들고 있을까요? 그렇다면 무차별 대입 공격에 안전할까요? 어떤 대안이 있을까요? 조사해 주세요.
암호학에 대한 부분인데요. 공객키 방식 해싱에 대한 공부는 프로젝트 이후라도 반드시 숙지 하시길 바랍니다.

Originally posted by @flab-true in #1 (comment)

`SHA256Util.encryptSHA256(beforePw);` 로직들은 도메인 로직이라고 생각됩니다.

          `SHA256Util.encryptSHA256(beforePw);` 로직들은 도메인 로직이라고 생각됩니다. 

응용 서비스에 도메인 로직들이 포함되어 코드 품질이 좋지 않다고 생각합니다.

1. 리포지터리에서 member 정보 조회, member = findById(....)
2. member에 암호를 변경하기 전에 기존 암호가 올바른지 확인하는 것은 도메인 로직으로 이관
3. 예를 들어 비밀번호 체크 member..matches(beforePw), 비밀 번호를 설정 member.setPassword(afterPw) 등
4. 이후 리포지터리 save
5. findByIdAndPassword -> 도메인 클래스 로직 수행 -> updatePassword 이런 방식을 사용하셔도 됩니다. 

Originally posted by @flab-true in #1 (comment)

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.