Slide 1

Slide 1 text

ArmeriaͱCentral Dogma͔ΒֶͿ ϚΠΫϩαʔϏεʹඞཁͳػೳ FUKUOKA Engineers Day 2019 ~Summer~ 2019/07/20 @matsumana

Slide 2

Slide 2 text

About me • Nameɿ Manabu Matsuzaki • Work atɿ LINE Fukuoka Corporation • Roleɿ SRE • Twitterɿ @matsumana

Slide 3

Slide 3 text

Agenda • ͜ͷηογϣϯͷͶΒ͍ • ೖ໳ฤ • Armeriaೖ໳ • Central Dogmaೖ໳ • ࣮ફฤ • ArmeriaͱCentral DogmaΛ࢖ͬͨαϯϓϧΞϓϦͰػೳ঺հ

Slide 4

Slide 4 text

͜ͷηογϣϯͷͶΒ͍ • αʔϏεReliabilityͷࢹ఺͔ΒɺϚΠΫϩαʔϏεʹඞཁͳػೳΛߟ ͑Δ • Armeria + Central DogmaͰԿ͕ग़དྷΔͷ͔Λ঺հ • k8sʹσϓϩΠͰ͖ΔαϯϓϧΞϓϦΛ࢖ͬͯ঺հ͠·͢

Slide 5

Slide 5 text

ϚΠΫϩαʔϏεʹඞཁͳػೳΛߟ͑ͯΈΔ ʢαʔϏεReliabilityͷࢹ఺ʣ • ࣮ફϚΠΫϩαʔϏε ᴷ ίϯϙʔωϯτ෼ׂ΍τϥϒϧճආͷߟ͑ํΛLINEͷಋೖ ࣄྫʹֶͿ
 https://employment.en-japan.com/engineerhub/entry/2018/10/09/110000 • RxJava 2ͱArmeriaͰϚΠΫϩαʔϏεΛඇಉظԽͯ͠Έͨ
 https://engineering.linecorp.com/ja/blog/asynchronous-micro-service-in-rxjava-2- armeria/ • Envoy Proxy - Learn Envoy
 https://www.envoyproxy.io/learn/

Slide 6

Slide 6 text

ϚΠΫϩαʔϏεʹඞཁͳػೳΛߟ͑ͯΈΔ ʢαʔϏεReliabilityͷࢹ఺ʣ • Async • Service Discovery • Distributed tracing • Circuit Breaker • Metrics • etc

Slide 7

Slide 7 text

Armeriaೖ໳

Slide 8

Slide 8 text

ࢀߟࢿྉ • Official site
 https://line.github.io/armeria/ • Examples
 https://github.com/line/armeria-examples • JOTB19 - Armeria: The Only Thrift/gRPC/REST Microservice Framework You'll Need • https://speakerdeck.com/trustin/armeria-the-only-thrift-grpc- rest-microservice-framework-youll-need • https://www.youtube.com/watch?v=hLlctum1pIA

Slide 9

Slide 9 text

ArmeriaΛ࢖͍ͬͯΔOSS΍αʔϏε • https://github.com/line/armeria/issues/1709 • OSS • OpenZipkin Server • Curiostack • Services • LINE • Slack (gRPCʹؔ͢ΔॳͷΧϯϑΝϨϯεɺgRPC Conf͕GoogleຊࣾͰ։࠵ https://thinkit.co.jp/article/16048 ) • Kakao Pay • Infostellar

Slide 10

Slide 10 text

What is Armeria? • Java microservice framework • Supports gRPC, Thrift and REST API • Based on async and reactive model(Non Blocking I/O using event loop) • Supports Reactive Streams (RxJava2, Project Reactor) • Supports HTTP/2. Not only gRPC but also Thrift and REST API • Has features for microservices • Others • Spring Boot integration • etc

Slide 11

Slide 11 text

