SlideShare a Scribd company logo
Architecture Sustaining
LINE Sticker Services
Masahiro IDE, LINE CORP
About me
• Masahiro Ide
• Software Engineer of LINE server development
• Especially StickerShop backend server
• Joined: Oct, 2015
• Contribute to Armeria
• Our open sourced asynchronous RPC/REST library
• https://github.com/line/armeria
Agenda • Sticker Shop Server
• History
• Our Architecture
• Implementations
What is Sticker Shop?
Sticker Shop … in 2015
One of the biggest monolithic Java application in LINE
• Purchasing, Serving, Ranking stickers in 1 app
• Many pains, troubles
• Takes more than 3 hours to restart app
Sticker Shop in 2018
Now shift to microservice way for scalability
• 1 million stickers
• 30 services
• Purchasing, Serving, Ranking stickers, etc.
• 70K requests/sec in peek time
StickerShop Architecture Overview
(Simplified)
Central Dogma – Configuration Repository Service
Talk server
ElasticSearch
Client
ReverseProxy
Thrift/HTTP2
Thrift/HTTP2
Redis
MySQL
Sticker capability
server
Shop server Search FE
Thrift/HTTP2
Implementation
• What we need is…
• Performance
• Prepared to faults
• Observability
• Stable feature rollout
Central Dogma
• Repository service for textual configurations
• JSON, YAML, XML …
• Highly available
• multi-master, eventually consistency
• Version controlled
• https://line.github.io/centraldogma/
Armeria - Our RPC layer
• Asynchronous RPC/REST library
• built on top of Java 8, Netty, HTTP/2, Thrift and gRPC
• Take care common functionality for microservice
1. Load balancing
2. Circuit Breaker / Retry / Throttling
3. Tracing (Zipkin) / Monitoring integration
• etc.
https://line.github.io/armeria/
1. Client-side load balancing
• No proxy load balancers
• Proxy would be inefficient when
considering request heavy services
• CentralDogma as a service discovery
• All services register a name and
a list of machines in CentralDogma
• All clients monitor CentralDogma and
balance requests across machines
LB
Client
Server
Client
Server
Server
Proxy load balancing
1. Client-side load balancing
• No proxy load balancers
• Proxy would be inefficient when
considering request heavy services
• CentralDogma as a service discovery
• All services register a name and
a list of machines in CentralDogma
• All clients monitor CentralDogma and
balance requests across machines
Central Dogma
Client
Server
Client
Server
Server
2. Circuit Breaker - Avoid cascading failure
• Server die suddenly
• e.g. Hardware failure
• Upstream cannot proceed part
of requests, in worst case
• Blocks all of application thread
• LINE die
Service A
Service C
Service B
2. Circuit Breaker - Avoid cascading failure
• Circuit Breaker pattern*
1. Monitors failures
2. Return error immediately without
RPC once the failures reach
a threshold
Service A
Service C
Service B
CircuitBreaker
CircuitBreaker
* https://martinfowler.com/bliki/CircuitBreaker.html
3. Tracing
• Hard to point out the slowness/bug in microservice
• No one provides complete picture of system performance
Talk server
ElasticSearch
Reverse Proxy
Redis
MySQL
Shop server
Search FE
T=start
T=end
3. Tracing
• Solution: Distributed tracing with Zipkin
Rollout features using CentralDogma (CD)
• Rollout to production within
10 minutes of being changed
• Deploy a YAML file to all our
production servers via CD
• Record changes in CD
commit log
Rollout features using CentralDogma
• Rollout to production within
10 minutes of being changed
• Deploy a YAML file to all our
production servers via CD
• Record changes in CD
commit log
30%CacheV2 rollout:
Central
Dogma
Service
Service
Service
commit
YAMLPull & Reload config
Developer
Conclusion
• Our system is built on top of our OSSs
• Armeria, CentralDogma, and more
• … are still evolving
• Trouble may happen
• Make a well trouble-prepared system
• Let's do a smooth release
Q & A

More Related Content

