[td 2015]치즈케이크 팩토리는 알겠는데, 데이터 팩토리는 뭔가요(한기환)

Post on 14-Apr-2017

756 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

한기환 / 한국마이크로스프트

Cheesecake factory는 알겠는데Azure Data Factory 뭔가요

세션의 목적

• 목적• Azure Data Factory를 통해 데이터에서 신뢰할 수 있는 정보를 더 빠르

고 쉽게 얻을 수 있도록 한다.

• 목표• ADF의 이해 – 개념/용어/동작방식

• ADF 활용을 위한 시나리오 도출

내용

• 왜 ADF가 필요한가

• ADF란 무엇인가

• ADF 활용 시나리오

왜AD

F

필요한가

전통적인 DW

5

데이터 소스

데이터 양의폭증

1

실시간data

2

비관계형 데이터

새로운 데이터소스와 유형

3

클라우드태생의 데이터

4

ETL Tool(SSIS, etc)

EDW(SQL Svr, Teradata, etc)

Extract

Original Data

Load

Transformed Data

Transform

BI Tools

Data Marts

Data Lake(s)

Dashboards

Apps

진화하는 분석 방식

ETL Tool(SSIS, etc)

EDW(SQL Svr, Teradata, etc)

Extract

Original Data

Load

Transformed Data

Transform

BI Tools

Ingest (EL)

Original Data

Data Marts

Data Lake(s)

Dashboards

Apps

진화하는 분석 방식

ETL Tool(SSIS, etc)

EDW(SQL Svr, Teradata, etc)

Extract

Original Data

Load

Transformed Data

Transform

BI Tools

Ingest (EL)

Original Data

Scale-out Storage & C

ompute(HDFS, Blob Storage,

etc)

Transform & Load

Data Marts

Data Lake(s)

Dashboards

Apps

Streaming data

진화하는 분석 방식

데이터 허브(Storage & Compute)

데이터 소스(Import From)

Move data among Hubs

데이터 허브(Storage & Compute)

데이터 소스(Import From)

Ingest

진화하는 분석 방식

연결&수집 변형&보강 배포정보 생산:

Ingest

이동

BI Tools

Data Marts

Data Lake(s)

Dashboards

Apps

AD

F

무엇인가

ADF의 데이터 처리 과정

INGEST 준비 변형&분석 배포

데이터 소스 데이터 소비

ADF의 주요 개념

Activity에 의해소비

Dataset생산

수행(on)

Activity 논리 그룹

Linked Service에 저장된 데이터 아이템 표현

Data Factory

개발자/IT Pro를 위한 플랫폼으로데이터 처리, 저장소 그리고 이동 서비스를 작성하고분석 파이프라인을 생성 및 조작할 수 있다.

데이터 소스

BI에서 소비

앱에 통합

Azure Data Factory

조정과 관리• 파이프라인에서 데이터 변형 네트워크를 작

성/관리

• 단일 시각에서:

• 전체 데이터와 조작 계보(operational lineage )

• 파이프라인과 데이터집합 상태 모니터

• 데이터 생성 정책 제어

데이터 저장과 처리 환경• 소유하고 있는 데이터로 작업

• 온프렘 SQL Server

• Azure DB, Azure Blobs, Azure table

• 데이터 처리의 작성 및 연계(orchestrate)

• HDInsight, Custom Code, etc.

관계형 & 비관계형

온프렘 / 클라우드

배치 / 스트림

Hadoop (Hive, Pig, etc.)

Custom code

데이터 이동

정보 자산원시 데이터 연계,모니터

ADF로 운영에 필요한 정보 생산

• 조정과 일정관리• 모니터링과 관리• 데이터 계보

ADF로 운영에 필요한 정보 생산 (성공/실패)

AD

F

활용

시나리오

Azure Data Factory Top 사용 사례

18

사용 사례 산업 분야

사용자와 제품 프로파일링 상호 동작하는 엔터테인먼트 / 소매

