본문 바로가기
Backend2026년 5월 27일3분 읽기

Apache Flink 2.0 — stateful streaming production 1년

YS
김영삼
조회 91
Apache Flink 2.0 — stateful streaming production 1년

핵심 요약

Flink 2.0 production 1년. async state·disaggregated state·Materialized Table 정착. 사내 12개 streaming job, p99 처리 지연 -68%, 비용 -42%. 가장 큰 변화는 state를 disk가 아닌 object storage로 분리한 것.

1. disaggregated state — 핵심 변화

기존: state가 task manager 디스크. scaling 시 reshuffle 비용 큼. 2.0: state를 S3 같은 object storage에. checkpoint 빠르고 scaling 즉시.

2. async state 접근

RocksDB read를 비동기 처리 — single core가 IO 대기 없이 다음 record. p99 지연 -68%, throughput +2.4배. 코드는 그대로, runtime 옵션만 toggle.

3. Materialized Table — 선언적 streaming

CREATE MATERIALIZED TABLE order_summary
  FRESHNESS = INTERVAL '10' MINUTE
AS SELECT user_id, SUM(amount) AS total
   FROM orders
   GROUP BY user_id;

background에서 자동 streaming job 생성·관리. dbt-streaming 같은 개념.

4. 비용 비교

항목1.x2.0
TM 인스턴스4828
디스크 EBS24TB4TB
S3 state018TB
월 비용$18,400$10,700

5. 함정

  • S3 latency — read 평균 8ms, RocksDB local(0.4ms)보다 느림. async 보정 필수
  • checkpoint 빈도 — disaggregated 후 5분 → 1분으로 줄여도 부담 작음
  • migration — 1.x state는 2.0에서 자동 변환 안 됨, 일부 job 재시작
  • Materialized Table SLA — freshness 보장 안 됨, 백프레셔 시 지연

댓글 0

아직 댓글이 없습니다.
Ctrl+Enter로 등록