PPTX
Software architecture for high traffic website
PPTX
Introduction to Apache ZooKeeper
PDF
High Concurrency Architecture at TIKI
PDF
Introducing Saga Pattern in Microservices with Spring Statemachine
PPTX
data platform on kubernetes
PPTX
Kafka presentation
PPTX
Microservices Architecture Part 2 Event Sourcing and Saga
PDF
Patterns of resilience
Software architecture for high traffic website
Introduction to Apache ZooKeeper
High Concurrency Architecture at TIKI
Introducing Saga Pattern in Microservices with Spring Statemachine
data platform on kubernetes
Kafka presentation
Microservices Architecture Part 2 Event Sourcing and Saga
Patterns of resilience

What's hot (20)

PPTX
Introduction to Microservices
PDF
SRE & Kubernetes
PPTX
Microservices Part 3 Service Mesh and Kafka
PDF
NDC12_Lockless게임서버설계와구현
PPTX
Ndc14 분산 서버 구축의 ABC
PPTX
RedisConf17 - Roblox - How Roblox Keeps Millions of Users Up to Date with Red...
PPTX
Stability Patterns for Microservices
PDF
Domain Driven Design và Event Driven Architecture
PDF
Iocp 기본 구조 이해
PDF
Apache Kafka Architecture & Fundamentals Explained
PDF
Scalable Monitoring Using Apache Spark and Friends with Utkarsh Bhatnagar
PPTX
게임 분산 서버 구조
PPTX
RedisConf17- Using Redis at scale @ Twitter
KEY
Event Driven Architecture
PDF
[KGC 2012] Online Game Server Architecture Case Study Performance and Security
ODP
Presto
PDF
How to build massive service for advance
PDF
Introduction to the Disruptor
PPTX
From cache to in-memory data grid. Introduction to Hazelcast.
PPTX
Microservice intro
Introduction to Microservices
SRE & Kubernetes
Microservices Part 3 Service Mesh and Kafka
NDC12_Lockless게임서버설계와구현
Ndc14 분산 서버 구축의 ABC
RedisConf17 - Roblox - How Roblox Keeps Millions of Users Up to Date with Red...
Stability Patterns for Microservices
Domain Driven Design và Event Driven Architecture
Iocp 기본 구조 이해
Apache Kafka Architecture & Fundamentals Explained
Scalable Monitoring Using Apache Spark and Friends with Utkarsh Bhatnagar
게임 분산 서버 구조
RedisConf17- Using Redis at scale @ Twitter
Event Driven Architecture
[KGC 2012] Online Game Server Architecture Case Study Performance and Security
Presto
How to build massive service for advance
Introduction to the Disruptor
From cache to in-memory data grid. Introduction to Hazelcast.
Microservice intro
Ad

Similar to Architecture Sustaining LINE Sticker services (20)

PDF
Microservice Architecture
PPTX
Tef con2016 (1)
PPTX
Service Architectures at Scale
PDF
Microservices Architecture
PDF
Microservice architecture
PPTX
Jeffrey Richter
PDF
Building Asynchronous Microservices with Armeria
PDF
Changing application demands: What developers need to know
PDF
Microservices Practitioner Summit Jan '15 - Microservice Ecosystems At Scale ...
PDF
Microservices Technology Stack
ODP
micro services architecture (FrosCon2014)
PPTX
Concurrency at Scale: Evolution to Micro-Services
PPTX
Micro Services Architecture
PPTX
Service Mesh CTO Forum (Draft 3)
PPTX
Microservices approach for Websphere commerce
PDF
Evolution of Microservices - Craft Conference
PPTX
Microservices Corporate Style
PDF
Service Mesh Talk for CTO Forum
PDF
Microservices - Hitchhiker's guide to cloud native applications
PPTX
An introduction to Microservices
Microservice Architecture
Tef con2016 (1)
Service Architectures at Scale
Microservices Architecture
Microservice architecture
Jeffrey Richter
Building Asynchronous Microservices with Armeria
Changing application demands: What developers need to know
Microservices Practitioner Summit Jan '15 - Microservice Ecosystems At Scale ...
Microservices Technology Stack
micro services architecture (FrosCon2014)
Concurrency at Scale: Evolution to Micro-Services
Micro Services Architecture
Service Mesh CTO Forum (Draft 3)
Microservices approach for Websphere commerce
Evolution of Microservices - Craft Conference
Microservices Corporate Style
Service Mesh Talk for CTO Forum
Microservices - Hitchhiker's guide to cloud native applications
An introduction to Microservices
Ad