마케팅 캠페인 분석 상호 동작하는 엔터테인먼트

고객 감성 분석 상호 동작하는 엔터테인먼트 / 소매

정정 및 예방 정비와 보수 작업 제조 (IoT)

개인화된 제품 추천 소매

보함 계리 모델링과 보고서 자동화 금융 서비스

재무 위험 모델링과 분석 금융 서비스

운영 원격측정과 상태 보고 온라인 서비스

고객 구매 활동 분석 소매

가격 최적화 소매

Azure Data Factory 고객

19

Studio A/B Windows Intune SQL Azure

시나리오 분석 :고객 프로파일링 (게임 로그 분석)

Samples on GitHubhttps://azure.microsoft.com/en-us/documentation/articles/data-factory-samples/

게임 콘솔

핸드헬드 장치

PC

User

시나리오 : 게임 고객 프로파일링

Game logs

신규 사용자 패턴

사용량/지역

활용 방안 : 비즈니스 개선 및 고객에게 더 나은 환경 제공• 탁월한 새 기능 개발• 교차 판매 기회 포착

마케팅 캠페인 효과 분석

사용자 가입

마케팅 활동

Storage

고객 프로파일링 – 게임 사용 분석

2277,2013-06-01 02:26:54.3943450,111,164.234.187.32,24.84.225.233,true,8,1,20582277,2013-06-01 03:26:23.2240000,111,164.234.187.32,24.84.225.233,true,8,1,2058-2123-2009-2068-21662277,2013-06-01 04:22:39.4940000,111,164.234.187.32,24.84.225.233,true,8,1,2277,2013-06-01 05:43:54.1240000,111,164.234.187.32,24.84.225.233,true,8,1,2058-225545-2309-2068-21662277,2013-06-01 06:11:23.9274300,111,164.234.187.32,24.84.225.233,true,8,1,223-2123-2009-4229-99366232277,2013-06-01 07:37:01.3962500,111,164.234.187.32,24.84.225.233,true,8,1,2277,2013-06-01 08:12:03.1109790,111,164.234.187.32,24.84.225.233,true,8,1,234322-2123-2234234-12432-344323…

로그 파일 일부 (수십 TB/day)

사용자 테이블

UserID FirstName LastName Country …

2277 Pratik Patel USA

664432 Dave Nettleton USA

8853 Mike Flasko Canada

지역별 신규 사용자 활동/Week

profileid day state duration rank weaponsused interactedwith

1148 6/2/2013 Oregon 216 33 1 5

1004 6/2/2013 Missouri 22 40 6 2

292 6/1/2013 Georgia 201 137 1 5

1059 6/2/2013 Oregon 27 104 5 2

675 6/2/2013 California 65 164 3 2

1348 6/3/2013 Nebraska 21 95 5 2

23

Azure Data Factory 사용 절차

New-AzureDataFactory-Name “HaloTelemetry“-Location “West-US“

Step 1: Data Factory 생성

Script: UI:

DATA FACTORY NAME

Script: UI:

New-AzureDataFactoryCompute-Name "MyHDInsightCluster“-DatawarehouseName “HaloTelemetry"-File HDIResource.json

New-AzureDataFactoryStores-Name "MyStorageAccount"-DatawarehouseName “HaloTelemetry"-File BlobResource.json

DATA FACTORY NAME

Step 2: 데이터 소스와 계산 리소스 추가

예: 게임 로그, 고객 프로파일링

온프렘 SQL Server Azure Blob Storage

1000’s 로그 파일신규 사용자 뷰

Azure Data Factory

HDInsight

예: 게임 로그, 고객 프로파일링

온프렘 SQL Server Azure Blob Storage

1000’s 로그 파일New Users View

Azure Data FactoryV

iew

Of

GameUsage

Vie

w O

f

NewUsers

New User Activity

HDInsight

예: 게임 로그, 고객 프로파일링

온프렘 SQL Server Azure Blob Storage

