SlideShare a Scribd company logo
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
IOT
실전 프로젝트로 이야기하는
AWS IoT
이창화
수석 / IOT 개발팀 / Coway
김민성
Solutions Architect / Amazon Web Services
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
실전 프로젝트로 깨달은 경험들
• MQTT, 디바이스 쉐도우
• 코웨이의 경험
• IoT 정책 및 룰엔진
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
일반적인 IoT 시스템 구성
Database
급격히 증가하는 관리 부담
Thing
(Entity)
History
Control
Monitor
성능 병목
or Message Queue
MQTT adapter
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AWS IoT Core
IoT 서비스 구현에 필요한 요소들
• 메시지 브로커
• 룰 엔진
• 디바이스 쉐도우
• 디바이스 등록
관리형 서비스
• 설치 불필요
• 자동 확장
• 사전 프로비저닝 불필요
• 가용역영에 걸친 이중화
• 사용량에 기반한 과금
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
디바이스와 AWS IoT와의 통신
지원하는 프로토콜 : MQTT, HTTP, MQTT over WebSocket
SUB: robotics/status/r27
{ “status”: “green” }
PUB: robotics/status/r27
“Alert Status Green”
MQTT
- MQTT는 경량의 Publish/Subscribe(Pub/Sub) 메시징 프로토콜
- M2M(machine-to-machine)와 IoT(Internet of things)
IoT를 위해서 낮은 전력, 낮은 대역폭 환경에서도 사용
Client ID : r27 Client ID : Monitor-Robotics
토픽 : “robotics/status/r27”
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
토픽 (Topic)
토픽이란?
Publishing Clients와 Subscribing
Client간의 메세지를 주고 받는 메세지
통로
• 토픽의 명명 단위는 어플리케이션를
반영
• (/)를 이용해 토픽 계층 구조 표현
• (#)또는 (+)를 토픽 필터로 활용
• 예약된 토픽은 ($)로 시작
AWS IoT
PUBLISH sensors/123
PUBLISH sensors/456
PUBLISH sensors/789
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
토픽 (Topic) 필터
PUB: robotics/building1234/rt5678
PUB: robotics/building1234/rt1234
SUB: robotics/building1234/#
{“status”: “green” }
{ “status”: “red” }
{ “status”: “green” }
{ “status”: “red” }
토픽 필터 설명
#
• 현재 트리 및 모든 하위 트리를 일치시키는 와일드카드로 활용
• 구독 중인 토픽의 마지막 문자여야함
• Sensor/#을 구독할 경우 Sensor/의 모든 메세지 구독 (예: Sensor/temp, Sensor/temp/room1)
+ • 토픽 계층 표현시 간소화를 위하여 활용
• Sensor/+/room1을 구독할 경우 Sensor/temp/room1, Sensor/moisture/room1 등에 게시된 메시지를 수신
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
토픽 (Topic) 디자인
• 상위 Namespace 및 그룹 정보의 반영
• 어플리케이션 정보, 그룹 정보와 같은 맥략 정보
• 커뮤니케이션에 대한 주요 정보 반영
• thingName, clinedId, uuid 정보
• 데이터 토픽과 커멘드 토픽의 분리
Structure: dt/<namespace>/<group-id>/<thing-name>/<data-type>
Structure: cmd/<namespace>/<group-id>/<thing-name>/req-type
데이터 토픽
커멘드 토픽
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
커멘드 토픽의 구현
컨트롤 로직
PUBLISH
cmd/namespace/groupid/robot-123
{ "Pmode": "on" }
직접 Publishing
인터넷
• 메세지의 순서의 변화
• Thing의 커넥션 상태 또는 On/Off 여부
“기존 MQTT 만으로는
충분하지 않습니다.”
Shadow
State
Apps
offline
디바이스 쉐도우
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
디바이스 쉐도우와 Document
{
"state" : {
"desired" : {
"lights": { "color": "RED" },
"engine" : "ON"
},
"reported" : {
"lights" : { "color": "GREEN" },
"engine" : "ON"
},
"delta" : {
"lights" : { "color": "RED" }
}
},
"version" : 10
}
• Desired: 사용자가 원하는 상태
• Reported: Thing 보고한 현재 상태
• Delta: Desired와 Reported가 서로 다른 상태
“Document”
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
클라이언트에서는? (JS 예시)
디바이스 쉐도우
공기 청정기 (Air Purifier)
- airPurifierIsOn : true / false
변경이 있을때마다 상태 보고 해야함
Delta: Desired 와 Reported 가 상의함
공기 청정기의 현재 상태를
Desired의 값으로 변경
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
디바이스 쉐도우 토픽 활용
디바이스 쉐도우의 Update 토픽
$aws/things/AirpurifierBig001/shadow/update
원하는 컨트롤을 등록한 후 Publish
“desired” : {
“airPurifierIsOn”: false
}
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
디바이스 쉐도우의 주요 토픽
UPDATE: $aws/things/{thingName}/shadow/update
GET: $aws/things/{thingName}/shadow/get
DELETE: $aws/things/{thingName}/shadow/delete
DELTA: $aws/things/{thingName}/shadow/update/delta
DOCUMENTS: $aws/things/{thingName}/shadow/update/documents
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
디바이스 쉐도우와 버전
공기 청정기
컨트롤 로직
on (version=1)
off (version=2)off (version=2)
on (version=1)
이전 버전의 업데이트 요청은
409 에러와 함께 거부됨
이전 버전의 업데이트 요청을
무시 할 수 있음
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
디바이스 쉐도우와 버전
Coway에서는 기존 제품의 프로토콜
지원을 위하여 “호환 계층” 을
가지고 있습니다.
호환 계층
1. Delta 발생 (Desired 와 Reported의 차이)
2. Thing에 상태 정보 변경 요청
3. Thing의 상태 정보 변경 완료
4. Desired와 Reported 일치
호환 계층에서 디바이스 쉐도우 업데이트
• Document 삭제
• NULL 처리
• Desired state
• 특정 attribute
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Coway “wellness appliance”
Water Care, Air Care, Body Care, Sleep Care, Living Care
삶의 질을 향상 시키는 기업
2017년 기준 2조 3천억
아시아 최대 Wellness appliance
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Coway IOCare
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Coway Airmega
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AWS IoT
아마존 aws 마이그레이션
IoT
topic
IoT
shadow
IoT
policy
Alexa smart
home skill
Alexa voice
service
EchoAlexa skill
Lambda
function
AWS cloud
AWS Manageme
nt Console
virtual private
cloud
Auto
Scaling
Amazon EC2
Amazon
S3
Amazon
RDS
Amazon
DynamoDB
AmazonKinesis
Streams
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
호환 계층으로 인한 경험
• MQTT 프로토콜의 In-Flight 메세지
제한(Thing Shadow) 수량이 커넥션을
기준으로 하고 있었음
(10 In-Flight 메시지/Second/커넥션)
• 단일 호환 계층 서버 (EC)는 약
10000대의 디바이스를 수용
• 위의 제약 요건으로 인해 활용 가능한
초당 In-Flight 메시지는 약 10~20개로
제한 (실제로는 30,000개 정도가 필요)
호환 계층
(G/W)
실
디바이스
Thing
Shadow
호환 계층의 리소스 절약 및 안정적인
연결 유지를 위하여 Backend (IoT)와는
1~2개의 커넥션을 맺고
상시 연결상태 유지
※ EC G/W (External Connector Gateway)
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
어떻게 해결 했는가?
1~2
커넥션
Republish
$shadow
update topic
호환 계층
(G/W)
AWS IoT
IoT rule
IoT
topic
IoT
shadow
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
대량 제어 요청
Bulk 컨트롤 시그널 (예: 환기 요청)
10ms내에 30,000개의 요청
Bulk 컨트롤 시그널 (예: 환기 알림)
큐를 활용한 지연된 처리
Consumer
Consumer Consumer
Consumer
Worker
Worker
Worker
Worker
Consumer
Worker
Http방식 topic publish
2ⁿ 병렬처리CloudWatch Event
Call Consumer
Per 30 sec
호환 계층
(G/W)
호환 계층
(G/W)
queue
Queue
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
코웨이 IoCare 아키텍처
호환
계층
관제
Web-Noti
Biz
Batch
OAQ
Big Data
인증
Kinesis
Dynamo
DB
Lambda
API Gateway
IoCare DB
Redis
ERP
외부공기데이터
FOTA S3
SNS push
SQSKinesis
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
성능 병목이 없음…
Lambda 함수 동시 호출
서버에서의 디비 연결의 경우
WAS에서의
”Connection Pooling”을
통해 Connection 수량 조정
Lambda의 Stateless 특성으로 인해
Connection Pooling 불가
“RDBMS” 최대 연결 갯수 초과
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
성능 병목이 없음…
Lambda 함수 동시 호출
서버에서의 디비 연결의 경우
WAS에서의
”Connection Pooling”을
통해 Connection 수량 조정
• NoSQL DB (DynamoDB)의 활용
• Lambda 함수 최적화
• 큐 (Kinesis, SQS)의 활용
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
NoSQL DB (DynamoDB)의 경험
파티션
1 .. N
테이블
• 파티션의 고른 분배를 위해 높은 성능 보장을
위하여 Cardinality 가 높은 Partition Key 활용
• 어플리케이션의 조회성 데이터 요구 사항 수용을
위해 Global Secondary Index (GSI) 활용
“GSI의 Cardinality가
낮다면?”
“Attribute 및 Code성
데이터 조합”
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Lambda 함수에 대한 경험
• 람다 함수 Cold Start 성능 80% 개선 (코웨이 성능 측정 결과)
• 자바 기반 함수 1: 평균 Cold Start 1.5초에서 0.21초로 개선 (Node.js 0.12초)
• 자바 기반 함수 2: 평균 Cold Start 1.0초에서 0.19초로 개선 (Node.js 0.13초)
• 커넥션 재사용을 위해 외부 인터페이스
(예: DB등)는 Handler Faction 외부에 선언
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
큐 (Kinesis, SQS)의 활용
큐 선택의 원칙
SQS Kinesis
N:1 형태의 메세지 처리1:1 형태의 메세지 처리
• 파티션 키 기반 메세지 순차 적제
(디바이스별 발생 메세지 순차 발송 가능)
• 단일 샤드에 대한 다수의 컨슈머 활용
(외부 데이터 연계에도 활용)
• KCL를 통한 손쉬운 개발
(Check Point, 병렬화, 고 가용성 지원)
Kinesis
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
큐 (Kinesis)와 Serverless
Kinesis
Kinesis
• 예외 처리 및 디버깅용 데이터의 수집
- Kinesis 의 특성
• 배치 사이즈
• Latency 및 Polling Interval
• Payload 사이즈
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AWS IoT 정책(policy)
Effect
• Allow 또는 Deny
Action
• "iot:Publish" - MQTT publish
• "iot:Subscribe" - MQTT subscribe
• "iot:UpdateThingShadow" – 섀도(shadow) 수정
• "iot:GetThingShadow" - 섀도(shadow) 조회
• "iot:DeleteThingShadow - 섀도(shadow) 삭제
Resource
• Client, Topic ARN 또는 topic filter ARN
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
사물의 인증과 식별
• 디바이스의 식별: clientId
• 디바이스의 인증: SigV4 또는 인증서
+
인증서 정책
인증 및 통신 암호화 (TLS 기반)
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [ "iot:*"],
"Resource": ["*"]
}]
}
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AWS IoT 정책(policy)
arn:aws:service:region:account:resourceARN (Amazon Resource Name):
ClientId가 clientid1인 디바이스의 ARN : "arn:aws:iot:us-east-1:123456789012:client/clientid1"
정책 변수의 활용 ${iot:ClientId}
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AWS IoT 룰 엔진
SELECT DATA FROM TOPIC WHERE FILTER
• 친숙함! : 데이타베이스 테이블 조회와 유사 (SUB SELECT 가능)
• MQTT 토픽을 데이타 소스로 적용
• 시그널 처리를 위한 기능들 : 노이즈 제거
- String 변환 (정규식 지원)
- 수학 연산
- 케이스 문
- 인코딩, 해쉬, 암호화
- UUID, Timestamp, rand, 등
• 조회 후 연속적인 action 수행
SELECT *
FROM ‘things/thing-2/color’
WHERE color = ‘red’
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
룰 생성
Clientid(), Topic()
주요 함수
get_thing_shadow(thingName, roleARN)
aws_lambda(functionArn, inputJson)
SELECT * FROM 'a/b'
WHERE
get_thing_shadow("MyThing","arn:aws:iam::123456789012:role/AllowsThingShadowAc
cess") .state.reported.alarm = 'ON'
SELECT
aws_lambda("arn:aws:lambda:us-east-1:account_id:function:lambda_function",
payload.inner.element).some.value as output
FROM 'a/b'
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Native MQTT와의 차이
• Persistence Session
• Retain Flag
• MQTT QoS 2
디바이스 쉐도우
라이프사이클 이벤트 토픽
• 연결 및 연결 해제
• 구독 및 구독 취소 이벤트
SDK를 기반한 빠른 개발
IoT Policy
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
프로덕션 전환을 앞두고
• Client ID 별 초당 연결 요청 : 1
• 연결 당 Publish : 100/sec
• 연결 당 Subscription : 50/sec
• 연결 당 최대 처리량 : 512KiB/sec
• …
• 계정 당 허용되는 연결 요청 : 500/sec
• 계정 당 총 연결 가능한 클라이언 수량 : 500,000
• 계정 당 Inbound Publish : 10,000/sec
• 계정 당 Outbound Publish : 20,000/sec
• 계정 당 Subscription : 500/sec
디바이스 및 연결 기준 제한 계정 (Account) 제한
“용량 증설 요청”
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
경험…
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AWS Summit 모바일 앱과 QR코드를 통
해 강연 평가 및 설문 조사에 참여해 주
시기 바랍니다.
내년 Summit을 만들 여러분의 소중한 의
견 부탁 드립니다.
#AWSSummit 해시태그로 소셜 미디어에 여러분의 행사 소
감을 올려주세요.
발표 자료 및 녹화 동영상은 AWS Korea 공식 소셜 채널로
공유될 예정입니다.
여러분의 피드백을 기다립니다!
감사합니다

More Related Content

What's hot (20)

PDF
판교 개발자 데이 – Aws가 제안하는 서버리스 아키텍처 – 김필중
Amazon Web Services Korea
 
PDF
DMS와 SCT를 활용한 Oracle에서 Open Source DB로의 전환
Amazon Web Services Korea
 
PDF
Aws glue를 통한 손쉬운 데이터 전처리 작업하기
Amazon Web Services Korea
 
PDF
20190402 AWS Black Belt Online Seminar Let's Dive Deep into AWS Lambda Part1 ...
Amazon Web Services Japan
 
PDF
[AWSマイスターシリーズ] AWS CloudFormation
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2017 AWS Storage Gateway
Amazon Web Services Japan
 
PDF
마이크로서비스 기반 클라우드 아키텍처 구성 모범 사례 - 윤석찬 (AWS 테크에반젤리스트)
Amazon Web Services Korea
 
PDF
롯데이커머스의 마이크로 서비스 아키텍처 진화와 비용 관점의 운영 노하우-나현길, 롯데이커머스 클라우드플랫폼 팀장::AWS 마이그레이션 A ...
Amazon Web Services Korea
 
PDF
AWS Summit Seoul 2023 | 삼성전자/쿠팡의 대규모 트래픽 처리를 위한 클라우드 네이티브 데이터베이스 활용
Amazon Web Services Korea
 
PDF
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
Amazon Web Services Japan
 
PDF
LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, L...
Amazon Web Services Korea
 
PDF
Cloud Migration 과 Modernization 을 위한 30가지 아이디어-박기흥, AWS Migrations Specialist...
Amazon Web Services Korea
 
PDF
워크로드 특성에 따른 안전하고 효율적인 Data Lake 운영 방안
Amazon Web Services Korea
 
PDF
AWS KMS 에서 제공하는 봉투암호화 방식의 암호화 및 사이닝 기능에 대한 소개와 실습 - 신은수, AWS 솔루션즈 아키텍트 :: AWS...
Amazon Web Services Korea
 
PDF
20200812 AWS Black Belt Online Seminar Amazon Macie
Amazon Web Services Japan
 
PDF
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
Amazon Web Services Korea
 
PDF
AWS Fargate on EKS 실전 사용하기
AWSKRUG - AWS한국사용자모임
 
PDF
Amazon SageMaker 모델 학습 방법 소개::최영준, 솔루션즈 아키텍트 AI/ML 엑스퍼트, AWS::AWS AIML 스페셜 웨비나
Amazon Web Services Korea
 
PDF
AWS DevOps와 ECR을 통한 Elastic Beanstalk 배포 환경 구축 및 타 환경과의 비교
ssuserd4f9ff
 
PDF
Oracle DB를 AWS로 이관하는 방법들 - 서호석 클라우드 사업부/컨설팅팀 이사, 영우디지탈 :: AWS Summit Seoul 2021
Amazon Web Services Korea
 
판교 개발자 데이 – Aws가 제안하는 서버리스 아키텍처 – 김필중
Amazon Web Services Korea
 
DMS와 SCT를 활용한 Oracle에서 Open Source DB로의 전환
Amazon Web Services Korea
 
Aws glue를 통한 손쉬운 데이터 전처리 작업하기
Amazon Web Services Korea
 
20190402 AWS Black Belt Online Seminar Let's Dive Deep into AWS Lambda Part1 ...
Amazon Web Services Japan
 
[AWSマイスターシリーズ] AWS CloudFormation
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 AWS Storage Gateway
Amazon Web Services Japan
 
마이크로서비스 기반 클라우드 아키텍처 구성 모범 사례 - 윤석찬 (AWS 테크에반젤리스트)
Amazon Web Services Korea
 
롯데이커머스의 마이크로 서비스 아키텍처 진화와 비용 관점의 운영 노하우-나현길, 롯데이커머스 클라우드플랫폼 팀장::AWS 마이그레이션 A ...
Amazon Web Services Korea
 
AWS Summit Seoul 2023 | 삼성전자/쿠팡의 대규모 트래픽 처리를 위한 클라우드 네이티브 데이터베이스 활용
Amazon Web Services Korea
 
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
Amazon Web Services Japan
 
LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, L...
Amazon Web Services Korea
 
Cloud Migration 과 Modernization 을 위한 30가지 아이디어-박기흥, AWS Migrations Specialist...
Amazon Web Services Korea
 
워크로드 특성에 따른 안전하고 효율적인 Data Lake 운영 방안
Amazon Web Services Korea
 
AWS KMS 에서 제공하는 봉투암호화 방식의 암호화 및 사이닝 기능에 대한 소개와 실습 - 신은수, AWS 솔루션즈 아키텍트 :: AWS...
Amazon Web Services Korea
 
20200812 AWS Black Belt Online Seminar Amazon Macie
Amazon Web Services Japan
 
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
Amazon Web Services Korea
 
AWS Fargate on EKS 실전 사용하기
AWSKRUG - AWS한국사용자모임
 
Amazon SageMaker 모델 학습 방법 소개::최영준, 솔루션즈 아키텍트 AI/ML 엑스퍼트, AWS::AWS AIML 스페셜 웨비나
Amazon Web Services Korea
 
AWS DevOps와 ECR을 통한 Elastic Beanstalk 배포 환경 구축 및 타 환경과의 비교
ssuserd4f9ff
 
Oracle DB를 AWS로 이관하는 방법들 - 서호석 클라우드 사업부/컨설팅팀 이사, 영우디지탈 :: AWS Summit Seoul 2021
Amazon Web Services Korea
 

Similar to 실전 프로젝트로 이야기하는 AWS IoT::김민성::AWS Summit Seoul 2018 (20)

PDF
실전 프로젝트로 이야기하는 AWS IoT::김민성::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
AWS Greengrass, Lambda and ML Inference at the Edge site (김민성, AWS 솔루션즈 아키텍트)...
Amazon Web Services Korea
 
PDF
대규모 디바이스 구성 및 운영을 위한 AWS IoT 서비스::박경표::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
클라우드로 데이터 센터 확장하기 : 하이브리드 환경을 위한 연결 옵션 및 고려사항::강동환::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
AWS 클라우드 네트워크 서비스 알아보기::서지혜::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
Java 엔터프라이즈 어플리케이션을 효과적으로 마이크로서비스로 전환하기 (박선용, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
Amazon Web Services Korea
 
PDF
Amazon Neptune- 신규 그래프 데이터베이스 서비스 활용::김상필, 강정희::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
Amazon DynamoDB 기반 글로벌 서비스 개발 방법 및 사례::김준형::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
AWS 클라우드 네트워크 서비스 알아보기::서지혜::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
제조업의 IoT 고객 사례::김준형:: AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
제조업의 IoT 고객 사례::김준형, 노형주::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
AWS와 함께 하는 클라우드 컴퓨팅 - 홍민우 AWS 매니저
Amazon Web Services Korea
 
PDF
AWS를 활용한 다양한 DB 마이그레이션 및 게임 엔진 서버 구축 방법::맹상영 대표, 엔클라우드24::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
천만 사용자를 위한 AWS 클라우드 아키텍처 진화하기::이창수::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
스마트 팩토리: AWS 사물인터넷과 인공지능을 활용한 스마트 팩토리 구축 – 최영준 AWS 솔루션즈 아키텍트, 정현아 AWS 솔루션즈 아키...
Amazon Web Services Korea
 
PDF
판교 개발자 데이 – 쉽고 안전한 Aws IoT 플랫폼 활용하기 – 이창수
Amazon Web Services Korea
 
PDF
하이브리드 클라우드 구성을 위한 AWS Direct Connect 200% 활용법::남시우 매니저 KINX::AWS Summit Seoul...
Amazon Web Services Korea
 
PDF
[AWS Dev Day] 앱 현대화 | 실시간 데이터 처리를 위한 현대적 애플리케이션 개발 방법 - 김영진 AWS 솔루션즈 아키텍트, 이세...
Amazon Web Services Korea
 
PDF
성공적인 디지털 혁신을 위한 AWS 데이터베이스 서비스 선택:: 구태훈::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PPTX
[AWS Summit 2018] 모바일 게임을 만들기 위한 AWS 고군분투기
용호 최
 
실전 프로젝트로 이야기하는 AWS IoT::김민성::AWS Summit Seoul 2018
Amazon Web Services Korea
 
AWS Greengrass, Lambda and ML Inference at the Edge site (김민성, AWS 솔루션즈 아키텍트)...
Amazon Web Services Korea
 
대규모 디바이스 구성 및 운영을 위한 AWS IoT 서비스::박경표::AWS Summit Seoul 2018
Amazon Web Services Korea
 
클라우드로 데이터 센터 확장하기 : 하이브리드 환경을 위한 연결 옵션 및 고려사항::강동환::AWS Summit Seoul 2018
Amazon Web Services Korea
 
AWS 클라우드 네트워크 서비스 알아보기::서지혜::AWS Summit Seoul 2018
Amazon Web Services Korea
 
Java 엔터프라이즈 어플리케이션을 효과적으로 마이크로서비스로 전환하기 (박선용, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
Amazon Web Services Korea
 
Amazon Neptune- 신규 그래프 데이터베이스 서비스 활용::김상필, 강정희::AWS Summit Seoul 2018
Amazon Web Services Korea
 
Amazon DynamoDB 기반 글로벌 서비스 개발 방법 및 사례::김준형::AWS Summit Seoul 2018
Amazon Web Services Korea
 
AWS 클라우드 네트워크 서비스 알아보기::서지혜::AWS Summit Seoul 2018
Amazon Web Services Korea
 
제조업의 IoT 고객 사례::김준형:: AWS Summit Seoul 2018
Amazon Web Services Korea
 
제조업의 IoT 고객 사례::김준형, 노형주::AWS Summit Seoul 2018
Amazon Web Services Korea
 
AWS와 함께 하는 클라우드 컴퓨팅 - 홍민우 AWS 매니저
Amazon Web Services Korea
 
AWS를 활용한 다양한 DB 마이그레이션 및 게임 엔진 서버 구축 방법::맹상영 대표, 엔클라우드24::AWS Summit Seoul 2018
Amazon Web Services Korea
 
천만 사용자를 위한 AWS 클라우드 아키텍처 진화하기::이창수::AWS Summit Seoul 2018
Amazon Web Services Korea
 
스마트 팩토리: AWS 사물인터넷과 인공지능을 활용한 스마트 팩토리 구축 – 최영준 AWS 솔루션즈 아키텍트, 정현아 AWS 솔루션즈 아키...
Amazon Web Services Korea
 
판교 개발자 데이 – 쉽고 안전한 Aws IoT 플랫폼 활용하기 – 이창수
Amazon Web Services Korea
 
하이브리드 클라우드 구성을 위한 AWS Direct Connect 200% 활용법::남시우 매니저 KINX::AWS Summit Seoul...
Amazon Web Services Korea
 
[AWS Dev Day] 앱 현대화 | 실시간 데이터 처리를 위한 현대적 애플리케이션 개발 방법 - 김영진 AWS 솔루션즈 아키텍트, 이세...
Amazon Web Services Korea
 
성공적인 디지털 혁신을 위한 AWS 데이터베이스 서비스 선택:: 구태훈::AWS Summit Seoul 2018
Amazon Web Services Korea
 
[AWS Summit 2018] 모바일 게임을 만들기 위한 AWS 고군분투기
용호 최
 
Ad

More from Amazon Web Services Korea (20)

PDF
[D3T1S01] Gen AI를 위한 Amazon Aurora 활용 사례 방법
Amazon Web Services Korea
 
PDF
[D3T1S06] Neptune Analytics with Vector Similarity Search
Amazon Web Services Korea
 
PDF
[D3T1S03] Amazon DynamoDB design puzzlers
Amazon Web Services Korea
 
PDF
[D3T1S04] Aurora PostgreSQL performance monitoring and troubleshooting by use...
Amazon Web Services Korea
 
PDF
[D3T1S07] AWS S3 - 클라우드 환경에서 데이터베이스 보호하기
Amazon Web Services Korea
 
PDF
[D3T1S05] Aurora 혼합 구성 아키텍처를 사용하여 예상치 못한 트래픽 급증 대응하기
Amazon Web Services Korea
 
PDF
[D3T1S02] Aurora Limitless Database Introduction
Amazon Web Services Korea
 
PDF
[D3T2S01] Amazon Aurora MySQL 메이저 버전 업그레이드 및 Amazon B/G Deployments 실습
Amazon Web Services Korea
 
PDF
[D3T2S03] Data&AI Roadshow 2024 - Amazon DocumentDB 실습
Amazon Web Services Korea
 
PDF
AWS Modern Infra with Storage Roadshow 2023 - Day 2
Amazon Web Services Korea
 
PDF
AWS Modern Infra with Storage Roadshow 2023 - Day 1
Amazon Web Services Korea
 
PDF
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
Amazon Web Services Korea
 
PDF
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon Web Services Korea
 
PDF
Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...
Amazon Web Services Korea
 
PDF
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Amazon Web Services Korea
 
PDF
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
Amazon Web Services Korea
 
PDF
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Amazon Web Services Korea
 
PDF
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon Web Services Korea
 
PDF
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon Web Services Korea
 
PDF
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
Amazon Web Services Korea
 
[D3T1S01] Gen AI를 위한 Amazon Aurora 활용 사례 방법
Amazon Web Services Korea
 
[D3T1S06] Neptune Analytics with Vector Similarity Search
Amazon Web Services Korea
 
[D3T1S03] Amazon DynamoDB design puzzlers
Amazon Web Services Korea
 
[D3T1S04] Aurora PostgreSQL performance monitoring and troubleshooting by use...
Amazon Web Services Korea
 
[D3T1S07] AWS S3 - 클라우드 환경에서 데이터베이스 보호하기
Amazon Web Services Korea
 
[D3T1S05] Aurora 혼합 구성 아키텍처를 사용하여 예상치 못한 트래픽 급증 대응하기
Amazon Web Services Korea
 
[D3T1S02] Aurora Limitless Database Introduction
Amazon Web Services Korea
 
[D3T2S01] Amazon Aurora MySQL 메이저 버전 업그레이드 및 Amazon B/G Deployments 실습
Amazon Web Services Korea
 
[D3T2S03] Data&AI Roadshow 2024 - Amazon DocumentDB 실습
Amazon Web Services Korea
 
AWS Modern Infra with Storage Roadshow 2023 - Day 2
Amazon Web Services Korea
 
AWS Modern Infra with Storage Roadshow 2023 - Day 1
Amazon Web Services Korea
 
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
Amazon Web Services Korea
 
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon Web Services Korea
 
Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...
Amazon Web Services Korea
 
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Amazon Web Services Korea
 
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
Amazon Web Services Korea
 
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Amazon Web Services Korea
 
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon Web Services Korea
 
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon Web Services Korea
 
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
Amazon Web Services Korea
 
Ad

실전 프로젝트로 이야기하는 AWS IoT::김민성::AWS Summit Seoul 2018

  • 1. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. IOT 실전 프로젝트로 이야기하는 AWS IoT 이창화 수석 / IOT 개발팀 / Coway 김민성 Solutions Architect / Amazon Web Services
  • 2. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 실전 프로젝트로 깨달은 경험들 • MQTT, 디바이스 쉐도우 • 코웨이의 경험 • IoT 정책 및 룰엔진
  • 3. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 일반적인 IoT 시스템 구성 Database 급격히 증가하는 관리 부담 Thing (Entity) History Control Monitor 성능 병목 or Message Queue MQTT adapter
  • 4. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS IoT Core IoT 서비스 구현에 필요한 요소들 • 메시지 브로커 • 룰 엔진 • 디바이스 쉐도우 • 디바이스 등록 관리형 서비스 • 설치 불필요 • 자동 확장 • 사전 프로비저닝 불필요 • 가용역영에 걸친 이중화 • 사용량에 기반한 과금
  • 5. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 디바이스와 AWS IoT와의 통신 지원하는 프로토콜 : MQTT, HTTP, MQTT over WebSocket SUB: robotics/status/r27 { “status”: “green” } PUB: robotics/status/r27 “Alert Status Green” MQTT - MQTT는 경량의 Publish/Subscribe(Pub/Sub) 메시징 프로토콜 - M2M(machine-to-machine)와 IoT(Internet of things) IoT를 위해서 낮은 전력, 낮은 대역폭 환경에서도 사용 Client ID : r27 Client ID : Monitor-Robotics 토픽 : “robotics/status/r27”
  • 6. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 토픽 (Topic) 토픽이란? Publishing Clients와 Subscribing Client간의 메세지를 주고 받는 메세지 통로 • 토픽의 명명 단위는 어플리케이션를 반영 • (/)를 이용해 토픽 계층 구조 표현 • (#)또는 (+)를 토픽 필터로 활용 • 예약된 토픽은 ($)로 시작 AWS IoT PUBLISH sensors/123 PUBLISH sensors/456 PUBLISH sensors/789
  • 7. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 토픽 (Topic) 필터 PUB: robotics/building1234/rt5678 PUB: robotics/building1234/rt1234 SUB: robotics/building1234/# {“status”: “green” } { “status”: “red” } { “status”: “green” } { “status”: “red” } 토픽 필터 설명 # • 현재 트리 및 모든 하위 트리를 일치시키는 와일드카드로 활용 • 구독 중인 토픽의 마지막 문자여야함 • Sensor/#을 구독할 경우 Sensor/의 모든 메세지 구독 (예: Sensor/temp, Sensor/temp/room1) + • 토픽 계층 표현시 간소화를 위하여 활용 • Sensor/+/room1을 구독할 경우 Sensor/temp/room1, Sensor/moisture/room1 등에 게시된 메시지를 수신
  • 8. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 토픽 (Topic) 디자인 • 상위 Namespace 및 그룹 정보의 반영 • 어플리케이션 정보, 그룹 정보와 같은 맥략 정보 • 커뮤니케이션에 대한 주요 정보 반영 • thingName, clinedId, uuid 정보 • 데이터 토픽과 커멘드 토픽의 분리 Structure: dt/<namespace>/<group-id>/<thing-name>/<data-type> Structure: cmd/<namespace>/<group-id>/<thing-name>/req-type 데이터 토픽 커멘드 토픽
  • 9. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 커멘드 토픽의 구현 컨트롤 로직 PUBLISH cmd/namespace/groupid/robot-123 { "Pmode": "on" } 직접 Publishing 인터넷 • 메세지의 순서의 변화 • Thing의 커넥션 상태 또는 On/Off 여부 “기존 MQTT 만으로는 충분하지 않습니다.” Shadow State Apps offline 디바이스 쉐도우
  • 10. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 디바이스 쉐도우와 Document { "state" : { "desired" : { "lights": { "color": "RED" }, "engine" : "ON" }, "reported" : { "lights" : { "color": "GREEN" }, "engine" : "ON" }, "delta" : { "lights" : { "color": "RED" } } }, "version" : 10 } • Desired: 사용자가 원하는 상태 • Reported: Thing 보고한 현재 상태 • Delta: Desired와 Reported가 서로 다른 상태 “Document”
  • 11. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 클라이언트에서는? (JS 예시) 디바이스 쉐도우 공기 청정기 (Air Purifier) - airPurifierIsOn : true / false 변경이 있을때마다 상태 보고 해야함 Delta: Desired 와 Reported 가 상의함 공기 청정기의 현재 상태를 Desired의 값으로 변경
  • 12. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 디바이스 쉐도우 토픽 활용 디바이스 쉐도우의 Update 토픽 $aws/things/AirpurifierBig001/shadow/update 원하는 컨트롤을 등록한 후 Publish “desired” : { “airPurifierIsOn”: false }
  • 13. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 디바이스 쉐도우의 주요 토픽 UPDATE: $aws/things/{thingName}/shadow/update GET: $aws/things/{thingName}/shadow/get DELETE: $aws/things/{thingName}/shadow/delete DELTA: $aws/things/{thingName}/shadow/update/delta DOCUMENTS: $aws/things/{thingName}/shadow/update/documents
  • 14. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 디바이스 쉐도우와 버전 공기 청정기 컨트롤 로직 on (version=1) off (version=2)off (version=2) on (version=1) 이전 버전의 업데이트 요청은 409 에러와 함께 거부됨 이전 버전의 업데이트 요청을 무시 할 수 있음
  • 15. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 디바이스 쉐도우와 버전 Coway에서는 기존 제품의 프로토콜 지원을 위하여 “호환 계층” 을 가지고 있습니다. 호환 계층 1. Delta 발생 (Desired 와 Reported의 차이) 2. Thing에 상태 정보 변경 요청 3. Thing의 상태 정보 변경 완료 4. Desired와 Reported 일치 호환 계층에서 디바이스 쉐도우 업데이트 • Document 삭제 • NULL 처리 • Desired state • 특정 attribute
  • 16. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Coway “wellness appliance” Water Care, Air Care, Body Care, Sleep Care, Living Care 삶의 질을 향상 시키는 기업 2017년 기준 2조 3천억 아시아 최대 Wellness appliance
  • 17. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Coway IOCare
  • 18. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Coway Airmega
  • 19. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS IoT 아마존 aws 마이그레이션 IoT topic IoT shadow IoT policy Alexa smart home skill Alexa voice service EchoAlexa skill Lambda function AWS cloud AWS Manageme nt Console virtual private cloud Auto Scaling Amazon EC2 Amazon S3 Amazon RDS Amazon DynamoDB AmazonKinesis Streams
  • 20. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 호환 계층으로 인한 경험 • MQTT 프로토콜의 In-Flight 메세지 제한(Thing Shadow) 수량이 커넥션을 기준으로 하고 있었음 (10 In-Flight 메시지/Second/커넥션) • 단일 호환 계층 서버 (EC)는 약 10000대의 디바이스를 수용 • 위의 제약 요건으로 인해 활용 가능한 초당 In-Flight 메시지는 약 10~20개로 제한 (실제로는 30,000개 정도가 필요) 호환 계층 (G/W) 실 디바이스 Thing Shadow 호환 계층의 리소스 절약 및 안정적인 연결 유지를 위하여 Backend (IoT)와는 1~2개의 커넥션을 맺고 상시 연결상태 유지 ※ EC G/W (External Connector Gateway)
  • 21. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 어떻게 해결 했는가? 1~2 커넥션 Republish $shadow update topic 호환 계층 (G/W) AWS IoT IoT rule IoT topic IoT shadow
  • 22. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 대량 제어 요청 Bulk 컨트롤 시그널 (예: 환기 요청) 10ms내에 30,000개의 요청 Bulk 컨트롤 시그널 (예: 환기 알림) 큐를 활용한 지연된 처리 Consumer Consumer Consumer Consumer Worker Worker Worker Worker Consumer Worker Http방식 topic publish 2ⁿ 병렬처리CloudWatch Event Call Consumer Per 30 sec 호환 계층 (G/W) 호환 계층 (G/W) queue Queue
  • 23. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
  • 24. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 코웨이 IoCare 아키텍처 호환 계층 관제 Web-Noti Biz Batch OAQ Big Data 인증 Kinesis Dynamo DB Lambda API Gateway IoCare DB Redis ERP 외부공기데이터 FOTA S3 SNS push SQSKinesis
  • 25. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 성능 병목이 없음… Lambda 함수 동시 호출 서버에서의 디비 연결의 경우 WAS에서의 ”Connection Pooling”을 통해 Connection 수량 조정 Lambda의 Stateless 특성으로 인해 Connection Pooling 불가 “RDBMS” 최대 연결 갯수 초과
  • 26. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 성능 병목이 없음… Lambda 함수 동시 호출 서버에서의 디비 연결의 경우 WAS에서의 ”Connection Pooling”을 통해 Connection 수량 조정 • NoSQL DB (DynamoDB)의 활용 • Lambda 함수 최적화 • 큐 (Kinesis, SQS)의 활용
  • 27. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. NoSQL DB (DynamoDB)의 경험 파티션 1 .. N 테이블 • 파티션의 고른 분배를 위해 높은 성능 보장을 위하여 Cardinality 가 높은 Partition Key 활용 • 어플리케이션의 조회성 데이터 요구 사항 수용을 위해 Global Secondary Index (GSI) 활용 “GSI의 Cardinality가 낮다면?” “Attribute 및 Code성 데이터 조합”
  • 28. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Lambda 함수에 대한 경험 • 람다 함수 Cold Start 성능 80% 개선 (코웨이 성능 측정 결과) • 자바 기반 함수 1: 평균 Cold Start 1.5초에서 0.21초로 개선 (Node.js 0.12초) • 자바 기반 함수 2: 평균 Cold Start 1.0초에서 0.19초로 개선 (Node.js 0.13초) • 커넥션 재사용을 위해 외부 인터페이스 (예: DB등)는 Handler Faction 외부에 선언
  • 29. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 큐 (Kinesis, SQS)의 활용 큐 선택의 원칙 SQS Kinesis N:1 형태의 메세지 처리1:1 형태의 메세지 처리 • 파티션 키 기반 메세지 순차 적제 (디바이스별 발생 메세지 순차 발송 가능) • 단일 샤드에 대한 다수의 컨슈머 활용 (외부 데이터 연계에도 활용) • KCL를 통한 손쉬운 개발 (Check Point, 병렬화, 고 가용성 지원) Kinesis
  • 30. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 큐 (Kinesis)와 Serverless Kinesis Kinesis • 예외 처리 및 디버깅용 데이터의 수집 - Kinesis 의 특성 • 배치 사이즈 • Latency 및 Polling Interval • Payload 사이즈
  • 31. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS IoT 정책(policy) Effect • Allow 또는 Deny Action • "iot:Publish" - MQTT publish • "iot:Subscribe" - MQTT subscribe • "iot:UpdateThingShadow" – 섀도(shadow) 수정 • "iot:GetThingShadow" - 섀도(shadow) 조회 • "iot:DeleteThingShadow - 섀도(shadow) 삭제 Resource • Client, Topic ARN 또는 topic filter ARN
  • 32. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 사물의 인증과 식별 • 디바이스의 식별: clientId • 디바이스의 인증: SigV4 또는 인증서 + 인증서 정책 인증 및 통신 암호화 (TLS 기반) { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ "iot:*"], "Resource": ["*"] }] }
  • 33. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS IoT 정책(policy) arn:aws:service:region:account:resourceARN (Amazon Resource Name): ClientId가 clientid1인 디바이스의 ARN : "arn:aws:iot:us-east-1:123456789012:client/clientid1" 정책 변수의 활용 ${iot:ClientId}
  • 34. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS IoT 룰 엔진 SELECT DATA FROM TOPIC WHERE FILTER • 친숙함! : 데이타베이스 테이블 조회와 유사 (SUB SELECT 가능) • MQTT 토픽을 데이타 소스로 적용 • 시그널 처리를 위한 기능들 : 노이즈 제거 - String 변환 (정규식 지원) - 수학 연산 - 케이스 문 - 인코딩, 해쉬, 암호화 - UUID, Timestamp, rand, 등 • 조회 후 연속적인 action 수행 SELECT * FROM ‘things/thing-2/color’ WHERE color = ‘red’
  • 35. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 룰 생성 Clientid(), Topic() 주요 함수 get_thing_shadow(thingName, roleARN) aws_lambda(functionArn, inputJson) SELECT * FROM 'a/b' WHERE get_thing_shadow("MyThing","arn:aws:iam::123456789012:role/AllowsThingShadowAc cess") .state.reported.alarm = 'ON' SELECT aws_lambda("arn:aws:lambda:us-east-1:account_id:function:lambda_function", payload.inner.element).some.value as output FROM 'a/b'
  • 36. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Native MQTT와의 차이 • Persistence Session • Retain Flag • MQTT QoS 2 디바이스 쉐도우 라이프사이클 이벤트 토픽 • 연결 및 연결 해제 • 구독 및 구독 취소 이벤트 SDK를 기반한 빠른 개발 IoT Policy
  • 37. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 프로덕션 전환을 앞두고 • Client ID 별 초당 연결 요청 : 1 • 연결 당 Publish : 100/sec • 연결 당 Subscription : 50/sec • 연결 당 최대 처리량 : 512KiB/sec • … • 계정 당 허용되는 연결 요청 : 500/sec • 계정 당 총 연결 가능한 클라이언 수량 : 500,000 • 계정 당 Inbound Publish : 10,000/sec • 계정 당 Outbound Publish : 20,000/sec • 계정 당 Subscription : 500/sec 디바이스 및 연결 기준 제한 계정 (Account) 제한 “용량 증설 요청”
  • 38. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. 경험…
  • 39. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AWS Summit 모바일 앱과 QR코드를 통 해 강연 평가 및 설문 조사에 참여해 주 시기 바랍니다. 내년 Summit을 만들 여러분의 소중한 의 견 부탁 드립니다. #AWSSummit 해시태그로 소셜 미디어에 여러분의 행사 소 감을 올려주세요. 발표 자료 및 녹화 동영상은 AWS Korea 공식 소셜 채널로 공유될 예정입니다. 여러분의 피드백을 기다립니다!