More from LINE Corporation (20)

PDF
JJUG CCC 2018 Fall 懇親会LT
PDF
Reduce dependency on Rx with Kotlin Coroutines
PDF
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
PDF
Use Kotlin scripts and Clova SDK to build your Clova extension
PDF
The Magic of LINE 購物 Testing
PPTX
GA Test Automation
PDF
UI Automation Test with JUnit5
PDF
Feature Detection for UI Testing
PDF
LINE 新星計劃介紹與新創團隊分享
PDF
​LINE 技術合作夥伴與應用分享
PDF
LINE 開發者社群經營與技術推廣
PDF
日本開發者大會短講分享
PDF
LINE Chatbot - 活動報名報到設計分享
PDF
在 LINE 私有雲中使用 Managed Kubernetes
PDF
LINE TODAY高效率的敏捷測試開發技巧
PDF
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
PDF
LINE Things - LINE IoT平台新技術分享
PDF
LINE Pay - 一卡通支付新體驗
PDF
LINE Platform API Update - 打造一個更好的Chatbot服務
PDF
Keynote - ​LINE 的技術策略佈局與跨國產品開發
JJUG CCC 2018 Fall 懇親会LT
Reduce dependency on Rx with Kotlin Coroutines
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
Use Kotlin scripts and Clova SDK to build your Clova extension
The Magic of LINE 購物 Testing
GA Test Automation
UI Automation Test with JUnit5
Feature Detection for UI Testing
LINE 新星計劃介紹與新創團隊分享
​LINE 技術合作夥伴與應用分享
LINE 開發者社群經營與技術推廣
日本開發者大會短講分享
LINE Chatbot - 活動報名報到設計分享
在 LINE 私有雲中使用 Managed Kubernetes
LINE TODAY高效率的敏捷測試開發技巧
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE Things - LINE IoT平台新技術分享
LINE Pay - 一卡通支付新體驗
LINE Platform API Update - 打造一個更好的Chatbot服務
Keynote - ​LINE 的技術策略佈局與跨國產品開發

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Cloud computing and distributed systems.
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Encapsulation theory and applications.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Electronic commerce courselecture one. Pdf
A Presentation on Artificial Intelligence
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
Mobile App Security Testing_ A Comprehensive Guide.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Cloud computing and distributed systems.
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation_ Review paper, used for researhc scholars
The AUB Centre for AI in Media Proposal.docx
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25 Week I
Unlocking AI with Model Context Protocol (MCP)
Advanced methodologies resolving dimensionality complications for autism neur...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Review of recent advances in non-invasive hemoglobin estimation
Encapsulation theory and applications.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Electronic commerce courselecture one. Pdf

