awsの進化とsmartnewsの裏側

51
Evolution of AWS Backend of SmartNews 2016/01/27 Classmethod x SmartNews AWS Night

Upload: smartnews-inc

Post on 18-Jan-2017

9.753 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: AWSの進化とSmartNewsの裏側

Evolution of AWSBackend of SmartNews2016/01/27 Classmethod x SmartNews AWS Night

Page 2: AWSの進化とSmartNewsの裏側

Self Introduction

• Nobutoshi Ogata

• Manager, Site Reliability Engineering

• @nobu666

• ❤ Whiskey, Cat, Heavy Metal

• Entrusted dev.(10y) ➡ Game platform infrastructure(3y) ➡ Some startup(1y) ➡ SmartNews(2015/05-)

Page 3: AWSの進化とSmartNewsの裏側
Page 4: AWSの進化とSmartNewsの裏側

SmartNews

Page 5: AWSの進化とSmartNewsの裏側

15,000,000+downloadsworldwide

Page 6: AWSの進化とSmartNewsの裏側

SmartNews 3.0

Page 7: AWSの進化とSmartNewsの裏側

LINE Stampshipped today

Page 8: AWSの進化とSmartNewsの裏側

! Channel!

Page 9: AWSの進化とSmartNewsの裏側
Page 10: AWSの進化とSmartNewsの裏側

! Channel!

Page 11: AWSの進化とSmartNewsの裏側
Page 12: AWSの進化とSmartNewsの裏側

Questionnaire

Page 13: AWSの進化とSmartNewsの裏側

Agenda• Scale

• Services

• Changes in the configuration

• Configuration management

• Future plan

Page 14: AWSの進化とSmartNewsの裏側

Scale

Page 15: AWSの進化とSmartNewsの裏側

Scale• 300+ EC2 instances

• 80 ELBs

• 70 Auto Scaling Groups

• 80+ S3 buckets (300+TB)

• 40 RDS instances (MySQL & Aurora)

• 100 Kinesis shards

• 10 EMR clusters (Hive+Spark)

Page 16: AWSの進化とSmartNewsの裏側

Scale• 50+ ElastiCache clusters (Redis + Memcached)

• 30+ CodeDeploy applications

• 70,000,000 CloudSearch seachable documents

• 8 Redshift nodes

• 10+ Lambda functions

• 80+ SQS queues

• 20+ SNS topics

Page 17: AWSの進化とSmartNewsの裏側
Page 18: AWSの進化とSmartNewsの裏側
Page 19: AWSの進化とSmartNewsの裏側

Services

Page 20: AWSの進化とSmartNewsの裏側
Page 21: AWSの進化とSmartNewsの裏側

Changes in theconfiguration

Page 22: AWSの進化とSmartNewsの裏側

Stone Age

AnalyzerCrawlerIndexer

On-memory DBAPI

Page 23: AWSの進化とSmartNewsの裏側

Monolithic Application

Page 24: AWSの進化とSmartNewsの裏側

Bronze Age

AnalyzerIndexer

On-memory DBAPI

Crawler

Crawler

Crawler

Queue

Page 25: AWSの進化とSmartNewsの裏側

Split Crawler

Page 26: AWSの進化とSmartNewsの裏側

Iron Age

API Indexer Analyzer Crawler

Page 27: AWSの進化とSmartNewsの裏側

Split more

Page 28: AWSの進化とSmartNewsの裏側

Present day

Crawler

Nationality detector

Language detector

Analyzer

Facial recognition

Indexer

Ranking

Search

Recommend

API Gateway

Admin tool Validator

Proxy

Live

Push

Sexy detector

Auth Proxy

Page 29: AWSの進化とSmartNewsの裏側

Micro Services?

Page 31: AWSの進化とSmartNewsの裏側

Configurationmanagement

Page 32: AWSの進化とSmartNewsの裏側

Pull style deploy

Page 33: AWSの進化とSmartNewsの裏側

