-
Notifications
You must be signed in to change notification settings - Fork 0
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
[#65] Snowflake ID 적용 #66
base: master
Are you sure you want to change the base?
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.
서비스 클래스들은 테스트코드 수정없이 잘 되나요? 새 dependency가 추가되었는데 코드는 바뀐게 없어서 질문드립니다.
새로 추가된 코드들도 테스트코드를 추가해주세요. (제가 느끼기엔 SnowflakeIdGenerator
자체가 필요없어보이기는합니다만..)
src/main/java/com/outstagram/outstagram/config/SnowflakeConfig.java
Outdated
Show resolved
Hide resolved
src/main/java/com/outstagram/outstagram/kafka/consumer/NotificationConsumer.java
Outdated
Show resolved
Hide resolved
src/main/java/com/outstagram/outstagram/service/AbstractBaseImageService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/outstagram/outstagram/util/SnowflakeIdGenerator.java
Outdated
Show resolved
Hide resolved
src/test/java/com/outstagram/outstagram/service/PostServiceTest.java
Outdated
Show resolved
Hide resolved
- nextId() 수정을 통해서 SnowflakeIdGenerator 클래스가 필요없어짐
테스트 코드는 snowflake id 전략을 도입한 user, post, notification에서 각 객체 생성할 때 테스트 코드를 수정했고, 모두 통과하는 걸 확인했습니다! 그리고 nextId()로 snowflake id 생성할 때, machine id를 매개변수로 줘서 id를 생성하는 방식으로 코드 수정했습니다! |
DB 샤딩을 위한 Snowflake ID 적용
USER의 id를 제외한 나머지 id 값은 userId를 가지고 snowflake id 생성
db 개수 2개로 설정하고 모듈러 샤딩 적용