Architecture Sustaining LINE Sticker services

  • 1. Architecture Sustaining LINE Sticker Services Masahiro IDE, LINE CORP
  • 2. About me • Masahiro Ide • Software Engineer of LINE server development • Especially StickerShop backend server • Joined: Oct, 2015 • Contribute to Armeria • Our open sourced asynchronous RPC/REST library • https://github.com/line/armeria
  • 3. Agenda • Sticker Shop Server • History • Our Architecture • Implementations
  • 5. Sticker Shop … in 2015 One of the biggest monolithic Java application in LINE • Purchasing, Serving, Ranking stickers in 1 app • Many pains, troubles • Takes more than 3 hours to restart app
  • 6. Sticker Shop in 2018 Now shift to microservice way for scalability • 1 million stickers • 30 services • Purchasing, Serving, Ranking stickers, etc. • 70K requests/sec in peek time
  • 7. StickerShop Architecture Overview (Simplified) Central Dogma – Configuration Repository Service Talk server ElasticSearch Client ReverseProxy Thrift/HTTP2 Thrift/HTTP2 Redis MySQL Sticker capability server Shop server Search FE Thrift/HTTP2
  • 8. Implementation • What we need is… • Performance • Prepared to faults • Observability • Stable feature rollout
  • 9. Central Dogma • Repository service for textual configurations • JSON, YAML, XML … • Highly available • multi-master, eventually consistency • Version controlled • https://line.github.io/centraldogma/
  • 10. Armeria - Our RPC layer • Asynchronous RPC/REST library • built on top of Java 8, Netty, HTTP/2, Thrift and gRPC • Take care common functionality for microservice 1. Load balancing 2. Circuit Breaker / Retry / Throttling 3. Tracing (Zipkin) / Monitoring integration • etc. https://line.github.io/armeria/
  • 11. 1. Client-side load balancing • No proxy load balancers • Proxy would be inefficient when considering request heavy services • CentralDogma as a service discovery • All services register a name and a list of machines in CentralDogma • All clients monitor CentralDogma and balance requests across machines LB Client Server Client Server Server Proxy load balancing
  • 12. 1. Client-side load balancing • No proxy load balancers • Proxy would be inefficient when considering request heavy services • CentralDogma as a service discovery • All services register a name and a list of machines in CentralDogma • All clients monitor CentralDogma and balance requests across machines Central Dogma Client Server Client Server Server
  • 13. 2. Circuit Breaker - Avoid cascading failure • Server die suddenly • e.g. Hardware failure • Upstream cannot proceed part of requests, in worst case • Blocks all of application thread • LINE die Service A Service C Service B
  • 14. 2. Circuit Breaker - Avoid cascading failure • Circuit Breaker pattern* 1. Monitors failures 2. Return error immediately without RPC once the failures reach a threshold Service A Service C Service B CircuitBreaker CircuitBreaker * https://martinfowler.com/bliki/CircuitBreaker.html
  • 15. 3. Tracing • Hard to point out the slowness/bug in microservice • No one provides complete picture of system performance Talk server ElasticSearch Reverse Proxy Redis MySQL Shop server Search FE T=start T=end
  • 16. 3. Tracing • Solution: Distributed tracing with Zipkin
  • 17. Rollout features using CentralDogma (CD) • Rollout to production within 10 minutes of being changed • Deploy a YAML file to all our production servers via CD • Record changes in CD commit log
  • 18. Rollout features using CentralDogma • Rollout to production within 10 minutes of being changed • Deploy a YAML file to all our production servers via CD • Record changes in CD commit log 30%CacheV2 rollout: Central Dogma Service Service Service commit YAMLPull & Reload config Developer
  • 19. Conclusion • Our system is built on top of our OSSs • Armeria, CentralDogma, and more • … are still evolving • Trouble may happen • Make a well trouble-prepared system • Let's do a smooth release
  • 20. Q & A

