TIL

2021.11.21 기록장

Gisungcu 2021. 11. 19. 21:41

ToDo

Done

  • 배치 공부
  • cs 50 https://www.edwith.org/cs50/lecture/22801?isDesc=false

Weekly goal

  • 책 읽기
  • 영어 레퍼런스 읽기
  • 북마크 읽기, 정리

Spring batch

 

기존 batch를 사용하려면 job과 step들을 만들어 사용해야 한다.

하지만 어노테이션 기반의 프로그래밍을 통해 간단하게 구현할 수 있다.

 

@Seheduled 어노테이션을 통해 주기를 정하고 job을 돌릴 수 있다.

돌릴 서비스는 스레드로 돌리는 형태이다.

 

배치는 job으로 이뤄져 있다고 했는데, job은 step으로 이뤄져 있다.

step은 read와 processor, writer로 이뤄져 있다. 읽고 처리하고 쓴다는 것.

 

https://cheese10yun.github.io/spring-batch-basic/

 

Spring Batch 간단 정리 - Yun Blog | 기술 블로그

Spring Batch 간단 정리 - Yun Blog | 기술 블로그

cheese10yun.github.io

과거에는 Quartz라는 스케줄러를 썼다고 한다.

java로 이뤄져 있음

근데 spring 3.1부터는 자체적으로 스케줄러를 제공해줘서 사용률이 줄어들었다고 한다.

https://byul91oh.tistory.com/277

 

Quartz Job Scheduler란?

1.1 Quartz란? Quartz는 Terracotta 라는 회사에 의해 개발된 Job Scheduling 라이브러리입니다. 완전히 자바로 개발되어 어느 자바 프로그램에서도 쉽게 통합해서 개발할 수 있습니다. Quartz는 수십에서

byul91oh.tistory.com

 

배치와 스케줄러

 

배치는 일괄처리의 개념이고 스케줄러는 그 일괄처리를 정해진 기준으로 돌리는 역할이다.

@Scheduler를 사용해서 내부에서 간단하게 배치를 정의하면 된다.

 

https://deeplify.dev/back-end/spring/batch-tutorial

 

[스프링/Spring] Batch 소개와 간단한 예제

스프링 배치에 대한 기본적인 소개와 예제를 통해서 잡을 실행하는 방법에 대해서 알아보도록 하겠습니다.

deeplify.dev

나와 같은 의문

https://stackoverflow.com/questions/45402748/spring-scheduler-or-spring-batch-for-task

 

Spring Scheduler or Spring Batch for task?

Have a task to delete files based on some conditions. This task should run everyday at some time. Should we use Spring Boot and scheduler for this task. Or Spring Batch + Scheduler would be good. A...

stackoverflow.com

https://stackoverflow.com/questions/46729567/what-is-the-difference-between-spring-scheduled-tasks-and-spring-batch-jobs

 

What is the difference between spring scheduled tasks and spring batch jobs

I dont understand the difference between scheduled tasks and batch jobs in spring. By scheduled tasks I mean the ones which are configured like these: @EnableScheduling public class AppConfig{ .....

stackoverflow.com

트렌잭션 처리와 작업이 실패 시 해야 할 활동 예외처리 등을 배치 작업 시 추가적으로 등록할 수 있기에 배치와 스케줄링 테스크와의 차이점이다.

 

 

 

CS50

cpu의 64,32는 한 번 계산할 때의 단위,

ram은 비싸고 빠르다.