Why async and reactive? • Why async? • ಉظతͳAPIͰϚΠΫϩαʔϏεΛߏஙͨ͠৔߹ɺݺͼग़͠ݩͷεϨου͸Ϩεϙϯε ͕ฦͬͯ͘Δ·Ͱɺͦͷ1ͭͷϦΫΤετʹઐ༗͞Εͯ͠·͏ • ಉظతͳAPIͰ͸ݺͼग़͠ઌ͕٧·Δͱɺυϛϊ౗͠తʹݺͼग़͠ݩ΋٧·ͬͯ͠·͏ • Why reactive(Non Blocking I/O using event loop)? • async͸ϒϩοΩϯάͰ΋࣮ݱͰ͖Δ͚Ͳʢྫ͑͹ɺεϨουϓʔϧͰͷasyncʣɺ
 େྔͷϦΫΤετΛॲཧ͢Δ৔߹ɺεϨουΛ࡞ΔͨΊͷαʔόϦιʔε͕୔ࢁඞཁ • ͦΕΛղܾ͢ΔͨΊͷNon Blocking I/O

Slide 12

Slide 12 text

Features for microservices • Dynamic Configuration • service discovery • DNS-based • ZooKeeper-based • Central Dogma-based • Deployment Models • Client-side load balancing • FYI: • https://www.usenix.org/conference/srecon19americas/presentation/nolan-loadbalancing • https://www.linkedin.com/pulse/microservices-client-side-load-balancing-amit-kumar-sharma/

Slide 13

Slide 13 text

Features for microservices • Observability • Metrics • Distributed Tracing • Access Logs See also: LINE ShopνʔϜͰͷPrometheus/Grafana/Zipkin/Elasticsearch/KibanaΛ࢖ͬͨαʔϏεϞχλϦϯά https://speakerdeck.com/line_developers/service-monitoring-with-prometheus-grafana-zipkin- elasticsearch-kibana-at-line-shop-team

Slide 14

Slide 14 text

Features for microservices • Resilience • Circuit Breaker • ݺͼग़͠ଆͰFailFastExceptionΛcatchͯ͠fallbackॲཧ͕Մೳ • Automatic retry (with Backoff+Jitter) • Rate limit (i.e. Throttling) • Health check

Slide 15

Slide 15 text

Central Dogmaೖ໳

Slide 16

Slide 16 text

ࢀߟࢿྉ • Official site
 https://line.github.io/centraldogma/ • LINE DEVELOPER DAY 2017 - Central Dogma LINE's Git-backed highly-available service configuration repository • https://www.slideshare.net/linecorp/central-dogma-lines-gitbacked- highlyavailable-service-configuration-repository • https://www.youtube.com/watch?v=BmgizIFwMq4

Slide 17

Slide 17 text

What is Central Dogma? • Service configuration repository • Based on Git, ZooKeeper and HTTP/2 • Version controlled • Highly Available • Mirroring from an external Git repo • Change notification • Client libraries • Java • Golang https://github.com/line/centraldogma-go

Slide 18

Slide 18 text

Why use Central Dogma? • ΞϓϦ΍ίϯςφΠϝʔδͷ࠶Ϗϧυ΍σϓϩΠແ͠Ͱઃఆͷಈతมߋ ͕Ͱ͖Δ • ಈతʹมߋ͢Δඞཁ͕ͳ͍΋ͷ͸ΞϓϦͷઃఆϑΝΠϧʹهड़ • ಈతʹઃఆ͍ͨ͠΋ͷ͸Central DogmaͰ؅ཧ • e.g. APIαʔόϦετ, Rate limitઃఆ, ϒϥοΫϦετ, A/BςετͳͲ

Slide 19

Slide 19 text

ArmeriaͱCentral DogmaΛ࢖ͬͨ αϯϓϧΞϓϦͰػೳ঺հ

Slide 20

Slide 20 text

αϯϓϧΞϓϦΛ࢖ͬͨσϞ • source code: https://github.com/matsumana/armeria-sandbox • k8sʹΞϓϦΛσϓϩΠ • k8sͷAPIαʔό͔ΒService discoveryͯ͠ɺCentral DogmaʹPod৘ใ Λอଘ • Rate limitͷઃఆΛCentral DogmaͰ؅ཧ • Central DogmaͷUIͰRate limitΛߋ৽ͯ͠ɺCircuit Breakerͷಈ͖Λݟ ͯΈΔ

Slide 21

Slide 21 text

αϯϓϧΞϓϦ Overview

Slide 22

Slide 22 text

Demo

Slide 23

Slide 23 text

Thank you :)