Open
Conversation
test: userInfo 수정 로직 테스트 케이스 추가
-서비스 저장소 Map 구조 변경 및 Optional 도입 -테스트 코드 추가
refactor: findById 메서드 반환 타입 변경 (Optional -> Object) 및 예외 처리 로직 내부화 - 채널 참가자 조회(findParticipants) 로직 이관 (ChannelService -> UserService) - 유저 정보 수정(updateUserInfo) 로직 개선 (if문 -> Optional 체이닝) - 특정 유저의 참여 채널 목록 조회 기능 구현
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
프로젝트 마일스톤
기본
Entity와 API 스펙이 강하게 결합되어 DB 컬럼 하나만 수정해도 클라이언트 응답 규격이 깨지는 사이드 이펙트가 발생하며, 민감한 데이터가 의도치 않게 노출될 위험이 크. DTO 도입 시 변환을 위한 보일러플레이트 코드는 늘어나지만, 이를 통해 API 스펙의 독립성을 보장하고 도메인 모델과 유효성 검증 등 을 명확히 분리할 수 있어 장기적인 유지보수성과 보안성 측면에서 얻는 이점이 훨씬 크다.
심화
N+1 문제가 발생하는 쿼리를 찾고 해결해보세요.
프로덕션 환경에서는 OSIV를 비활성화하는 경우가 많습니다. 이때 서비스 레이어의 조회 메소드에서 발생할 수 있는 문제를 식별하고, 읽기 전용 트랜잭션을 활용해 문제를 해결해보세요.
오프셋 페이지네이션과 커서 페이지네이션 방식의 차이에 대해 정리해보세요.
오프셋 방식은 앞에서부터 얼마나 건너뛸지를 지정하므로 구현이 쉽고 번호판 형태의 UI에 적합하다. 하지만 데이터가 많아질수록 앞부분을 일일이 읽어야해서 성능이 급격히 느려진다. 또한 조회 도중 새 데이터가 추가되면 보던 데이터가 밀려 내려와 다음 페이지에서 중복 노출되는 문제가 발생한다. 반면 커서 방식은 마지막으로 본 데이터의 ID를 기준으로 다음을 찾는다. 인덱스를 타고 넘어가 대용량 데이터에서도 성능이 일정하게 유지된다. 하지만 커서 방식은 특정 페이지로 바로 건너뛰는 기능 구현이 어렵고, 정렬 조건이 복잡해질수록 쿼리 작성이 까다로워진다.
기존에 구현한 오프셋 페이지네이션을 커서 페이지네이션으로 리팩토링하세요.
Entity와 DTO를 매핑하는 보일러플레이트 코드를 MapStruct 라이브러리를 활용해 간소화