3. 회사 소개
•지그재그 - No. 1 여성 쇼핑몰 모음앱
•2600만 다운로드
•DAU 700K+, MAU 3M+
•누적 거래액 2조+
•전직군 절찬 채용중!
4. 지그재그 데이터 소개 (5월)
•S3 Data lake 26TB+
•전체 등록 상품 수 50M+
•단일 테이블, JSON 19GB+
•Impression log 일 250M+
•peak시 5분에 1.7M 수집
•33 DAG, 200+ daily tasks in Airflow
5. 지그재그 데이터 소개 (11월)
•S3 Data lake 60TB+
•Impression log 일 500M+
•peak시 5분에 3M 수집
•49 DAG, 400+ daily/hourly/minutely tasks in Airflow
6. Airflow
•Workflow orchestration tool
•w/ dedicated job scheduler
•Started at Airbnb in 2014
•Becoming Apache Top Level Project in 2019
•Key features
•Scalable - Scale out through Celery worker
•Extensible - Custom operator
•DAG workflow
•Vertex - operator
•Edge - dependency
•Fancy UI, Dashboard
•Silver bullet for workflow management
7. Airflow in ZIGZAG
•정말 다양한 작업에 활용 중
•Data dump (Aurora, Redis, ES, third-party, …)
•ETL/ELT (Logs, …)
•Build data mart (KPI, key metrics, …)
•Trigger other services/APIs
•Glue partition update
•DB monitoring
15. Airflow usage example - Data dump
•공통적으로 쓰는 코드는 전부 추상화하거나 operator로 재구성
•EMR, Spark, Athena
•Dependency 연결도 추상화 - 자주 쓰는 형태는 함수로
•필요한 설정값들은 코드로 알 수 있도록 - Everything as a Code
•Airflow의 재밌는 사실
•도중에 어떤 task가 죽어도, 마지막 task가 성공하면 전체 DAG를 성공으로 간주
•EMR terminate 할 때 전체 ancestor 확인하도록 변경
21. Airflow usage example - Monitoring
•AWS Glue partition update
•Hourly partitioned table의 metadata update
•기본적으로 scheduling이 필요한 모든 곳에서 사용할 수 있습니다!
22. Airflow pros and cons
•Pros
•다 보셨죠…? 😀
•Cons
•꽤 허술한 dependency system
•정말 DAG로 모든 것을 표현하겠다는 의지가 느껴짐
•특히 inter-DAG나 external task에 대한 지원이 약함
•꽤나 거대한 시스템
•비슷한 Luigi의 경우, 딱 worker만 있고 나머지는 전부 external component를 사용하게 함
•Airflow가 사용하는 Postgres 말고 다른 control DB를 사용하고 싶다면?
•어려운 버전 업데이트
•여러 의존성때문에 업데이트가 쉽지 않다 (Postgres 버전, Redis 버전, Python library, …)
•minor update시 DB schema가 바뀌는 경우가 있어서 control DB를 날려줘야함
24. AWS Managed Workflows for Apache Airflow (MWAA) 🎉
•At a glance…
•내부적으로 Kubernetes를 사용하는 것 같음
•코드, DAGs, Plugins는 S3를 참조
•생각보다 세심함…
•Airflow configuration도 console에서 업데이트 가능
•Environment node와 Worker node가 분리되어 있음
•가격이 저렴하진 않다.
•지그재그의 경우 m5.xlarge 사용 - $0.192/h, 동시에 약 16개 정도의 worker 운용 가능
•MWAA와 비교하면? (사양이 나와있지 않아 정확하진 않지만)
•Small environment: $0.49/h
•Small worker: 개당 $0.055/h
•대충 10대 쓰면, $0.55/h
•도합 $1/h 정도…
•그래도 EKS 띄워서 직접 운용하는 거랑 비교하면 “약간” 비싼 수준?