© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
갤럭시 규모의 인공지능 서비스를 위한
AWS 데이터베이스 아키텍처
김상필
솔루션즈 아키텍트 매니저
AWS Korea
이혁
Database Engineer
Samsung Electronics
김정환
Global Service Reliability Engineer
Samsung Electronics
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
발표자료 바로 공개
발표자료는 발표 종료 후 해당
사이트에서 바로 보실 수 있습
니다
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What are modern applications?
AWS Database service options
Case study: Samsung Bixby 2.0
Case study: Bixby Database architecture
Agenda
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Characteristics of modern applications
Internet-scale and transactional
Users: 1M+
Data volume: TB–PB–EB
Locality: Global
Performance: Milliseconds–microseconds
Request Rate: Millions
Access: Mobile, IoT, devices
Scale: Up-out-in
Economics: Pay-as-you-go
Developer access: Instant API accessSocial mediaRide hailing Media streaming Dating
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Modern applications require internet-scale performance
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Data categories and common use cases
Relational Key value Document In-memory Graph
Referential
integrity, ACID
transactions,
schema-
on-write
Low-latency,
key lookups
with high
throughput and
fast ingestion
of data
Indexing and
storing
documents
with support
for query on
any attribute
Microseconds
latency, key-
based queries,
and specialized
data structures
Creating and
navigating
data relations
easily and
quickly
Lift and shift,
EMR, CRM,
finance
Real-time
bidding,
shopping cart,
social
Content
management,
personalization,
mobile
Leaderboards,
real-time
analytics,
caching
Fraud detection,
social
networking,
recommendation
engine
Search
Indexing and
searching
semistructured
logs and data
Product
catalog, help,
and FAQs,
full text
Time series Ledger
Collect, store,
and process
data sequenced
by time
IoT
applications,
event tracking
Complete,
immutable, and
verifiable history
of all changes to
application data
Systems
of record,
supply chain,
healthcare,
registrations,
financial
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
AWS: Purpose-built databases
Relational Key value Document In-memory Graph Search
Amazon
DynamoDB
Amazon
Neptune
Amazon RDS
Aurora CommercialCommunity
Amazon
ElastiCache
Amazon
Elasticsearch
Service
Amazon
DocumentDB
Time series Ledger
Amazon
Timestream
Amazon
Quantum
Ledger
DatabaseMemcachedRedis
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Amazon DynamoDB
Fast and flexible key value database service for any scale
Comprehensive
security
Encrypts all data by
default and fully integrates
with AWS Identity and
Access Management for
robust security
Performance at scale
Consistent, single-digit
millisecond response times at
any scale; build applications with
virtually unlimited throughput
Global database for
global users and apps
Build global applications with
fast access to local data by easily
replicating tables across multiple
AWS Regions
Serverless
No hardware provisioning,
software patching, or
upgrades; scales up or down
automatically; continuously
backs up your data
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Amazon Aurora
MySQL and PostgreSQL compatible relational database built for the cloud
Performance and availability of commercial-grade databases at 1/10th the cost
Availability
and durability
Fault-tolerant, self-healing
storage; six copies of data
across three AZs; continuous
backup to S3
Fully managed
Managed by RDS:
no hardware provisioning,
software patching, setup,
configuration, or backups
Highly secure
Network isolation,
encryption at
rest/transit
Performance
and scalability
5x throughput of standard
MySQL and 3x of standard
PostgreSQL; scale-out up to
15 read replicas
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
When to Use Which Services
Situation Solution
Existing application Use your existing engine on RDS
• MySQL Amazon Aurora, RDS for MySQL
• PostgreSQL Amazon Aurora, RDS for PostgreSQL
• MariaDB Amazon Aurora, RDS for MariaDB
• Oracle Use SCT to determine complexity Aurora, RDS for Oracle
• SQL Server Use SCT to determine complexity Aurora, RDS for SQL Server
New application • If you can avoid relational features DynamoDB
• If you need relational features Amazon Aurora
In-memory store/cache • Amazon ElastiCache
Time series data • Amazon Timestream
Track every application change, crypto verifiable.
Have a central trust authority
• Amazon Quantum Ledger Database (QLDB)
Don’t have a trusted central authority • Amazon Managed Blockchain
Data Warehouse & BI • Amazon Redshift, Amazon Redshift Spectrum, and Amazon QuickSight
Adhoc analysis of data in S3 • Amazon Athena and Amazon QuickSight
Apache Spark, Hadoop, HBase (needle in a
haystack type queries)
• Amazon EMR
Log analytics, operational monitoring, & search • Amazon Elasticsearch Service and Amazon Kinesis
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Architect services ground-up for the cloud
and for the explosion of data
Offer a portfolio of purpose-built
services, optimized for your workloads
Help you innovate faster through
managed services
Our approach
Provide services that help you migrate
existing apps and databases to the cloud
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
김정환(Jay Kim)
Global Service Reliability Engineer
Samsung Electronics
jay-.kim@samsung.com
rpkim.net
linkedin.com/in/rpkimjay
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Introduction video
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Samsung’s A.I. service 2018
Bixby 2.0
2017
Bixby 1.0
NOW
2017 2018
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
2019
Bixby 2.0
AI Interface
AI Developer Platform
Bixby developer center
voice-activated
personal assistant
DEMOCRATIZED AI UNPRECEDENTED
REACH
POWERFUL
PERSONALIZATION
An open artificial
intelligence platform
https://bixbydevelopers.com
https://bixby.developer.samsung.com
Samsung device
ecosystem
Learn user
preferences
Bixby 2.0
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Multi-Locales Service
ko-KR en-GB
en-US
zh-CN
de-DE
It-IT
fr-FR
es-ES
World-wide Service
60 Million Users
Multi-Devices Service
Mobile, Television
and so on
2019
AI Interface
AI Developer Platform
Bixby developer center
voice-activated
personal assistant
https://bixbydevelopers.com
https://bixby.developer.samsung.com
Bixby 2.0
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
True benefits of using
for
2019
AI Interface
AI Developer Platform
Bixby developer center
voice-activated
personal assistant
https://bixbydevelopers.com
https://bixby.developer.samsung.com
Bixby 2.0
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Bixby’s Global-scale footprints with AWS
ap-northeast-2
(Seoul)
cn-north-1
(Beijing)
eu-west-1
(Ireland)
us-east-2
(Ohio)
2019
AI Interface
AI Developer Platform
Bixby developer center
voice-activated
personal assistant
https://bixbydevelopers.com
https://bixby.developer.samsung.com
Bixby Production regions
Bixby 2.0
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Bixby’s Global-scale footprints with AWS
ap-northeast-2
(Seoul)
cn-north-1
(Beijing)
eu-west-1
(Ireland)
us-east-2
(Ohio)
2019
AI Interface
AI Developer Platform
Bixby developer center
voice-activated
personal assistant
https://bixbydevelopers.com
https://bixby.developer.samsung.com
us-west-2
(Oregon)
us-east-1
(N. Virginia)
cn-north-2
(Ningxia)
Bixby 2.0
Bixby Dev/Staging/Production regions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Excellent compatibility with third-party tools
Packer
Spinnaker Ansible
Application
Provisioning
Continuous
Delivery
Monitoring
System
Datadog
Terraform
Infrastructure
creation
DEV
STG
Prod
2019
AI Interface
AI Developer Platform
Bixby developer center
voice-activated
personal assistant
https://bixbydevelopers.com
https://bixby.developer.samsung.com
Bixby using third-party tools
Bixby 2.0
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Excellent compatibility with third-party tools
Terraform
Infrastructure
creation
2019
AI Interface
AI Developer Platform
Bixby developer center
voice-activated
personal assistant
https://bixbydevelopers.com
https://bixby.developer.samsung.com
Bixby using various continuous delivery pipelines
Bixby 2.0
Userdata.sh
$ curl http://169.254.169.254/latest/meta-data/
$ role=ABC # from instance tag
$ ansible-pull –e “role=ABC“ –U git@github.com:ansible.git playbook.yml
Instance Tags
ansible-role ABC
package-version ABC-273a81-v1.5.zip
AnsibleEC2
Ansible
# Add cronjob for ansible-pull
# Getting package-version
# Install & Service Execution
Github
Infrastructure provisioning : creation machine, infrastructure
Application bootstrapping: install & configuration the application
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
2019
AI Interface
AI Developer Platform
Bixby developer center
voice-activated
personal assistant
https://bixbydevelopers.com
https://bixby.developer.samsung.com
Excellent compatibility with third-party tools
Bixby using various AWS services for automation
Bixby 2.0Security Group
Inbound change CloudTrail
Detect!
CloudWatch
Event
RevokeSecurityGroupIngress
AuthorizeSecurityGroupIngress
Lambda Slack
EC2
Block
Bitcoin
mining
B
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
AWS services powering Bixby
Compute
Container Registry Lambda
Elastic Load Balancer Auto Scaling
Elastic Container Service EC2
Database
Aurora
DynamoDB
ElasticCache
RDS
Developer Tools
CodeDeploy CLI
Security, Identity & Compliance
IAM
KMS
Certificate Manager
Storage
EBS
EFS
S3 2019
AI Interface
AI Developer Platform
Bixby developer center
voice-activated
personal assistant
https://bixbydevelopers.com
https://bixby.developer.samsung.com
Bixby 2.0
Management & Governance
CloudWatch CloudTrail
Trusted Advisor
Networking & Content Delivery
CloudFront Route53
VPC API Gateway
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Why run Artificial Intelligence on AWS
2019
AI Interface
AI Developer Platform
Bixby developer center
voice-activated
personal assistant
https://bixbydevelopers.com
https://bixby.developer.samsung.com
Bixby 2.0
GPU
Instances
EFS
File system
Database
services
For ASR For sharing
model data
For personal
language model
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
High Level Diagram
2019
AI Interface
AI Developer Platform
Bixby developer center
voice-activated
personal assistant
https://bixbydevelopers.com
https://bixby.developer.samsung.com
Bixby 2.0
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
PLM
Bixby Platform Overview
PLM
Personal Language Model
2019
AI Interface
AI Developer Platform
Bixby developer center
voice-activated
personal assistant
https://bixbydevelopers.com
https://bixby.developer.samsung.com
Bixby 2.0
ASR NLU TTS
Storage
Services
Users
Database
Services
Automatic Speech Recognition
ASR NLU
Natural Language Understanding
TTS
Text to Speech
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Bixby Database architecture
이혁
Database Engineer
Samsung Electronics
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Launching Bixby
Bixby 1.0 in 2017
Commercial shared file system
Bixby 2.0 in 2018
Database
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Challenges in Bixby 1.0
• Each personal data started getting bigger
• 100MB+ for each device : file loading time
• Many small files
• Hard to work together
• Each team had their own files
• Hard to extract meaningful value
• Operating File System Cluster on AWS
• Disk / Node failure
• inode limitations
• Managing commercial license
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What we needed?
Database
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What we needed?
Blazingly fastPB scalability
No license China region
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How we selected PLM DB?
RDBMS NoSQL
Open source
Aurora
Cloud native Open source
Other cloud
DynamoDB
Cloud native
PB scalability
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
PLM DB PoC scenario
• Requirements
• No global replication
• Database in 1 region + cache in all : network latency
• Same architecture for all regions
• Each region has 1,920+ concurrent users for load
• 300 items per device : 192KB
• Generated test data : 10TB
• Goal
• Get 300 items from DB within 100ms
• Put it into Cache once and get 10x within 10ms
Seoul OhioIreland
DB
API API API
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
PLM DB PoC scenario
• Test schema in DynamoDB
Device id
(PK*)
Seq_num
(SK**)
Last name First name Nick name Full name …
x2019 1 Cho EunAh Frozen Eunah Cho …
x2019 2 Cho BeomSeung Iron man BeomSeung Cho …
x2019 3 Lee Hyuk Groot Hyuk Lee …
…
* PK : Partitioning Key
** SK : Sort Key
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
PLM DB PoC result-1
How we tested?
1. API servers in 3 regions called.
2. DynamoDB in Seoul for 1 hour.
3. DynamoDB returned 300 items(192KB).
4. Logged the query + round trip time.
5. Measured average number.
Why we did this test?
1. Whether the centralized database was
possible or not.
52ms
(Seoul)
1,512ms
(Ireland)
945ms
(Ohio)
Network made differences!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
PLM DB PoC result-2
1,442ms
(Ireland)
2,339ms
(Ohio)
3,063ms
(Seoul)
How we tested?
1. API servers in 3 regions called.
2. DynamoDB in Seoul for 1 hour.
3. DynamoDB returned 300 items(192KB).
4. Put data into ElastiCache Redis.
5. Get data from ElastiCache Redis 10x.
6. Logged the query + round trip time.
7. Measured average number.
Why it took too long
1. DynamoDB worked well
2. ElastiCache Redis latency increased under
high memory utilization and high traffic.
What we learned?
1. Needs to keep some free memory space in
operation for consistent low latency for
Elasticache Redis.
Network + ElastiCache Redis
made differences!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Key design is the key
• Primary key selection for
performance at scale – NoSQL
itself is not a silver bullet
• Understanding for Access
Pattern for simplicity and cost -
We have no secondary index
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
DynamoDB Schema Design for Bixby
Partition1 Partition2 ….. PartitionN Partition1 Partition2 ….. PartitionN
3000 rows
1000 rows
1000 rows
1000 rows
service_iduser_id xxx_iddomain
Partition key Sort key
1000 rows 1000 rows 1000 rows
domainuser_id xxx_idservice_id
Partition key Sort key
* Cardinality for IDs
user_id(1) : service_id(1) : domain(N) : xxx_id(M)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Choosing AWS database options for Bixby
DynamoDB for Personal data
Aurora MySQL : Member & admin
ElastiCache Redis for caching data
EMR for analytics
S3 for object data
EFS for low-latencyRDS MySQL : China
RDS PostgreSQL : Geo functions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Benefits
ElastiCache Redis
• Version : 2.8 - 5.0*
• Cluster-mode*
• Read scale-out with slaves*
Aurora MySQL
• Cloud based architecture : super performance with
low-price
• All instances are supported*
• Read scale-out with up to 15 read replicas
• Up to 5 cross region replication*
• Custom endpoint*
* Supported by AWS
DynamoDB
• Auto Scaling
• 3 Availability Zones
• VPC endpoint : Security
• Consistent performance and low latency at any
scale
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lessons learned
• PoC
• Database and API server have to be in the same place because of network
• Needs to keep some free memory space in operation for consistent low latency for Elasticache Redis
• DynamoDB table design
• Making access pattern simple is the key
• Spreading out traffic across all partitions is important
• Less or no secondary key is better if possible
• vs Bixby 1.0
• Working as one team easily through DB!
• No license and operational cost with DynamoDB and EFS
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
여러분의 피드백을 기다립니다!
#AWSSummit 해시태그로 소셜
미디어에 여러분의 행사소감을
올려주세요.
AWS Summit Seoul 2019 모바
일 앱과 QR코드를 통해 강연평
가 및 설문조사에 참여하시고
재미있는 기념품을 받아가세요
.
내년 Summit을 만들 여러분의
소중한 의견 부탁 드립니다.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
감사합니다!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

