Projects/block-server

[block-server] 휴지통 자동 삭제 기능 구현 (1) : Spring Scheduling vs Spring Batch

annovation 2026. 3. 23. 23:41

Spring Scheduling

💡소제목


Spring Batch

💡소제목


두꺼운 밑줄 스타일

구분 Scheduler (@Scheduled) Spring Batch
목적 작업 실행 시점 관리 대용량 데이터 처리
역할 “언제 실행할까” “어떻게 처리할까”
데이터 처리 단순 로직 대량 데이터 처리 최적화
구조 메서드 단위 실행 Job → Step 구조
트랜잭션 직접 처리 자동 관리
실패 처리 없음 (직접 구현) 재시작, retry 지원
사용 난이도 쉬움 비교적 복잡

참고 자료

1) Spring Framework Docs : Spring Scheduling

https://docs.spring.io/spring-framework/reference/integration/scheduling.html?utm_source=chatgpt.com

 

Task Execution and Scheduling :: Spring Framework

All Spring cron expressions have to conform to the same format, whether you are using them in @Scheduled annotations, task:scheduled-tasks elements, or someplace else. A well-formed cron expression, such as * * * * * *, consists of six space-separated time

docs.spring.io