楽天が
モノリス→マイクロサービス & オンプレ→クラウド
で経験した光と闇
Feb 13th, 2020
Koichi Yanagimoto, EC Incubation Development Dept., Rakuten, Inc.
Yosuke Arai, Microsoft Japan Co., Ltd.
3
About Our Team and Today’s topics
Service Operation Kaizen Group
Our mission
“少ない⼈数でより多くのサービスの運⽤を︕”
11 Services/Group
Today’s Target Service
DMC
(画像Storage/APIs)
Get / Store / Delete… About 10 Functions
Slide 4
Slide 4 text
4
1.Current Structures and problems
2.Network Cost Issue
3.Database Issue
4.Data Transfer issue
5.Microservice from Monolith
6.CI/CD Pipeline
7.Next Actions
Slide 5
Slide 5 text
5
Old Structure
⾊々な問題点が…
• Squid/VarnishのLayerのメンテナンス
• 10以上あるFunctions, Version Up…
• アクセス負荷増のときの増強
• MogileFSのDisk交換
などなど
Slide 6
Slide 6 text
6
Old Structure -> New Structure
Slide 7
Slide 7 text
7
Try 1 – Network Cost Issue
Slide 8
Slide 8 text
8
How to cost on Azure? - Network
Azureの外に出るときに課⾦される…。
VarnishでCacheしてる意味ないやん…。
…
Azure Storage
MySQL
Server
Secure container
X
MySQL
Server
Secure container
PostgreSQL: 5432
MySQL: 3306
MySQL
Client
Azure
3 copies of data for data reliability
Azure Database for MySQL
⾼可⽤性、計画メンテナンス
• Built-in HA
– 冗⻑ノードへのfail-over実施
– アプリケーションは通常最⼤で 60 秒
未満の間、Databaseへの接続を失う
• 通知
– [Preview in East US and UK South]
Service health事前通知
• メンテナンスWindow
– 現状機能無し
– (参考)
メンテナンスwindowを指定できる
他サービス
SQL Datawarehouse, Azure Redis, Azure VM
(Dedicated host)
https://docs.microsoft.com/ja-jp/azure/mysql/howto-troubleshoot-common-connection-issues
https://docs.microsoft.com/ja-jp/azure/mysql/concepts-monitoring#service-health
15
Try 3 – Data Transfer issue
約260TB
約15億
Records
Azure Data Box
Slide 15
Slide 15 text
16
OFFLINE data transfer: Azure Databox Family
80TB
\28,000+\1,680/⽇+送料
GA
At Japaneast/west
Not GA
At Japaneast/west
7TB
\5,600+\1,120/⽇+送料
770TB
\448,000+\11,200/⽇+送料
https://azure.microsoft.com/ja-jp/services/databox/data/
Slide 16
Slide 16 text
17
Gave up to use Azure Databox…
⾊々と気をつかって原始的な感じでゴリゴリ…
• Networkの帯域を使い切っちゃう恐れがあるの
で、LoadBalancerに紐づけて、必要以上に負荷
をかけないように
• ActiveStorageがmetadataの更新している間、
Imageを掴んでいて、メモリリーク…
• ActiveStorage側でheaderの値を渡していないの
で、今azure-core側のdefaultのheader情報⼊って
る…w (PRチャンス?)
• Long Long Journey…
Dapr: Build apps using any language with any framework
Any code or
framework…
Functions
S e r v i c e s w r i t t e n i n
.NET Core
Microservice application
Service-to-
service
invocation
State management
Publish and
subscribe
Resource
bindings &
triggers
Actors
Distributed
tracing
Extensible…
HTTP/gRPC APIs
Any cloud or edge infrastructure
https://www.publickey1.jp/blog/19/dapr.html
https://github.com/dapr/dapr/wiki/FAQ#how-does-dapr-work-with-service-meshes
32
Try X – New challenges from now
• Database – Vitess
• Messaging – Nats
• Observability – Open Telemetry
• Chaos Engineering – Chaos Toolkit
Slide 32
Slide 32 text
Azure
参考情報
#1
Azure
Architecture
Center
https://docs.microsoft.com/ja-jp/azure/architecture/reference-architectures/microservices/aks
Slide 33
Slide 33 text
Azure参考情報
#2. AKS best practice
• Applying best practices to Azure Kubernetes Service (AKS)
– https://myignite.techcommunity.microsoft.com/sessions/81598?source=schedule
• 可⽤性ゾーン (Availability Zone) とAKS
– https://docs.microsoft.com/ja-jp/azure/aks/availability-zones
• AKS BCP and DR Best practice
– https://docs.microsoft.com/ja-jp/azure/aks/operator-best-practices-multi-region