1000’s 로그 파일New Users View

Copy “NewUsers” to Blob Storage

CloudNewUsers

Azure Data FactoryV

iew

Of

GameUsage

Vie

w O

f

NewUsers

New User Activity

Vie

w O

f

Pipeline

HDInsight

예: 게임 로그, 고객 프로파일링

온프렘 SQL Server Azure Blob Storage

1000’s 로그 파일New Users View

CloudNewUsers

Azure Data FactoryV

iew

Of

GameUsage

Vie

w O

f

Mask & Geo-Code

NewUsers

Geo Dictionary

Geo Coded Game Usage

HDInsight

New User Activity

Pipeline

Pipeline

Copy “NewUsers” to Blob Storage

예: 게임 로그, 고객 프로파일링

온프렘 SQL Server Azure Blob Storage

1000’s 로그 파일New User View

Copy “NewUsers” to Blob Storage

CloudNewUsers

Azure Data FactoryV

iew

Of

Game Usage

Vie

w O

f

Ru

ns

OnMask &

Geo-Code

NewUsers

Geo Dictionary

Geo Coded Game Usage

Join & Aggregate

HDInsight

New User Activity

Vie

w O

f

Pipeline

Pipeline

Pipeline

Step 1 : 온프렘 SQL Server의 신규 사용자 데이터를 클라우드로 복사

Step 1 : 온프렘 SQL Server의 신규 사용자 데이터를 클라우드로 복사

{"name": “NewUsers","properties":{

"structure": [

{ "name": “UserID", "position": 0, "type": "String"},{ "name": “FirstName", "position": 1, "type": "String"},{ "name": “LastName", "position": 2, "type": "String"},{ "name": “Country", "position": 3, "type": "String"},{ "name": “State", "position": 4, "type": "String"},{ "name": “Address", "position": 5, "type": " String "}

],"location": {

"type": "OnPremisesSqlServerTableLocation","tableName": "RefHaloUsersTable","linkedServiceName": "OnPremSqlServerLinkedService"

},"availability": {

"frequency": "Day","interval": 1,"waitOnExternal":{

"retryInterval": "00:01:00","retryTimeout": "00:10:00","maximumRetry": 3

}}

}}

{"name": “CloudNewUsers","properties":{

"structure": [

{ "name": “UserID", "position": 0, "type": "String"},{ "name": “FirstName", "position": 1, "type": "String"},{ "name": “LastName", "position": 2, "type": "String"},{ "name": “Country", "position": 3, "type": "String"},{ "name": “State", "position": 4, "type": "String"},{ "name": “Address", "position": 5, "type": " String "}

],"location": {

"type": "AzureBlobLocation","blobPath": "$$Text.Format('adfwalkthrough/refdata/refmarketingcam

paign/')","format":{

"type": "TextFormat","columnDelimiter": ","

},"linkedServiceName": "StorageLinkedService"

},

"availability": {

"frequency": "Day","interval": 1,

},"policy":{

"validation":{

"minimumSizeMB": 50.00}

}}

}

"blobPath" : "$$Text.Format(''adfwalkthrough/refdata/refmarketingcampaign/ {0:yyyy-MM-dd}', SliceStart)"

{"name": "CopyUsersDataPipeline","properties":{

"description" : "Pipeline to copy regional campaign data from on-prem SQL server to BlobStore)","activities":[

{"name": "CopyRegionalCampaignDataFromOnprem","description": "Copy the Regional data from on-prem SQL server to BlobStore","type": "CopyActivity","inputs": [ {"name": "NewUsers"} ],"outputs": [ {"name": "CloudNewUsers"} ],"transformation":{

"source":{

"type": "SqlSource","SqlReaderQuery": "select * from dbo.RefHaloUsersTable "

},"sink":{

"type": "BlobSink","writeBatchSize": 1000000,

}},"Policy":{

"concurrency": 1,"executionPriorityOrder": "NewestFirst","style": "StartOfInterval","retry": 0,"timeout": "01:00:00"

}

}]

}}