갤럭시 규모의 인공지능 서비스를 위한 AWS 데이터베이스 아키텍처 - 김상필 솔루션 아키텍트 매니저, AWS / 김정환 데브옵스 엔지니어, 삼성전자 / 이혁 데이터베이스 운영 엔지니어, 삼성전자 :: AWS Summit Seoul 2019

  • 1.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. 갤럭시 규모의 인공지능 서비스를 위한 AWS 데이터베이스 아키텍처 김상필 솔루션즈 아키텍트 매니저 AWS Korea 이혁 Database Engineer Samsung Electronics 김정환 Global Service Reliability Engineer Samsung Electronics
  • 2.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 발표자료 바로 공개 발표자료는 발표 종료 후 해당 사이트에서 바로 보실 수 있습 니다 © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 3.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. What are modern applications? AWS Database service options Case study: Samsung Bixby 2.0 Case study: Bixby Database architecture Agenda
  • 4.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Characteristics of modern applications Internet-scale and transactional Users: 1M+ Data volume: TB–PB–EB Locality: Global Performance: Milliseconds–microseconds Request Rate: Millions Access: Mobile, IoT, devices Scale: Up-out-in Economics: Pay-as-you-go Developer access: Instant API accessSocial mediaRide hailing Media streaming Dating
  • 5.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Modern applications require internet-scale performance
  • 6.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Data categories and common use cases Relational Key value Document In-memory Graph Referential integrity, ACID transactions, schema- on-write Low-latency, key lookups with high throughput and fast ingestion of data Indexing and storing documents with support for query on any attribute Microseconds latency, key- based queries, and specialized data structures Creating and navigating data relations easily and quickly Lift and shift, EMR, CRM, finance Real-time bidding, shopping cart, social Content management, personalization, mobile Leaderboards, real-time analytics, caching Fraud detection, social networking, recommendation engine Search Indexing and searching semistructured logs and data Product catalog, help, and FAQs, full text Time series Ledger Collect, store, and process data sequenced by time IoT applications, event tracking Complete, immutable, and verifiable history of all changes to application data Systems of record, supply chain, healthcare, registrations, financial
  • 7.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T AWS: Purpose-built databases Relational Key value Document In-memory Graph Search Amazon DynamoDB Amazon Neptune Amazon RDS Aurora CommercialCommunity Amazon ElastiCache Amazon Elasticsearch Service Amazon DocumentDB Time series Ledger Amazon Timestream Amazon Quantum Ledger DatabaseMemcachedRedis
  • 8.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Amazon DynamoDB Fast and flexible key value database service for any scale Comprehensive security Encrypts all data by default and fully integrates with AWS Identity and Access Management for robust security Performance at scale Consistent, single-digit millisecond response times at any scale; build applications with virtually unlimited throughput Global database for global users and apps Build global applications with fast access to local data by easily replicating tables across multiple AWS Regions Serverless No hardware provisioning, software patching, or upgrades; scales up or down automatically; continuously backs up your data
  • 9.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Amazon Aurora MySQL and PostgreSQL compatible relational database built for the cloud Performance and availability of commercial-grade databases at 1/10th the cost Availability and durability Fault-tolerant, self-healing storage; six copies of data across three AZs; continuous backup to S3 Fully managed Managed by RDS: no hardware provisioning, software patching, setup, configuration, or backups Highly secure Network isolation, encryption at rest/transit Performance and scalability 5x throughput of standard MySQL and 3x of standard PostgreSQL; scale-out up to 15 read replicas
  • 10.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T When to Use Which Services Situation Solution Existing application Use your existing engine on RDS • MySQL Amazon Aurora, RDS for MySQL • PostgreSQL Amazon Aurora, RDS for PostgreSQL • MariaDB Amazon Aurora, RDS for MariaDB • Oracle Use SCT to determine complexity Aurora, RDS for Oracle • SQL Server Use SCT to determine complexity Aurora, RDS for SQL Server New application • If you can avoid relational features DynamoDB • If you need relational features Amazon Aurora In-memory store/cache • Amazon ElastiCache Time series data • Amazon Timestream Track every application change, crypto verifiable. Have a central trust authority • Amazon Quantum Ledger Database (QLDB) Don’t have a trusted central authority • Amazon Managed Blockchain Data Warehouse & BI • Amazon Redshift, Amazon Redshift Spectrum, and Amazon QuickSight Adhoc analysis of data in S3 • Amazon Athena and Amazon QuickSight Apache Spark, Hadoop, HBase (needle in a haystack type queries) • Amazon EMR Log analytics, operational monitoring, & search • Amazon Elasticsearch Service and Amazon Kinesis
  • 11.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Architect services ground-up for the cloud and for the explosion of data Offer a portfolio of purpose-built services, optimized for your workloads Help you innovate faster through managed services Our approach Provide services that help you migrate existing apps and databases to the cloud
  • 12.
    S U MM I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. 김정환(Jay Kim) Global Service Reliability Engineer Samsung Electronics jay-.kim@samsung.com rpkim.net linkedin.com/in/rpkimjay
  • 13.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Introduction video
  • 14.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Samsung’s A.I. service 2018 Bixby 2.0 2017 Bixby 1.0 NOW 2017 2018
  • 15.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T 2019 Bixby 2.0 AI Interface AI Developer Platform Bixby developer center voice-activated personal assistant DEMOCRATIZED AI UNPRECEDENTED REACH POWERFUL PERSONALIZATION An open artificial intelligence platform https://bixbydevelopers.com https://bixby.developer.samsung.com Samsung device ecosystem Learn user preferences Bixby 2.0
  • 16.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Multi-Locales Service ko-KR en-GB en-US zh-CN de-DE It-IT fr-FR es-ES World-wide Service 60 Million Users Multi-Devices Service Mobile, Television and so on 2019 AI Interface AI Developer Platform Bixby developer center voice-activated personal assistant https://bixbydevelopers.com https://bixby.developer.samsung.com Bixby 2.0
  • 17.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T True benefits of using for 2019 AI Interface AI Developer Platform Bixby developer center voice-activated personal assistant https://bixbydevelopers.com https://bixby.developer.samsung.com Bixby 2.0
  • 18.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Bixby’s Global-scale footprints with AWS ap-northeast-2 (Seoul) cn-north-1 (Beijing) eu-west-1 (Ireland) us-east-2 (Ohio) 2019 AI Interface AI Developer Platform Bixby developer center voice-activated personal assistant https://bixbydevelopers.com https://bixby.developer.samsung.com Bixby Production regions Bixby 2.0
  • 19.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Bixby’s Global-scale footprints with AWS ap-northeast-2 (Seoul) cn-north-1 (Beijing) eu-west-1 (Ireland) us-east-2 (Ohio) 2019 AI Interface AI Developer Platform Bixby developer center voice-activated personal assistant https://bixbydevelopers.com https://bixby.developer.samsung.com us-west-2 (Oregon) us-east-1 (N. Virginia) cn-north-2 (Ningxia) Bixby 2.0 Bixby Dev/Staging/Production regions
  • 20.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Excellent compatibility with third-party tools Packer Spinnaker Ansible Application Provisioning Continuous Delivery Monitoring System Datadog Terraform Infrastructure creation DEV STG Prod 2019 AI Interface AI Developer Platform Bixby developer center voice-activated personal assistant https://bixbydevelopers.com https://bixby.developer.samsung.com Bixby using third-party tools Bixby 2.0
  • 21.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Excellent compatibility with third-party tools Terraform Infrastructure creation 2019 AI Interface AI Developer Platform Bixby developer center voice-activated personal assistant https://bixbydevelopers.com https://bixby.developer.samsung.com Bixby using various continuous delivery pipelines Bixby 2.0 Userdata.sh $ curl http://169.254.169.254/latest/meta-data/ $ role=ABC # from instance tag $ ansible-pull –e “role=ABC“ –U git@github.com:ansible.git playbook.yml Instance Tags ansible-role ABC package-version ABC-273a81-v1.5.zip AnsibleEC2 Ansible # Add cronjob for ansible-pull # Getting package-version # Install & Service Execution Github Infrastructure provisioning : creation machine, infrastructure Application bootstrapping: install & configuration the application
  • 22.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T 2019 AI Interface AI Developer Platform Bixby developer center voice-activated personal assistant https://bixbydevelopers.com https://bixby.developer.samsung.com Excellent compatibility with third-party tools Bixby using various AWS services for automation Bixby 2.0Security Group Inbound change CloudTrail Detect! CloudWatch Event RevokeSecurityGroupIngress AuthorizeSecurityGroupIngress Lambda Slack EC2 Block Bitcoin mining B
  • 23.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T AWS services powering Bixby Compute Container Registry Lambda Elastic Load Balancer Auto Scaling Elastic Container Service EC2 Database Aurora DynamoDB ElasticCache RDS Developer Tools CodeDeploy CLI Security, Identity & Compliance IAM KMS Certificate Manager Storage EBS EFS S3 2019 AI Interface AI Developer Platform Bixby developer center voice-activated personal assistant https://bixbydevelopers.com https://bixby.developer.samsung.com Bixby 2.0 Management & Governance CloudWatch CloudTrail Trusted Advisor Networking & Content Delivery CloudFront Route53 VPC API Gateway
  • 24.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T Why run Artificial Intelligence on AWS 2019 AI Interface AI Developer Platform Bixby developer center voice-activated personal assistant https://bixbydevelopers.com https://bixby.developer.samsung.com Bixby 2.0 GPU Instances EFS File system Database services For ASR For sharing model data For personal language model
  • 25.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T High Level Diagram 2019 AI Interface AI Developer Platform Bixby developer center voice-activated personal assistant https://bixbydevelopers.com https://bixby.developer.samsung.com Bixby 2.0
  • 26.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.S U M M I T PLM Bixby Platform Overview PLM Personal Language Model 2019 AI Interface AI Developer Platform Bixby developer center voice-activated personal assistant https://bixbydevelopers.com https://bixby.developer.samsung.com Bixby 2.0 ASR NLU TTS Storage Services Users Database Services Automatic Speech Recognition ASR NLU Natural Language Understanding TTS Text to Speech
  • 27.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Bixby Database architecture 이혁 Database Engineer Samsung Electronics
  • 28.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Launching Bixby Bixby 1.0 in 2017 Commercial shared file system Bixby 2.0 in 2018 Database
  • 29.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Challenges in Bixby 1.0 • Each personal data started getting bigger • 100MB+ for each device : file loading time • Many small files • Hard to work together • Each team had their own files • Hard to extract meaningful value • Operating File System Cluster on AWS • Disk / Node failure • inode limitations • Managing commercial license
  • 30.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. What we needed? Database
  • 31.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. What we needed? Blazingly fastPB scalability No license China region
  • 32.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. How we selected PLM DB? RDBMS NoSQL Open source Aurora Cloud native Open source Other cloud DynamoDB Cloud native PB scalability
  • 33.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. PLM DB PoC scenario • Requirements • No global replication • Database in 1 region + cache in all : network latency • Same architecture for all regions • Each region has 1,920+ concurrent users for load • 300 items per device : 192KB • Generated test data : 10TB • Goal • Get 300 items from DB within 100ms • Put it into Cache once and get 10x within 10ms Seoul OhioIreland DB API API API
  • 34.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. PLM DB PoC scenario • Test schema in DynamoDB Device id (PK*) Seq_num (SK**) Last name First name Nick name Full name … x2019 1 Cho EunAh Frozen Eunah Cho … x2019 2 Cho BeomSeung Iron man BeomSeung Cho … x2019 3 Lee Hyuk Groot Hyuk Lee … … * PK : Partitioning Key ** SK : Sort Key
  • 35.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. PLM DB PoC result-1 How we tested? 1. API servers in 3 regions called. 2. DynamoDB in Seoul for 1 hour. 3. DynamoDB returned 300 items(192KB). 4. Logged the query + round trip time. 5. Measured average number. Why we did this test? 1. Whether the centralized database was possible or not. 52ms (Seoul) 1,512ms (Ireland) 945ms (Ohio) Network made differences!
  • 36.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. PLM DB PoC result-2 1,442ms (Ireland) 2,339ms (Ohio) 3,063ms (Seoul) How we tested? 1. API servers in 3 regions called. 2. DynamoDB in Seoul for 1 hour. 3. DynamoDB returned 300 items(192KB). 4. Put data into ElastiCache Redis. 5. Get data from ElastiCache Redis 10x. 6. Logged the query + round trip time. 7. Measured average number. Why it took too long 1. DynamoDB worked well 2. ElastiCache Redis latency increased under high memory utilization and high traffic. What we learned? 1. Needs to keep some free memory space in operation for consistent low latency for Elasticache Redis. Network + ElastiCache Redis made differences!
  • 37.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Key design is the key • Primary key selection for performance at scale – NoSQL itself is not a silver bullet • Understanding for Access Pattern for simplicity and cost - We have no secondary index
  • 38.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. DynamoDB Schema Design for Bixby Partition1 Partition2 ….. PartitionN Partition1 Partition2 ….. PartitionN 3000 rows 1000 rows 1000 rows 1000 rows service_iduser_id xxx_iddomain Partition key Sort key 1000 rows 1000 rows 1000 rows domainuser_id xxx_idservice_id Partition key Sort key * Cardinality for IDs user_id(1) : service_id(1) : domain(N) : xxx_id(M)
  • 39.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Choosing AWS database options for Bixby DynamoDB for Personal data Aurora MySQL : Member & admin ElastiCache Redis for caching data EMR for analytics S3 for object data EFS for low-latencyRDS MySQL : China RDS PostgreSQL : Geo functions
  • 40.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. AWS Benefits ElastiCache Redis • Version : 2.8 - 5.0* • Cluster-mode* • Read scale-out with slaves* Aurora MySQL • Cloud based architecture : super performance with low-price • All instances are supported* • Read scale-out with up to 15 read replicas • Up to 5 cross region replication* • Custom endpoint* * Supported by AWS DynamoDB • Auto Scaling • 3 Availability Zones • VPC endpoint : Security • Consistent performance and low latency at any scale
  • 41.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Lessons learned • PoC • Database and API server have to be in the same place because of network • Needs to keep some free memory space in operation for consistent low latency for Elasticache Redis • DynamoDB table design • Making access pattern simple is the key • Spreading out traffic across all partitions is important • Less or no secondary key is better if possible • vs Bixby 1.0 • Working as one team easily through DB! • No license and operational cost with DynamoDB and EFS
  • 42.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 여러분의 피드백을 기다립니다! #AWSSummit 해시태그로 소셜 미디어에 여러분의 행사소감을 올려주세요. AWS Summit Seoul 2019 모바 일 앱과 QR코드를 통해 강연평 가 및 설문조사에 참여하시고 재미있는 기념품을 받아가세요 . 내년 Summit을 만들 여러분의 소중한 의견 부탁 드립니다. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 43.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 감사합니다! © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.