➡ ➡ ⬅ • CodeDeploy was used to automate deployment tasks

• Operating an AWS ELB

• Fetching a new revision

• Restarting services with our custom program

• e.g. downloading machine learning model data, precompiling assets and deploying Docker containers

Page 34: AWSの進化とSmartNewsの裏側
Page 35: AWSの進化とSmartNewsの裏側

Auto Scaling Group• There is an advantage even if you don't want to autoscaling

• Easy to dispose

• replace kernel, switch to other OS, ...

• Easy A/B testing

• change config only specific server

• tag:Attributes

• Instance Protection

Page 36: AWSの進化とSmartNewsの裏側

ASG ! InstanceName• We were stop using InstanceName

• Using tag:Group and tag:Env

Page 37: AWSの進化とSmartNewsの裏側

Infrastructure as Code• Route53 ➡ winebarrel/roadworker

• Security Group ➡ winebarrel/piculet

• Elastic IP Addresses ➡ winebarrel/eipmap

• Provisioning ➡ itamae-kitchen/itamae

• Datadog ➡ airbnb/interferon

Page 38: AWSの進化とSmartNewsの裏側

DSL managementis not perfect• Complicated automation

• ChatOps ➡ change code ➡ git add && git commit && git push

• Too much hassle... !

Page 39: AWSの進化とSmartNewsの裏側

Run Command• Secure

• IAM, CloudTrail

• Easy CI integration w/o SSH

• be able to use EMR also

Page 40: AWSの進化とSmartNewsの裏側

Exampleaws ssm send-command \--document-name "AWS-RunShellScript" \--instance-ids \ $(aws emr list-instances \ --cluster-id \ $(aws emr list-clusters --active | \ jq -r '.Clusters[] | select (.Name=="FOOBAR") | .Id') | \ jq -r '.Instances[].Ec2InstanceId') \--parameters '{"commands":["ls"],"executionTimeout":["10"]}' \--timeout-seconds 10 \--output-s3-bucket-name "ssm-logs" \--output-s3-key-prefix "prefix-" \--region ap-northeast-1

Page 41: AWSの進化とSmartNewsの裏側

Future plan

Page 42: AWSの進化とSmartNewsの裏側

ECSSpot Fleet

Contaniner RegistryConsul

AWS Blackbelt 2015 ECS p.98

Page 43: AWSの進化とSmartNewsの裏側

Containerizeall services

Page 44: AWSの進化とSmartNewsの裏側

ScalableSafetyEfficientPortable

Measurable

Page 45: AWSの進化とSmartNewsの裏側

Aggregates events

Page 46: AWSの進化とSmartNewsの裏側

Events aggregator• Events

• Deploy/Provision/Restart/Terminate etc.

• All events goes to SNS or Kinesis. Users will describe and hook scripts

• Visualize via Datadog

• Notice to Slack

• Auto healing

Page 47: AWSの進化とSmartNewsの裏側

Summary

Page 48: AWSの進化とSmartNewsの裏側

Summary• AWS release new service continuously

• We ride on the shoulders of giants

• We will never forget that OSS helped us

Page 49: AWSの進化とSmartNewsの裏側

We're hiring!Only two people onSite Reliability Engineering Team

http://about.smartnews.com/en/careers/

Page 50: AWSの進化とSmartNewsの裏側
Page 51: AWSの進化とSmartNewsの裏側

Credithttps://flic.kr/p/hAcPRk taken by Niuton mayhttps://flic.kr/p/9UnRWS taken by Alberto G.https://flic.kr/p/ydnEvw taken by ep_jhuhttps://flic.kr/p/pyfnTV taken by Kevin Dooleyhttps://flic.kr/p/mtLpc4 taken by L1meyhttps://flic.kr/p/fgG226 taken by Linux Screenshotshttps://flic.kr/p/7DsuLz taken by Gloson Tehhttps://flic.kr/p/jfGpn7 taken by julochka