Editor's Notes

  • #2: こんにちは、LINEのIde masahiroです。これからの20分間は我々LINEのサービスの1つであるsticker、それを支えているアーキテクチャや仕組み、その概要をお話しできればと思います。よろしくお願いいたします。まず最初に(次のページ)
  • #3: 私はLINEでサーバサイドエンジニアをしています。特にメッセージングやスタンプなどを中心に開発を行っています。2015年の10月に入社したのでおよそ2.5年ほど経ちましたが、LINEでは日本語や韓国語、英語などの言葉の壁、サービスの部署の壁などは特別なく、自由な開発を行えていると思っています。それでは、(次のページ)
  • #4: 本題に移っていきましょう。これが本日のアジェンダになります。まず、最初にこの発表で扱うサービスであるstickershop、そのサービスだったりアーキテクチャの概要を紹介します。そのあとに、それを支えるRPC layerの紹介、そしてサービスのリリースを支えるopsの紹介をします。それでは最初の内容に移っていきましょう。
  • #5: LINEでも良いですし、他のメッセージングアプリでも構いません。Stickerを作ったことがある方はいますか?もしくはstickerを買ったこと? あるいは送ったこと?送ることは結構な人数がいますかね?ありがとうございます。そうです。ラフに言うと、stickerに関連する、作る、買う、送る、この3つの仕組み提供しています。(厳密には送る部分はmessagingに関わるserviceが担当しますが、概ね間違っていないと思う) そしてアプリケーションの規模、サービスの規模を表す1つの例として、2015年に我々は(次のページ)
  • #6: サービスが発展して行く中でいくつかの問題を抱えていました。ほとんどの原因は巨大なmonolithic applicationであったことに起因します。それにより、
  • #7: それでは2018年に戻ってきましょう。現在のstickershopは、この3つの数字で表せると思います。これは大体の数字ですが、2018年現在でおおよそ1 million productが実際のstickerとして皆さんの手元から相手のchatに届いています。そして、おおよそ3つの機能を提供するために30以上のmicroserviceによって作る、売る、送るという機能は作られてます。最後に、サービスとして処理するrequestの量ですが、peek of peekで話しますと大体70K req/sec程度が一番忙しい時にはあったりするという規模感になっています。では、それを実現するアーキテクチャはどのようになっているでしょうか?(次のページ)
  • #8: この図はstickershopのアーキテクチャを表しています。先ほど30以上のサービスから構成されていると言いましたが、ここでは代表して数個のserviceが登場しています。青い線で書かれているように、LINE clientから送られてきたrequestはreverse proxyを通じてbackend serverに機能に応じてrequestを投げていき、storageまでアクセスされます。それぞれのサービスはお互いに通信しながらサービスを提供するので、大体メッシュ状のような形状になっていて、CentralDogmaと呼ばれるconfiugrationを一箇所で管理するserviceと繋がっています。そして、LINE ClientとserverはThrift over http2のrequestで通信が行われています。同様に、サーバ間の通信は大体Thrift over http2で行われています。
  • #9: では、我々はこのアーキテクチャをどのように支えているのでしょうか?今日はこの4つの点で話してみたいと思います。まず初めにサービスのインフラとして(次のページ)
  • #10: まず最初に説明したいのは、CentralDogmaと呼ばれるconfigurationを一箇所で管理するserviceです。サービスをrolloutしたりconfigurationを
  • #11: そして、これまで説明してきたサービスにおいて、通信は、それを支えるRPC layer、Armeriaと呼ばれるserver/client libraryによって提供されています。 Armeriaは我々がopen sourceにしたAsynchronous RPC/REST libraryです。Eventloop baseのnetwork libraryであるnettyをベースにしており、その上でHTTP1, HTTP2, そしてThriftやgRPCなどRPC機能を提供しています。一番下に書いてあるURLでdocumentationやソースコードは公開されていますのでもし興味がありましたらぜひ試してください。 このArmeriaでは、先ほど説明したようなmicroserviceを実現する上で必要な機能も合わせて提供してくれています。代表的な機能としてはLoad balancingの機能や、リクエストが失敗した時、サービスに障害があった時に有用なthrottling, request limittingの機能、また、モニタリングやサービス全体のトレースを行うためのintegrationがあります。
  • #12: 古典的なサービスではclientとserverの間の間にproxyを置いて、requestをservingしていたと思います。しかし、storage serviceのようなrequestの多いサービスではLBを経由するコストは無視できません。我々は(次のページ)
  • #13: CDを用いたclient side loadbalancingの仕組みを作り、サーバサイドのinter connectionのrequestを効率化しています。
  • #14: そして、次に説明したいのはcircuit breakerという仕組みです。みなさんご存知の通り、applicationは様々な理由によって突然死にます。そして、最悪の場合、その障害はupstreamサーバのrequestをブロックし、application serverのthreadをブロックします。そして最終的にはその影響はサービス全体に波及してLINEが死にます。そのような状況を防ぐために(次のページ)
  • #15: Circuit Breakerという仕組みを利用してサービスの影響を波及させないようにしています。仕組みについては非常によく知られています。このURLを参考にしていただければと思います。 (次のページ)
  • #16: 3つめに紹介したいのはtracingについてです。Microservice上で開発する上で一番大変なことは何か問題が発生した時にそれがどこで発生したかを正しく理解することです。 (次のページ)
  • #17: (次のページ)
  • #18: 最後に紹介したいのは、どのようにfeatureのrolloutをしているかについてです。 All of our servers run a background thread called the “CentralDogma watcher” which constantly watches the CentralDogma_config.json copy on memory, reloading it when it changes. This allows CentralDogma to reload without interruption to the server.
  • #19: 最後に紹介したいのは、どのようにfeatureのrolloutをしているかについてです。 All of our servers run a background thread called the “CentralDogma watcher” which constantly watches the CentralDogma_config.json copy on memory, reloading it when it changes. This allows CentralDogma to reload without interruption to the server.
  • #20: ここまで、Armeria, CentralDogma、いくつかのLINE, StickerShopを支える仕組みについて紹介してきました。