[DABOM-514] recap-job 성능 개선 - #29
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Code Review
이번 PR은 recap-job의 성능 개선을 위해 기존의 건별 집계 방식에서 chunk 단위 벌크 조회 및 처리 방식으로 리팩터링하는 중요한 변경을 담고 있습니다. 전반적으로 변경의 목적에 맞게 코드가 잘 수정되었으며, 특히 Writer에서 Processor를 호출하여 벌크 처리를 수행하는 구조 변경은 성능 향상을 위한 합리적인 트레이드오프로 보입니다. MonthlyFamilyRecapAggregationRepository의 리팩터링은 복잡하지만, Mutable 내부 클래스를 활용하여 상태를 관리하고 최종 결과를 조립하는 방식은 가독성과 유지보수성을 높이는 좋은 패턴입니다. 코드 중복을 줄여 유지보수성을 더욱 향상시킬 수 있는 부분에 대해 한 가지 의견을 남겼습니다. 좋은 변경 감사합니다.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as duplicate.
This comment was marked as duplicate.
SonarQube Quality Summary (Community)✅ Quality Gate PASSED Branch: Issues
Measures
🔗 Dashboard: https://sonarqube.swthewhite.store/dashboard?id=dabom-batch-core&branch=refactor/DABOM-514 Generated automatically by GitHub Actions. |
🍀 이슈 & 티켓 넘버
🎯 목적
weekly-family-recap-job과monthly-family-recap-job의 병목은familyId1건마다 집계 SQL을 반복 호출하는 구조였다.이번 변경은
batch-core기준으로 리캡 집계를 chunk 단위 벌크 조회로 전환해, 운영 데이터 스케일에서 배치 처리 시간을 줄이기 위한 목적이다.📝 변경 사항
weekly-family-recap-jobWeeklyFamilyRecapAggregationRepository에aggregate(List<Long>, weekStartDate)벌크 집계 추가processor단건 처리 대신 writer가 chunk 전체familyIds를 받아 벌크 집계 후 batch upsert 하도록 변경WeeklyFamilyRecapProcessor는 기존 단건process()를 유지하면서processAll()벌크 조립 메서드 추가monthly-family-recap-jobMonthlyFamilyRecapAggregationRepository를familyIds기준 벌크 집계 구조로 리팩터링MonthlyFamilyRecapProcessor에processAll()벌크 조립 메서드 추가batch.yml에서 weekly/monthly recap의chunk-size,db-fetch-size기본값 상향familyIds입력 구조에 맞게 수정📂 변경 범위
🖥️ 주요 코드 설명
기존에는
familyId1건마다processor -> repository.aggregate(familyId, ...)구조로 반복 집계했다.변경 후에는 writer가 chunk 전체
familyIds를 받아processAll()로 벌크 집계 결과를 조립하고, upsert만 한 번에 수행한다.💬 리뷰어에게
📋 체크리스트
기본
./gradlew build가 정상적으로 통과하는가?./gradlew spotlessApply checkstyleMain)배치 코드 품질
Controller → Service → BatchJobLauncher → Job → Step → Reader/Processor/Writer)JobResultListener를 등록했는가?테스트
📌 참고 사항