-
Notifications
You must be signed in to change notification settings - Fork 1
CONFETI-75 feat: Song & ArtistSong 데이터 정합성을 위한 배치 작업 구현 #7
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
Merged
Conversation
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
- 병렬 처리를 이곳에서 위임 - facade를 병렬로 호출하는 책임만 가짐
- StepInfo 로 name을 사용하도록 로직 변경 - StepInfo 에서 Job을 알고 있으므로 레코드에선 삭제 - ARTIST_SYNC_JOB 네이밍을 ARTIST_SONG_SYNC_JOB 으로 변경
- DTO를 사용하는 경우 패키지 경로를 작성해야하므로 변경에 취약하다고 판단하여 변경. 패키지 경로가 잘못되어도 컴파일 오류로 못잡으므로..
- 현재 파라미터는 SongProjection 이지만 다른 파라미터 필요 시 오버로딩으로 작성할 예정
Member
|
605...? 다 같이 합창을 했나... |
ch1hyun
requested changes
Dec 26, 2025
src/main/java/confeti/confetibatchserver/job/artistsongsync/ArtistSyncJobConfig.java
Show resolved
Hide resolved
src/main/java/confeti/confetibatchserver/job/artistsongsync/ArtistSyncJobConfig.java
Show resolved
Hide resolved
src/main/java/confeti/confetibatchserver/domain/music/song/application/SongService.java
Outdated
Show resolved
Hide resolved
- reader, writer, query 라는 하위 패키지 생성 - job 내부 패키지 명칭 구체화
- 기존 JDBC Template을 사용하던 코드를 NamedParameterJdbcTemplate 를 사용하도록 변경. 타입을 더 명확히 지정할 수 있음 - SqlParameterSource 를 도입해서 필드 매핑을 자동화
ch1hyun
approved these changes
Dec 28, 2025
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.
🔊 Summaries
Song & ArtistSong 데이터 정합성을 위한 배치 작업 구현
기본적인 흐름은
a. rate limiter 로 Artist 별 TopSong 데이터를 전부 가져옴. (단순 ArtistSong 을 가져오는 API 는 limit 이 20으로 너무 적기 때문에 TopSong 조회로 모든 노래 목록을 조회함)
b. DB에서 해당 Artist의 모든 Song을 가져와서 a 에서 새로 가져온 Song 정보들과 비교.
c. 새롭게 추가된 노래들과 업데이트된 노래들을 upsert. 이때 artist_song 생성도 별도로 쿼리를 사용하여 처리. (이미 있는 경우 무시하도록 해뒀지만, uk_artist_song 과 같은 유니크 인덱스를 걸어두기)
MusicAPIHandler 추가. 기존에 그냥 feignClient를 사용해도 괜찮겠다는 생각이었는데 (대부분 단순 호출일 예정이어서..) 조회 시 로직이 필요한 부분들이 생겨서 추가했습니다.
MusicSyncFacade 추가. 이것도 Service만 있어도 충분할거라 생각했는데 병렬 처리를 할 때나 트랜잭션을 관리할 때 레이어가 하나 더 존재하면 편할 것 같아서 추가했습니다.
✨ Notification