33
SmartNews's journey into microservices Takumi Sakamoto Livesense TechNight 2015.09.29

SmartNews's journey into microservices

Embed Size (px)

Citation preview

Page 1: SmartNews's journey into microservices

SmartNews's journey into microservices

Takumi Sakamoto Livesense TechNight

2015.09.29

Page 2: SmartNews's journey into microservices

Takumi Sakamoto @takus

Page 3: SmartNews's journey into microservices
Page 4: SmartNews's journey into microservices

News Delivery Pipelines

Page 5: SmartNews's journey into microservices

36 months ago The first system is developed

Crawler Analyzer Indexer

On memory DB API

Monolithic App

Social Media

Article Lists

Page 6: SmartNews's journey into microservices

12 months ago Split crawlers

Crawler

Queue

Monolithic App

Analyzer Indexer

On memory DB API

Page 7: SmartNews's journey into microservices

https://medium.com/@takus/velocity-conference-2015-wrap-up-velocityconf-f3811e05f1e8

4 months ago At Velocity Conference

Page 8: SmartNews's journey into microservices

2 months ago Dive into the microservices world

Crawler

Kinesis

IndexerAnalyzer

Kinesis CloudSearch

Page 9: SmartNews's journey into microservices

Why microservices?

• A lot of different types of services are required for us

• crawler, image analyzer, content extractor ...

• Adapt to technical progress / market change

• every system should be replaceable

• Make developers happy :)

• avoid to maintain "legacy" "large" "monolithic"

• enable us to develop any languages

Page 10: SmartNews's journey into microservices

A part of microservices

Source A

Analyzer Indexer Search API A

PhotoqualCaffe

Reporting

API Gateway

Realtime feedback

Image Analysis

Extractor

Content extraction

Source B

Search API B

Ranking algorithm A/B test

Language detecter

Crawling

Language detection

Spark Streaming

KPI Dashboard

Admin

Operation

Page 11: SmartNews's journey into microservices

References (Japanese only)

Stream 処理と Offline 処理の統合

http://bit.ly/1VnQQao

スマートニュースの世界進出を支えるログ解析基盤

http://bit.ly/1MCOyBX

SmartNews の Webmining を支えるプラットフォーム

http://bit.ly/1RcVGqk

Page 12: SmartNews's journey into microservices

Journey into microservices

When you use microservices you have to work on automated deployment, monitoring, dealing with failure, eventual consistency, and other factors that a distributed system introduces.

http://martinfowler.com/bliki/MicroservicePremium.html

Page 13: SmartNews's journey into microservices

Automated Deployment with AWS CodeDeploy

Today's topic

Page 14: SmartNews's journey into microservices

Deployment is not easy

• Manage complexity

• multiple roles

• multiple environments

• auto scaling

• Avoid downtime

• JVM based applications doesn't support hot deploy

• Monitoring

• stop deployment if something wrong

• which instances are succeeded or failed

Page 15: SmartNews's journey into microservices

AWS CodeDeploy

http://www.slideshare.net/AmazonWebServices/aws-codedeploy-manage-deployment-complexity

Page 16: SmartNews's journey into microservices

2W1H configurations

http://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-steps.html

Where?How?What?

Page 17: SmartNews's journey into microservices

Deployment Flow

http://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-steps.html

What?

How?

Where?

Page 18: SmartNews's journey into microservices

What to Deploy?

• Prepare your "revision" archive

• appspec.yml

• application (WAR/JAR etc...)

• (optional) scripts

• register to ELB / deregister from ELB

• pre-compile assets

• waiting cache warmup

Page 19: SmartNews's journey into microservices

App Spec

Page 20: SmartNews's journey into microservices

How to Deploy?

Page 21: SmartNews's journey into microservices

Where to Deploy?

EC2 Tag / Auto Scaling Group

Page 22: SmartNews's journey into microservices

My favorites

• Simple, Fast, Flexible, Free

• Require small changes for current system

• Integration w/ AWS Auto Scaling

• deploy last successful revision to a new instance

• wait for registering ELB until finishing deployment

Page 23: SmartNews's journey into microservices

Pitfall

Exclusive lock is required :P

Deployment is skipped during scale-out

Page 24: SmartNews's journey into microservices

Automated Deployment at SmartNews

Page 25: SmartNews's journey into microservices

Deployment pipelines

Page 26: SmartNews's journey into microservices

Slack notification

Role / Env / Version Deployment status

Commits

Page 27: SmartNews's journey into microservices

Datadog monitoring

Page 28: SmartNews's journey into microservices

Datadog alerts

Page 29: SmartNews's journey into microservices

Manage alerts by DSL

Most of alerts are created automatically Powered by airbnb/interferon

Page 30: SmartNews's journey into microservices

Docker for C++ apps

Page 31: SmartNews's journey into microservices

Towards future...

Page 32: SmartNews's journey into microservices

We’re hiring!!! Join our journey into microservices

Site reliability engineer Productivity engineer Web application engineer iOS/Android engineer ML/NLP engineer Ad engineer

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

Page 33: SmartNews's journey into microservices

Wait for you @ SmartKitchen