Skip to content
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

[#140] Refactor: Batch Delete 성능 개선 리팩토링 #141

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

tkguswls1106
Copy link
Member

PULL REQUEST

🎋 Branch Name

refactor/#140

🔑 Main Contents

'기존의 JPA deleteAll() 메소드 -> JDBC Batch Delete 메소드'로 리팩토링을 통한 성능 개선 완료.
또한 추가적으로, JPA deleteAllInBatch() 메소드의 테스트까지 하여 성능 차이를 확인함.
(대용량 데이터 10000개 이상이 될 경우, JPA deleteAllInBatch() 메소드는 stackoverflow 에러가 발생함. -> JDBC batch delete 사용.)

🏞 Screenshots (Optional)

batch delete 속도 테스트

  • 좌 : 이전 JPA deleteAll() 메소드 회원탈퇴 테스트
  • 중 : JPA deleteAllInBatch() 메소드 회원탈퇴 테스트
  • 우 : JDBC Batch Insert 메소드 회원탈퇴 테스트

📋 Checks for reviewers (Optional)

위의 스크린샷에서 확인할 수 있듯이, 회원탈퇴시 회원이 보유한 UserRoom 일괄 삭제에서 성능의 향상을 보였습니다.
이는 10000명 기준으로 약 1.5배의 성능 개선을 이루어냈습니다.

@tkguswls1106 tkguswls1106 added the ♻️ Refactor 코드 리팩토링 label Jun 7, 2024
@tkguswls1106 tkguswls1106 requested a review from JunSang1121 June 7, 2024 21:16
@tkguswls1106 tkguswls1106 self-assigned this Jun 7, 2024
@tkguswls1106 tkguswls1106 linked an issue Jun 7, 2024 that may be closed by this pull request
Copy link
Collaborator

@JunSang1121 JunSang1121 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다. 리펙토링 성능개선 고생많으셨어요

@tkguswls1106 tkguswls1106 merged commit b933c5b into develop Jun 7, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻️ Refactor 코드 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Refactor] Batch Delete 성능 개선 리팩토링
2 participants