Prompt Spring Batch Deep Dive
# Spring Batch Deep Dive 레포지토리 제작 프롬프트
나는 "Spring Batch Deep Dive" 레포지토리를 만들려고 해.
대용량 데이터를 Chunk 단위로 처리하는 원리, Job/Step/Tasklet이 어떻게 실행되는지, 실패 시 Retry/Skip 전략을 완전히 파헤치는 레포를 만들 거야.
## 📋 프로젝트 목표
**컨셉**: "수백만 건 데이터를 안정적으로 처리하는 메커니즘"
**핵심 차별화**:
1. Chunk-Oriented Processing 원리 완전 분해
2. Job Repository와 메타데이터 관리
3. Retry/Skip/Restart 실패 복구 전략
4. Partitioning으로 대용량 병렬 처리
**타겟 독자**:
- 배치 작업을 해야 하는데 Spring Batch를 모르는 개발자
- Chunk 처리가 무엇인지 모르는 개발자
- 배치 실패 시 재시작 전략을 모르는 개발자
- 대용량 데이터를 병렬로 처리해야 하는 개발자
**선행 학습**:
- Spring Core Deep Dive (Bean, DI 이해)
- Spring Data & Transaction (Transaction 관리 필수)
---
## 🎯 1단계: 전체 구조 설계
다음 6개 챕터로 레포지토리를 설계해줘:
### Chapter 1: Batch Architecture (6개 문서)
- Job, Step, Tasklet 관계와 구조
- JobLauncher와 Job 실행 메커니즘
- Job Repository (메타데이터 저장)
- Job Instance vs Job Execution vs Step Execution
- Job Parameters와 실행 컨텍스트
- Batch Configuration (@EnableBatchProcessing)
### Chapter 2: Chunk-Oriented Processing (7개 문서)
- Chunk 처리 원리 (Read → Process → Write)
- ItemReader 종류와 구현 (JpaPagingItemReader, JdbcCursorItemReader)
- ItemProcessor 체인과 조건부 처리
- ItemWriter 구현 (JpaItemWriter, JdbcBatchItemWriter)
- Chunk Size 튜닝 (10 vs 100 vs 1000)
- Cursor vs Paging 선택 기준
- Custom ItemReader/Writer 작성
### Chapter 3: Job Execution & Flow Control (6개 문서)
- Sequential Flow (Step1 → Step2 → Step3)
- Conditional Flow (on().to().from())
- Decision (JobExecutionDecider)
- Parallel Steps (Split)
- Flow Externalization
- Job Listener (BeforeJob, AfterJob)
### Chapter 4: Error Handling & Recovery (7개 문서)
- Skip 전략 (SkipPolicy, SkipLimit)
- Retry 전략 (RetryPolicy, RetryTemplate)
- Skip vs Retry 선택 기준
- JobRestartException과 재시작
- ExecutionContext를 통한 상태 저장
- Fault Tolerance 설정
- Custom Skip/Retry Policy
### Chapter 5: Partitioning & Parallel Processing (5개 문서)
- Partitioning 개념 (Manager Step, Worker Steps)
- Partitioner 구현 (데이터 분할)
- Grid Size와 Thread Pool
- Remote Partitioning (Master-Slave)
- Partitioning 성능 튜닝
### Chapter 6: Advanced Topics (4개 문서)
- Async ItemProcessor (비동기 처리)
- Multi-threaded Step
- JobScope vs StepScope
- Spring Batch Integration (메시지 기반 처리)
---
각 챕터는 **4~7개 문서**로 구성해줘. 총 **35개 문서** 목표.
**문서 구조**:when to use it
Community prompt sourced from the open-source GitHub repo e9ua1/prompt-blueprints (no explicit license). A "Prompt Spring Batch Deep Dive" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
careercommunitygeneral
source
e9ua1/prompt-blueprints · no explicit license