Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Reactive Microservices Architecture

Go Tanaka
September 09, 2016

Reactive Microservices Architecture

Go Tanaka

September 09, 2016
Tweet

More Decks by Go Tanaka

Other Decks in Technology

Transcript

  1. Microservices Come in Systems (Service Discovery) • ͓ޓ͍ͷαʔϏεͷΞυϨεΛ஌͍ͬͯΔඞཁ͕͋Δ • ͦͷ໾໨Λݞ୅ΘΓ͢Δͷ͕

    Service Discovery • CAPఆཧͷ CP-Based ͱ AP-Based ͕͋Δ • CP-Based … Zookeeper, etcd • AP-Based … Lightbend Reactive Platform, eureka, Serf
  2. Microservices Come in Systems (Managing Communication Patterns) • ίϛϡχέʔγϣϯύλʔϯ΋ෳࡶʹͳͬͯ͘Δ •

    Publish-Subscribe ύλʔϯΛ࢖͏ • Subscriber͸ҎԼͷϥΠϒϥϦ͔ΒσʔλΛऔಘ͢Δ • Kafka, Amazon Kinesis, Cassandra, Riak • ·ͩෆे෼ • σʔλετϦʔϜ … Akka Stream, Apache Camel
  3. Microservices Come in Systems (Back-pressure) • Publish-Subscribe ͷΑ͏ͳύλʔϯͰ͸ Pub ͷॲཧ͕଎

    ͗ͯ͢ Sub ͷॲཧ͕௥͍͔ͭͳ͍͜ͱ͕͋Δ • Subscriber͕ࣗ෼͕ॲཧͰ͖ΔྔΛPublisherʹϦΫΤε τΛૹΔ͜ͱͰແବͳ͘Subscriber͕ॲཧͰ͖ΔྔΛॲ ཧ͢Δ࢓૊Έ • Akka Stream, RxJava, Spark Streaming, Cassandra drivers
  4. Microservices Come in Systems (Circuit Breaker pattern) • ϦϞʔτΞΫηεͷ੒ޭʗࣦഊΛΧ΢ϯτ͠ɺ Τϥʔ

    ཰ (failure rate) ͕ᮢ஋Λ௒͑ͨͱ͖ʹࣗಈతʹΞΫη εΛःஅ͢Δ࢓૊Έ • Netflix Hystrix, Akka (akka.pattern.CircuitBreaker)
  5. Microservices Come in Systems (Event-Driven Architecture) • σʔλͷมߋ͸͙͢ଞͷαʔϏε͔Β΋ར༻Ͱ͖ͳ͍ͱ͍͚ͳ͍ • Event

    Sourcing, CQRS • Command … ෭࡞༻͕͋Δૢ࡞ • Event … Կ͔͕ىͬͨ͜ͱ͍͏ϩά (ࣄ࣮) • Event Logging and Event Streaming Product • Riak, RedBull Eventuate
  6. Summery • Reactive Microservice ʹ͢Δʹ͸ • ҎԼͷಛੑʹݻࣥ͢Δ • ෼཭͢Δ͜ͱ •

    ̍αʔϏεʹ͖ͭ̍ͭͷ੹೚ͷΈ • ഉଞతͳঢ়ଶʹ͢Δ • ඇಉظϝοηʔδύογϯά • ػಈੑ͕͋Δ (Mobility) • ߋʹҎԼͷΑ͏ͳಛੑΛซͤ࣋ͭ • αʔϏεಉ࢜ڠௐͯ͠ಈ࡞͢Δ • ͦͷαʔϏε͚ͩͰ׬݁͢Δ