-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1단계 - DB 복제와 캐시] 카피(김상혁) 미션 제출합니다. #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반가워요, 카피 🙌🏻
구현 잘해주셔서, 간단하게 리뷰 남겼어요!
확인 부탁드립니다 :)
Map<Object, Object> dataSourceMap = new HashMap<>(); | ||
dataSourceMap.put(DataSourceType.WRITER, writeDataSource); | ||
dataSourceMap.put(DataSourceType.READER, readDataSource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
함수 분리를 해봐도 좋을 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initializeDataSource
메서드로 분리했습니다!
if (discountAmount < 1000 || discountAmount > 10000) { | ||
throw new IllegalArgumentException("할인 금액은 1,000원 이상, 10,000원 이하여야 합니다."); | ||
} | ||
if (discountAmount % 500 != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
매직 넘버 적용해주세요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
적용했습니다!
docker/init.sql
Outdated
minimumOrderAmount INT NOT NULL, | ||
discountAmount INT NOT NULL, | ||
discountRate INT NOT NULL, | ||
category VARCHAR(255), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(궁금) 255로 정하신 이유가 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사실 별 생각없이 적용한 값입니다!
카테고리의 특성상 길이가 길지 않기 떄문에 30으로 해도 적절할 것 같아 수정했습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
모든 요구사항 만족하셔서 approve할게요!
수고 많으셨어요 :)
안녕하세요 초코칩!
잘 부탁드립니다~
복제 지연 해결방법에 대해 고민하면서 생각했던 것들에 대해 적어봤어요.
리뷰하실 때 참고 부탁드립니다!
1. 비동기를 동기방식으로 바꾼다
2. 비동기를 반동기방식으로 바꾼다.
3. 코드 상에서 리플리카 서버에 데이터가 없는 경우 소스 서버에 다시 조회하도록 한다.