Notice
Recent Posts
Recent Comments
Link
반응형
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags more
Archives
Today
Total
관리 메뉴

David의 블로그

[Spring Boot] 대량의 데이터를 한번에 처리하는 Spring Batch. 첫번째 본문

프로그래밍/Spring Boot

[Spring Boot] 대량의 데이터를 한번에 처리하는 Spring Batch. 첫번째

David 리 2025. 4. 15. 13:25
반응형

"Spring Batch"는 대량의 데이터를 효율적으로 처리하기 위한 프레임워크로, 주로 반복적이고 주기적인 작업을 수행하는데

사용됩니다. 이 프레임워크는 스프링 프레임워크를 기반으로 하며, 다양한 기능을 통해 작업을 안정적으로 관리할 수 있다.

 

 

주요 개념>

작업(Job) : 배치 처리의 기본 단위.

단계(Step) :  작업 내에서 수행되는 개별적인 처리 단위로, 데이터 읽기, 처리, 쓰기 등의 작업을 포함한다.

작업 인스턴스(Job Instance) : 특정 작업의 실행을 나타내며, 동일한 작업이 여러 번 실행될 수 있다

작업 실행(Job Execution) : 작업 인스턴스의 실행 상태를 나타내며, 성공, 실패 등의 상태를 가진다.

 

 

필자는  스프링부트 그래이들 프로젝트로 만들었고, 버전은 아래와 같다.

jdk-11

SpringBoot version 2.6.4

Spring Batch 2.6.4

 

 

```build.gradle```

라이브러리 의존성은 다음과 같다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web:2.6.4'
    implementation 'org.springframework.boot:spring-boot-starter-batch'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-mail'
    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    implementation 'org.mariadb.jdbc:mariadb-java-client:3.0.5'
    implementation 'org.jsoup:jsoup:1.14.3' // Jsoup 크롤링 라이브러리
    implementation 'org.json:json:20240303'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.springframework.batch:spring-batch-test'
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
    implementation 'com.squareup.okhttp3:okhttp' // 최신 버전으로 변경할 수 있습니다
}
cs

 

세팅은 이러하고

다음 시간엔 소스를 만들어서 배치를 만들어 보도록 하겠습니다.

 

유익했다면 댓글과 공감 한번씩 부탁드립니다~!

반응형