Contenu connexe Similaire à 대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS 2022 (20) Plus de Amazon Web Services Korea (20) 대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS 20221. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
© 2022, Amazon Web Services, Inc. or its affiliates.
김민석
Solutions Architect
AWS
GAME ON AWS 2022 – TRACK 04
Data Lake on AWS
대용량 데이터레이크 마이그레이션
조은희
DataLake TFT Leader
KakaoGames
2. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
© 2022, Amazon Web Services, Inc. or its affiliates.
데이터 레이크
2
3. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터레이크
통찰력
(INSIGHT)
정보
(INFORMATION)
자료
(DATA)
4. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터레이크
4
어떠한 규모의
데이터
어떠한 형태의
데이터
중앙 저장소
5. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
확장가능한 데이터레이크 필요
5
OLTP ERP CRM LOB
DW silo
Business
intelligence
Devices Web sensors Social
Business
intelligence
Hadoop silo
데이터 사일로 데이터 분석의 현대화
… Relational
databases
Big data
processing
Machine
learning
Non-relational
databases
Data
warehousing
Data lake
6. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
현대적 데이터 분석 아키텍처
6
확장 가능한
데이터레이크
목적에 맞는
데이터 서비스
유연한
데이터 이동
단일화된
거버넌스
성능 과
비용 효율성
Log
analytics
Relational
databases
Big data
processing
Machine
learning
Non-relational
databases
Data
warehousing
Data lake
7. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
Amazon S3
탁월한 내구성,
가용성 및 확장성
객체 수준의
세밀한 제어
지능적 티어 를 통한
손쉬운 비용 최적화
보안, 컴플라이언스,
그리고 감사 기능
데이터를 저장하는 가장
일반적인 이고 간단한 방법
광범위한
분석 포트폴리오
콜드 스토리지 및 아카이빙
데이터레이크의 핵심 : Amazon Simple Storage Service (S3)
7
8. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
© 2022, Amazon Web Services, Inc. or its affiliates.
효율적인 데이터레이크를 위한
Amazon S3 설계 Tip
8
9. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
확장성을 위한 저장 구조 설계
9
Unit1/project/analytics
Unit1/environment/test
Unit1/environment/prod
Bucket1/internal/usage/
Bucket1/internal2/billing
Bucket1/internal3/free/usage
Account
Bucket1
Bucket2
Bucket2/model1/inference
Bucket2/model2/inference
Bucket2/predictions/prod
Prefixes
Buckets
Department = Finance
Team = Business Reporting
Classification = Confidential
Object Tags
Department = Marketing
Team = Data Science
Classification = Confidential
10. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
확장성을 위한 Prefix 설계
10
3,500
PUT/COPY/POST/DELETE
5,500
GET/HEAD
Prefix 단위로 적용
11. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
11
/raw/<game>/dd-mm-yy
/raw/<game>/hh-mm-dd-yy
확장성을 위한 Prefix 설계
VS
/raw/<game>/ac/hh-mm-dd-yy
/raw/<game>/1f/hh-mm-dd-yy
…
VS
랜덤 문자열
12. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터 관리를 위한 티어링 - 원본 저장소
• 다양한 출저의 원본 데이터를 저장하는 단일 저장소
• 정제/변환되지 않는 원본 데이터
• 생명 주기 정책 혹은 ‘지능적 티어’ 를 통해
저렴한 스토리지로 클래스로 전환
데 이 터 수 집 ( 티 어 - 1 )
Amazon S3
(Raw Data)
12
13. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데 이 터 분 석 ( 티 어 - 2 )
Amazon S3
(Processed)
데이터 관리를 위한 티어링 - 분석용 저장소
13
• 열 기반 (columnar) 포맷 – Parquet/ORC
• 미리 설계된 파티션에 저장
• 분석에 최적화된 저장소
• 시간이 지남에 따라 더 큰 파티션으로 병합
14. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터 관리를 위한 티어링 - 소비용 저장소
데 이 터 소 비 ( 티 어 - 3 )
Amazon S3
(Filtered)
14
• 도메인 수준의 데이터 마트
• 분석/사용 사례별로 저장
• 데이터 소비에 최적화
15. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
© 2022, Amazon Web Services, Inc. or its affiliates.
현대적 분석 아키텍처를 위한
에코 시스템
15
16. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터 파이프라인
16
데이터
소스
데이터
수집
카탈로그
데이터레이크
(티어링)
소비
데이터분석
17. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터 파이프라인
17
데이터
소스
데이터
수집
카탈로그
데이터레이크
(티어링)
데이터분석 소비
Client
IDC
Web log
18. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터 파이프라인
18
데이터
소스
데이터
수집
카탈로그
데이터레이크
(티어링)
데이터분석 소비
Client
IDC
Web log
Amazon Kinesis
Amazon API Gateway
AWS Lambda
AWS DataSync
주) 대략적인 AWS 서비스 목록으로 데이터 파이프라인 구성을 위한 모든 서비스들이 나열되어 있진 않습니다.
19. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터 수집을 위한 AWS 서비스
19
AWS Lambda
• 이벤트 기반의
데이터 전처리
• 서버리스
AWS DataSync
• 온라인 데이터 복제
• 다양한 소스 지원
Amazon API GW
• API 형태의
데이터 수집
• 서버리스
Amazon Kinesis
• 데이터 스트리밍
• 데이터 버퍼링
• 서버리스
20. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터 파이프라인
20
데이터
소스
데이터
수집
카탈로그
데이터분석 소비
Client
IDC
Web log
Amazon Kinesis
Amazon API Gateway
데이터레이크
(티어링)
Amazon S3
AWS Lambda
AWS DataSync
주) 대략적인 AWS 서비스 목록으로 데이터 파이프라인 구성을 위한 모든 서비스들이 나열되어 있진 않습니다.
21. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터 파이프라인
21
데이터
소스
데이터
수집
카탈로그
데이터레이크
(티어링)
데이터분석
소비
Client
IDC
Web log
Amazon Kinesis
Amazon API Gateway AWS Glue
Amazon S3
Amazon Athena
Amazon EMR
Amazon Redshift
Amazon OpenSearch
AWS Lambda
AWS DataSync
주) 대략적인 AWS 서비스 목록으로 데이터 파이프라인 구성을 위한 모든 서비스들이 나열되어 있진 않습니다.
22. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터 ETL 과 카탈로그를 위한 AWS 서비스
22
Amazon EMR
• 배치 ETL
• 스트림 ETL
AWS Glue
• 관리형 ETL
• AWS Glue Studio
• 서버리스
AWS Glue
Catalog
• 카탈로그 서비스
• 크롤링
• 서버리스
AWS Lambda
• S3 PUT
데이터 변환
• 서버리스
23. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터 분석을 위한 AWS 서비스
23
• 하둡 기반 애플리케이션
• Amazon S3 Select 지원
• 데이터웨어하우스
• S3 데이터 쿼리 가능
Amazon EMR Amazon
Redshift
• 대화식 쿼리
• Presto 기반,
표준 SQL 실행
• 서버리스
Amazon
Athena
• 검색 및 시각화
• Lambda 를 통해
S3 데이터 적재
Amazon
OpenSearch
24. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터 파이프라인
24
데이터
소스
데이터
수집
카탈로그
데이터레이크
(티어링)
데이터분석 소비
Client
IDC
Web log
Amazon Kinesis
Amazon API Gateway AWS Glue
Amazon S3
Amazon Athena
Amazon EMR
Amazon Redshift
Amazon OpenSearch
Jupyter Notebook
Amazon API Gateway
Amazon QuickSight
BIT Tools
주) 대략적인 AWS 서비스 목록으로 데이터 파이프라인 구성을 위한 모든 서비스들이 나열되어 있진 않습니다.
AWS Lambda
AWS DataSync
25. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
마치며
25
현대적 분석 아키텍처
비즈니스 요구 사항 고려
데이터파이프라인 설계가 중요
목적에 맞는 에코시스템 활용
보안 과 컴플라이언스도 중요
Log
analytics
Relational
databases
Big data
processing
Machine
learning
Non-relational
databases
Data
warehousing
Data lake
26. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
카카오게임즈 데이터레이크
조은희
카카오게임즈
100일의 기록
27. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
매년 기하급수적으로 데이터 증가
500만+
프렌즈팝콘 구글 마켓
누적 다운로드 수
2위
달빛조각사 구글 매출
최고 순위
1TB+
일 로그 양
27
28. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
카카오게임즈 기대작 - 오딘: 발할라 라이징
“새로운 데이터 분석 플랫폼의 빠른 구축 필요”
28
29. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
29
새로운 데이터 분석 플랫폼의 핵심과제
트래픽에 따른
탄력적인 리소스 조정
인프라 관리/
운영 부담 감소
가용성 및 내구성
어떠한 데이터 유형도
빠른 분석 가능
30. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
30
새로운 데이터 분석 플랫폼의 핵심과제
트래픽에 따른
탄력적인 리소스 조정
인프라 관리/
운영 부담 감소
가용성 및 내구성
어떠한 데이터 유형도
빠른 분석 가능
전용 데이터레이크 구축
AWS
31. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
어디서부터 시작하지? 무엇부터 해야 하지?
• AWS 서비스의 경험 부족
• 카카오게임즈 분석 환경에 적합한 서비스는?
• 온프레미스 환경의 업무와 병행
• (학습 테스트 구축) 시간 부족
31
32. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
32
데이터레이크 일정
8주 구축 + 3주 오픈 준비 => 12주간 실행
01 02 03 04 05
06 07 08 09~11 12
33. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
게임 데이터 분석 파이프라인
33
데이터
소스
데이터
수집
카탈로그
데이터레이크
데이터
처리 & 분석
소비
Amazon Kinesis
Data Streams
Amazon Kinesis
Data Firehose
AWS Glue
Data Catalog
Amazon S3
Amazon Athena
Amazon OpenSearch
Amazon EMR
Amazon Redshift
MSTR
Kibana
Data Analyst
Client
Platform
34. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터 분석 플랫폼 아키텍처 TO-BE
Glue
Data Catalog
EMR
Redshift MSTR
Kinesis
Data Streams
Kinesis
Data Firehose
OpenSearch
Service
Kibana
Real-time
Batch
Athena
Client
처리&분석 소비
S3
(데이터레이크)
수집
카탈로그
S3
(데이터레이크)
Data Analyst
Platform
데이터소스
Client
34
35. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
데이터레이크 S3
35
• 카카오게임과 관련된 모든 데이터를 한 곳에 모으는 중앙집중식 데이터 저장소
Step Bucket Data Type Purpose Data Life Cycle
1 Raw • Kinesis를 통해 수집한 원본 데이터 저장 영역
• 최소의 전처리 적용 백업 영역
• 추후 비용 절약을 위해서 Intelligent-Tiering으로 설정
10일
2 Proceed • 분석에 최적화된 전처리 된 영역
• Athena, Spark, Redshift에서 조회 가능
• 분산 및 파티션 정책 수립
90일
Analytics • DW/MART 데이터 영역
• Parquet형식으로 저장
-
N/A Config • 개발 및 환경 구성, 자동화, 형상 관리 등을 위한 배포 파일 저장 영역 -
36. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
실시간 데이터 파이프라인 : 로그
36
임
• JSON Array형태와 유사한 None JSON
• code : 로그의 분류
• logBody : 분석에 필요한 메인 로그
["log_playerLog",
{ stream_meta_info=“***” },
{ "publishTime":1612340607927,
"code":"item",
"logBody":{ "subReason":”x",
"reason":"pick_up",
"rCurrency":gold",
"quantity":1,
”playerLv":155,
"playerId":”**********",
"modType":"add",
"market":"googlePlay",
"itemId":"00001",
"gameWorld":"world_**"
}, …
}
]
37. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
실시간 데이터 파이프라인 : 전처리
37
Kinesis Data Analytics
EMR Spark Streaming
Glue
Lambda
전처리
Kinesis Data Streams
38. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
실시간 데이터 파이프라인 : Lambda
38
1. Json 포맷 변경
2. Code단위 분기처리
Amazon Kinesis
Data Firehose
Amazon Kinesis
Data Firehose
Amazon Kinesis
Data Firehose
Full Raw Data
code = #
Amazon
OpenSearch
Service
Kinesis Data Streams
전처리
Kinesis Data Analytics
EMR Spark Streaming
Glue
Lambda
39. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
Lambda 전처리 부하 테스트
39
테스트
• 키네시스 로그 20~30만/Sec 발생
결과
• Concurrent executions limit: 2,000 개
• Memory: 256MB
• Log 26만/sec 안정적인 전처리 가능
40. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
대용량 데이터 배치 처리 : EMR
S3(Proceed)
External table
Schema
EMR S3(Analytics)
Glue Data Catalog
탄력적인
리소스 관리
다수의 배치작업
실패없이 수행
기존 Hive SQL
마이그레이션 용이
편리한 운영
높은 가용성
40
41. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
Workflow : EMR
41
Airflow DAG
EmrCreateJobFlow
Operator
S3
(Config)
Operator
Step
EMR
EMR
Create
Job
Submit
Data
write
S3
( ETL/DW/Mart )
설정정보
read
Data
write
Paramter
Store
RedShift
EmrAddSteps
Operator
EmrTerminateJobFlow
Operator
Postgres
Operator
Provisio
ning
Add steps
Terminate
Cluster
DataLoad
Query Exec
deploy
EMR Cluster
(Transient)
EMR Cluster
(Persistent)
42. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
EMR 성능 비교
42
• Spark 성능의 최적화를 위해 Memory Intensive R type Instance 사용
• EMR 6.2(Spark 3.0) > EMR 5.33(Spark 2.4)
• CPU Type (R5 > R5a > R6g)
43. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
빅데이터 기반 비즈니스 인텔리전스 : Redshift
43
JDBC/ODBC
Leader
node
Compute
node
Compute
node
Compute
node
Amazon Redshift Managed Storage
Exabyte-scale object storage
• 컴퓨팅과 스토리지 분리
• 성능 요구 사항에 따라 노드의 수 선택
• 사용한 관리형 스토리지의 비용만 지불
• Redshift Spectrum : S3 저장소 기반의 데
이터 레이크 연계 가능
• 웹 기반 모니터링 운영도구 제공
RA3 Cluster
44. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
Redshift 비용 최적화
44
임
• Redshift Schema Binding View
CREATE OR REPLACE VIEW redshift.fact_table AS
SELECT col1, col2, col3, col4,…
FROM redshift_inner.fact_table
WHERE date_id >= (CURRENT_DATE - 60)
UNION ALL
SELECT col1, col2, col3, col4,…
FROM redshift_spectrum.fact_table
WHERE date_id < (CURRENT_DATE - 60)
WITH NO SCHEMA BINDING;
45. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
구축 후 1년 : 안정화를 지나 고도화 단계
• 어떠한 형식의 대용량 데이터라도 1분 이내에 분석 가능
• 기존 하둡 대비 용량 및 운영 리소스 감소로 42% 비용 절감
• 빅데이터 배치 처리시간 3배 이상 속도 향상
• 큰 장애가 없는 안정적인 플랫폼
• 데이터레이크 기반 플랫폼 확장
45
46. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
다음 단계 : AI/ML 로의 확장
데 이 터 레 이 크 + 머 신 러 닝 을 통 한 사 용 자 이 탈 예 측 모 델
46
Amazon S3 머신러닝
데이터 레이크
• 수집된 데이터를 바탕으로 게임 플레이어 이탈 예측
• 데이터 레이크 + AWS Glue + Amazon SageMaker
• MLOps 구축
47. © 2022, Amazon Web Services, Inc. or its affiliates.
GAMES ON AWS 2022
Thank you!
© 2022, Amazon Web Services, Inc. or its affiliates.
김민석
Solutions Architect
AWS
조은희
DataLake TFT Leader
KakaoGames