Anúncio
Anúncio

Mais conteúdo relacionado

Apresentações para você(20)

Similar a Aws glue를 통한 손쉬운 데이터 전처리 작업하기(20)

Anúncio

Mais de Amazon Web Services Korea(20)

Último(20)

Anúncio

Aws glue를 통한 손쉬운 데이터 전처리 작업하기

  1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 2018 정세웅 빅데이터 솔루션즈 아키텍트 / AWS AWS Glue를 통한 손쉬운 데이터 전처리 작업하기
  2. 강연 중 질문하는 방법 Go to Webinar “Questions” 창에 자신이 질문한 내역이 표시됩니다. 기본적으로 모든 질문은 공개로 답변 됩니다만 본인만 답변을 받고 싶으면 (비공개)라고 하고 질문해 주시면 됩니다. 본 컨텐츠는 고객의 편의를 위해 AWS 서비스 설명을 위해 온라인 세미나용으로 별도로 제작, 제공된 것입니다. 만약 AWS 사이트와 컨텐츠 상에서 차이나 불일치가 있을 경우, AWS 사이트(aws.amazon.com)가 우선합니다. 또한 AWS 사이트 상에서 한글 번역문과 영어 원문에 차이나 불일치가 있을 경우(번역의 지체로 인한 경우 등 포함), 영어 원문이 우선합니다. AWS는 본 컨텐츠에 포함되거나 컨텐츠를 통하여 고객에게 제공된 일체의 정보, 콘텐츠, 자료, 제품(소프트웨어 포함) 또는 서비스를 이용함으로 인하여 발생하는 여하한 종류의 손해에 대하여 어떠한 책임도 지지 아니하며, 이는 직접 손해, 간접 손해, 부수적 손해, 징벌적 손해 및 결과적 손해를 포함하되 이에 한정되지 아니합니다. 고지 사항(Disclaimer)
  3. 본 세션의 주요 주제 • AWS Glue 개요 • Glue 데이터 카탈로그 • Glue ETL 서비스 • ETL 주요 단계 • AWS Glue 활용 패턴
  4. AWS Glue 개요
  5. 분석에서 ETL 이 가장 시간을 많이 소모 ETL Data Warehousing Business Intelligence 70% of time spent here Amazon Redshift Amazon QuickSight
  6. 데이터의 갭 초래 The Data Gap
  7. 데이터는 완벽하지 않다 AWS Lambda 트리거 기반의 서버리스 코드 실행 엔진 AWS Glue 이벤트 기반의 서버리스 ETL 엔진 Amazon EMR Spark 및 Hive가 실행되는 하둡 Clean Transform Concatenate Convert to better formats Schedule transformations Event-driven transformations 데이터 변환을 코드로 표현 데이터는 절대로 완벽해 지기 어렵다.
  8. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS Glue - 완전 관리형 ETL 서비스 간편하고 유연하며 비용 효율적인, 완전 관리형, 서버리스, ETL 서비스 개발자 친화적, Apache Spark 환경, Python과 Scala 코드 지원 AWS의 다양한 데이터 스토어를 소스로 활용 (Aurora, RDS, S3, Redshift, DynamoDB)
  9. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS Glue - 데이터 분석을 위한 준비 q 데이터에 대한 하나의 단일된 뷰 – 데이터 카탈로그 q 데이터의 이동과 변환 작업(ETL), Job 스케줄링AWS Glue
  10. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS Glue 고객 리스트
  11. Fivetran AWS의 많은 ETL 파트너들 … 실제로는 툴보다 매뉴얼 코드
  12. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS Glue 구성 요소 Job 생성데이터 카탈로그 Job 실행 Apache Hive Metastore compatible Integrated with AWS services Automatic crawling Discover Auto-generates ETL code Python and Apache Spark Edit, debug, and share Develop Serverless execution Flexible scheduling Monitoring and alerting Deploy
  13. AWS Glue 데이터 카탈로그
  14. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS Glue – 데이터 카탈로그 데이터를 쉽게 찾고 관리할 수 있게 해주는 Glue 데이터 카탈로그 데이터를 탐색하여 스키마 정보 추출 Data Source : S3, JDBC 호환 Database, DynamoDB 크롤러는 자동적으로 데이터 스키마를 찾아서 저장 Apache Hive Metastore와 호환 데이터의 검색과 ETL 작업을 가능 테이블 스키마 정보와 컬럼 레벨 통계 정보를 포함 • S3 Data Source: 거의 모든 텍스트 유형의 파일 지원 (Parquet, ORC, Avro, JSON, CSV, TSV, Apache Log)
  15. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 데이터 카탈로그 - 테이블 상세 정보 포함 테이블 스키마 테이블 속성 데이터 분포 통계 중첩 필드 구조
  16. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 데이터 카탈로그 - 자동적으로 파티션 구조 파악 파티션 구조 탐지
  17. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 파티션을 어떻게 파악하는가? Estimate schema similarity among files at each level to handle semi-structured logs, schema evolution…
  18. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 주기적으로 Glue의 크롤러를 실행하면, 변경된 스키마에 대한 탐지와 버전 관리 가능 데이터 카탈로그 - 스키마 변경 탐지 및 버전 관리
  19. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 빠르게 필요한 데이터에 대한 검색 데이터 검색 검색 결과 뷰를 저장 Amazon Athena를 통한 데이터 쿼리
  20. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Data Catalog를 생성하는 방법 Call Glue’s CreateTable API Create table manually Run Hive DDL statement(Amazon Athena)
  21. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Import/Export your metadata Apache Hive Metastore Apache Hive Metastore Import from an external metastore Export to an external metastore Find the import/export ETL script on Glue’s GitHub repository AWS GLUE ETL AWS GLUE ETL AWS GLUE DATA CATALOG
  22. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 데이터 카탈로그가 만들어지면.. > 필요한 데이터의 검색 가능 ETL 작업의 데이터 소스로 즉시 활용 가능 Athena, EMR, Redshift 등 에서 단일된 뷰로 동일한 데이터에 접근 / 활용 가능 > >
  23. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS 분석 서비스들이 Glue 데이터 카탈로그 공유 Amazon S3 Data Catalog AthenaEMR Amazon Redshift Spectrum Amazon Sagemaker RDS Amazon QuickSight Kinesis Database Migration Service AWS Glue IAM Other Sources
  24. AWS Glue ETL
  25. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS Glue - ETL 서비스 Job 스크립트 작성과 실행을 쉽게 도와주는 서버리스 데이터 변환작업 Apache Spark 기반 클릭 몇번으로 생성되는 ETL code 수정 / 추가가 가능한 PySpark과 Scala 코드 반복 일정과 이벤트에 따른 Job 스케줄링 Zeppelin, PyCharm 등 익숙한 환경에서 수정, 디버그, 테스트가 가능하도록 Dev Endpoint 제공 (Python 2.7 지원) • Sample ETL Codes : https://github.com/awslabs/aws-glue-samples • About Dev Endpoint : https://docs.aws.amazon.com/ko_kr/glue/latest/dg/dev-endpoint.html
  26. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Job 생성 - 콘솔에서 코드 생성 1. 콘솔에서 컬럼 단위의 맵핑을 수정하면 2. Glue에서 자동적으로 데이터 변환 그래프와 PySpark (또는 Scala) 코드를 생성, 직접 수정 가능 3. 직접 사용하는 노트북 서비스로 Dev Endpoint 이용하여 코딩 가능
  27. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Job 북마크 북마크 기능을 통해 지속적으로 추가되는 데이터에 대한 중복 작업 관리가 가능 예제 : 일단위로 증가하는 로그 데이터 처리 시간단위로 Kinesis Firehose 데이터 처리 DB에 저장된 데이터를 시간단위로 처리 (단일 PK 데이터) 옵션 동작 방식 Enable 이전 실행한 이후 데이터만 실행 Disable 이전 단계 무시, 전체 데이터 실행 Pause 필요에 따라 일시적으로 북마크 정지 run 1 run 2 run 3 run 1 run 2 run 3 enabledisable pause
  28. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Job 스케줄링과 모니터링 이벤트 기반 Job을 실행 가능하며, 여러 Job 사이에 의존성을 설정 가능 § 각기 다른 조직에서 업무 연계와 Job의 재사용이 용이 다양한 Job 트리거 방법들 § 스케줄 기반 : 예) 특정 시간, 특정 Job 이후 § 이벤트 기반 : 예) Job 종료 / 실패 / 중단 § On-demand : 예) AWS Lambda 로그와 경고는 Amazon CloudWatch를 통해 확인 가능 Marketing: 고객 분류 별 광고 소비 이벤트 기반 Lambda Trigger Sales: 고객 분류 별 매출 스케줄 기반 데이터 기반 Central: 고객 분류 별 ROI Weekly sales 데이터 기반
  29. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Job 실행 - 서버리스 Job을 실행하기 위해서 자동적으로 인프라를 생성하고 사용한 만큼만 과금 고객 VPC 고객 VPC Warm pool of instances § 서버 풀 : Job 시작시간을 줄이기 위해 미리 설정된 서버 그룹을 운영 § 자동 설정된 VPC와 Role 기반 접근 제어 § 고객의 요구와 SLA를 맞추기 위해서 자동적으로 리소스 확장 § 단지, Job 실행을 위해 사용한 리소스에 대해서만 비용 지불
  30. AWS Glue ETL 주요 단계
  31. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS Glue 를 활용한 ETL 주요 단계 1. 데이터 소스에 Crawler를 통해 데이터 카탈로그 생성 2. 컬럼 단위의 맵핑을 통해 자동 코드 생성 3. 편리한 환경에서 자유롭게 코드 수정 및 테스트(/w Dev-Endpoint) 4. 실제 운영 환경에서 Job 스케줄링 및 실행
  32. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Step 1 : Crawler 실행 버킷 / 폴더 / 파일유형에 따라 테이블 메타정보 저장 Hive metastore 호환 파티션
  33. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Step 2 : 자동 ETL 코드 생성 데이터 소스와 타겟 지정 컬럼 레벨의 스키마 변경 가능
  34. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Step 2 : 자동 ETL 코드 생성 Initialize job bookmark Annotations for graphical DAG Read Dynamic Frame from source Data transformation + data cleaning functions Write Dynamic Frame to sink Commit job bookmark
  35. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Step 3 : 코드 수정 및 데이터 탐색(/w Dev-Endpoint) AWS Glue의 Dev-Endpoint를 이용해서 자신의 IDE 환경으로 접속 인터렉티브한 ETL code 개발, 디버그, 테스트 환경 구축 AWS Glue Spark environment Interpreter Server Remote Interpreter
  36. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Step 3 : 코드 수정 및 데이터 탐색(/w Dev-Endpoint) Apache Zeppelin 노트북을 통한 AWS Glue Dev-Endpoint 접속 인터렉티브한 데이터 쿼리 및 탐색이 가능
  37. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Step 4 : Job 스케줄링 및 실행 이벤트 유형과 빈도 설정 필요한 파라미터 설정
  38. AWS Glue 활용 패턴
  39. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 데이터 웨어하우스의 로그데이터 분석
  40. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 다양한 데이터 스토어에 대한 통합된 뷰
  41. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. S3 데이터 레이크에 대한 쿼리 수행
  42. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 이벤트 기반 ETL 파이프라인
  43. 질문에 대한 답변 드립니다. 발표자료/녹화영상 제공합니다. http://bit.ly/awskr-webinar 더 나은 세미나를 위해 여러분의 의견을 남겨 주세요!
Anúncio