"$$Text.Format('select * from dbo.RefHaloUsersTable where Timestamp >= \\'{0:yyyy-MM-dd}\\' AND Timestamp < \\'{1:yyyy-MM-dd}\\'', SliceStart, SliceEnd)"

Step 1 : 온프렘 SQL Server의 사용자 데이터를 클라우드로 복사

Step 2 : Pig 스크립트로 게임 사용 데이터 익명화하기

Step 2 : Pig 스크립트로 게임 사용 데이터 익명화하기

RawStats = LOAD '$LOGINPUT' USING PigStorage(',') AS (ProfileID:chararray, SessionStart:chararray, Duration:int, SrcIPAddress:chararray, GameType:chararray, Multiplayer:chararray, EndRank:int, WeaponsUsed:int, UsersInteractedWith:chararray);

{

"name": "EnrichGameLogsPipeline","properties":{

"description": "Uses pig script to geocode game usage logs by state and hide last octet of IP address, producing enriched game logs (v1.0)","activities":[

{"name": "PigEnrichLogs","description": "Enrich logs using pig","type": "HDInsightActivity","inputs": [ {"name": "GameUsageEventsTable"}, {"name": "RefGeoCodeDictionaryTable"} ],"outputs": [ {"name": "EnrichedGameEventsTable"} ],"linkedServiceName": "HDInsightLinkedService","transformation":{

"type": "Pig","extendedProperties":{

"LOGINPUT": "$$Text.Format('wasb://adfwalkthrough@anandsub14.blob.core.windows.net/logs/partitionedgameevents/yearno={0:yyyy}/monthno={0:%M}/dayno={0:%d}/', SliceStart)","MAPINPUT": "wasb://adfwalkthrough@anandsub14.blob.core.windows.net/refdata/refgeocodedictionary/","LOGOUTPUT": "$$Text.Format('wasb://adfwalkthrough@anandsub14.blob.core.windows.net/logs/enrichedgameevents/yearno={0:yyyy}/monthno={0:%M}/dayno={0:%d}/', SliceStart)"

},"scriptPath": "adfwalkthrough\\scripts\\enrichlogs.pig","scriptLinkedService": "StorageLinkedService"

},"policy":{

"Concurrency": 1,"ExecutionPriorityOrder": "OldestFirst","Retry": 1,"Timeout": "01:00:00"

}}

]}

}

Step 2 : 조인, 집계 후 처리된 데이터 자산을 Azure SQL DB로 이동

{"name": "CopyGameUsageToSQL","properties":{

"description": "copy game usage data to a data mart for consumption via BI tools","activities":[

{ "name":"CopyGameUsage","description":"copy from blob to sql","type":"CopyActivity","inputs":[

{ "name":"EnrichedGameEventsTable"

}],"outputs":[

{ "name":"GameUsageReport"

}],

"transformation":{ "source":{

"type":"BlobSource","blobColumnSeparators":","

},"type": "SqlSink","writeBatchSize": 1000000,"writeBatchTimeout": "01:00:00","SqlWriterTableType": "MarketingCampaignEffectivenessType","SqlWriterStoredProcedureName": "spEgressOverwriteMarketingCampaignEffectiveness"

}},"policy":{

"concurrency":1,"executionPriorityOrder":"OldestFirst","retry":0,"timeout":"01:00:00"

}}

]}

}

예: 게임 로그, 고객 프로파일링

온프렘 SQL Server Azure Blob Storage

1000’s 로그 파일New User View

Copy “NewUsers” to Blob Storage

CloudNewUsers

Azure Data FactoryV

iew

Of

Game Usage

Vie

w O

f

Ru

ns

OnMask &

Geo-Code

NewUsers

Geo Dictionary

Geo Coded Game Usage

Join & Aggregate

HDInsight

New User Activity

Vie

w O

f

Pipeline

Pipeline

Pipeline

“GeoCoded Game Usage” Table:

Step 3: 테이블과 Pipeline 정의

Pipeline Definition:

Step 3: 테이블과 Pipeline 정의

Step 4: 배포 및 시작

// 테이블 배포

New-AzureDataFactoryTable-DataFactory“GameTelemetry“-File NewUserActivityPerRegion.json

// 파이프라인 배포

New-AzureDataFactoryPipeline-DataFactory “GameTelemetry“-File NewUserTelemetryPipeline.json

// 파이프라인 시작

Set-AzureDataFactoryPipelineActivePeriod-Name “NewUserTelemetryPipeline“-DataFactory “GameTelemetry“-StartTime 10/27/2015 12:00:00

• Slice :• 하나의 논리적 시간. 하나 이상의 activity가 수행되면서 생성되는 데이터 파티셔닝 기반.

• 데이터집합 정의에서 availability 속성으로 정의됨

• Activity가 수행되면 가장 작은 단위는 Slice 데이터를 생산 및 변경함.

Dataset Slice

"availability": { "frequency": "Day", interval": 1 }

Hourly

12-1

1-2

2-3

GameUsageActivity: (예: Hive)

증분 데이터 생산

Dataset2

Dataset3

Hourly

12-1

1-2

2-3

Daily

Monday

Tuesday

Wednesday

Daily

Monday

Tuesday

Wednesday

Hive Activity

GameUsage

GeoCodeDictionary

Geo-CodedGameUsage

* Daily로 수행되는 Hive Activity는GameUsage의 24개의 시간단위 slice와GeoCodeDictionary의 daily slice의 연산(조인/집계)에 의해Geo-CodedGameUsage의 slice를 매일 업데이트 함

• Is my data successfully getting produced? • Is it produced on time?• Am I alerted quickly of failures?• What about troubleshooting information?• Are there any policy warnings or errors?

Step 5: 모니터와 관리

Demo

요약 : Azure Data Factory

Linked Service, Dataset, Activity를 통한 분석 파이프라인

Azure & 온프렘 SQL Server 사이의 Hybrid 이동

풍부하고 단순한 E2E 파이프라인 모니터링과 관리

감사합니다.• MSDN Forum http://aka.ms/msdnforum

• TechNet Forum http://aka.ms/technetforum

사용예:ASAJobs용 Reference Data Refresh

• ADF activity내에 포장된 어떤 .NET code도 수행 가능

• 신규 소스/대상 연결에 사용될 수 있음

• 사용자 정의 변형 activity 생성에 사용될 수 있음

• 예) twitter에서 데이터를 가져오고, Azure ML 모델을 호출하는 사용자 정의Activity 사용하기

• 사용자 정의 activity 생성용 SDK :

사용자 정의 Activity

DotNet Activity

ADF activity내에 포함된 어떤 C# code도 수행할수 있음

"Activities":[

{"Name": "CustomActivity","Type": "CustomActivity","Inputs": [{"Name": "InputBlob1"},

{"Name": "InputBlob2"}],"Outputs": [{"Name": "OutputBlob"}],"LinkedServiceName": "HDInsightLinkedService","Transformation":{

"AssemblyName": "CustomActivityBlobSample.dll",“EntryPoint": "Microsoft.DataFactories.Samples.CustomActivityBlobSample","PackageLinkedService": "LinkedService-CA-AzureStorage","PackageFile": "activitystore/Debug.zip","ExtendedProperties":{

"StartTime": "$$Text.Format('{0:yyyyMMddHH-mm}', SliceStart)" }

},"Policy":{

"Concurrency": 1,"ExecutionPriorityOrder": "OldestFirst","Retry": 3,"Timeout": "00:30:00","Delay": "00:00:00"

}}

]

http://aka.ms/td2015_again

TechDays Korea 2015에서 놓치신 세션은 Microsoft 기술 동영상 커뮤니티 Channel 9에서

추후에 다시 보실 수 있습니다.

top related