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

"Microservices" is dead. Long live "Microservic...

qsona
December 21, 2018

"Microservices" is dead. Long live "Microservices". #ginzarails

銀座Rails #4

qsona

December 21, 2018
Tweet

More Decks by qsona

Other Decks in Technology

Transcript

  1. "Microservices" is dead.
 Long live "Microservices". @qsona / FiNC Technologies

    Inc. 2018-12-21 ۜ࠲Rails#4 @ϦϯΫΞϯυϞνϕʔγϣϯ #ginzarails
  2. Over the years, the "Microservices rhetoric" got louder and angrier.

    More mean-spirited. ௕೥ʹΘͨͬͯɺϚΠΫϩαʔϏεͷϨτϦοΫ
 (੣࣮͞ͷͳ͍ඒࣙྷ۟)͸ɺ ͏Δ͘͞ɺౖΓͬΆ͘ɺڱྔʹͳ͖ͬͯͨɻ
  3. ͜Ε͸ͳʹ • TDD is dead. Long live testing. (by DHH)


    ͱ͍͏໊ΤϯτϦͷվม • ͝ଘ͡ͳ͍ํ͸
 ςετۦಈ։ൃ
 ෇࿥CΛඞಡʂ
  4. Microservices ݪཧओٛ...? • গͳ͘ͱ΋ Martin Fowler ΍ Sam Newmanͷ ͜ͱͰ͸ͳ͍

    • ൴Βͷൃ৴͸ɺͱͯ΋ͱͯ΋੣࣮ • Ұ෦Λ੾Γऔ֦ͬͯେղऍ͠ɺڧ͗͢Δൃ৴ ͕ͳ͞ΕΔ͜ͱ͕͋Δ
  5. "Microservices" as an Ecosystem • Docker, Kubernetes, ECS / GKE

    • CI/CD πʔϧ • Envoy, Service Mesh (Istio, AWS App Mesh) • ϚΠΫϩαʔϏεͷʮσϝϦοτʯΛফ͢ྖҬ • ೥ʑਐԽ͍ͯ͠Δ
  6. Concept & Ecosystem • ίϯηϓτΛ஌Γɺඞཁͳͱ͖ʹऔΓೖΕΔ͜ͱͰɺϝ ϦοτΛڗड͠ɺ • ΤίγεςϜʹ͏·͘৐Δ͜ͱͰɺ
 σϝϦοτΛݮΒ͢ •

    ͦ͏͍͏͏·͍෇͖߹͍ํΛ͢Ε͹ɺϚΠΫϩαʔϏε ͸ΈΜͳͷຯํʹͳΔ • ͱ͍͏ओுΛ͜Ε͔Β͍͖͍ͯͨ͠
  7. Rails Λ֦ு͠ͳ͍ • ͋Δఔ౓ͷൣғ·Ͱ͸ Rails ( + PlainͳΫϥ ε )

    Ͱ͏·͘΍Γ • Rails Ͱ͏·͘΍ΕΔൣғΛӽ͖͑ͯͨΒɺ αʔϏεΛ෼ׂ͍ͯ͘͠ɺͱ͍͏ߟ͑ํ
  8. Α͋͘ΔγφϦΦ • αʔϏεͷϦϦʔεͱ؅ཧը໘ͷϦϦʔε͸෼཭͍ͨ͠ Ͷɾɾɾ • ؅ཧը໘༻ͷRails͕ര஀ • Shared Database Pattern

    ΍ Shared ORM Pattern (෼அ͞ ΕͨϞϊϦε) • ςʔϒϧͷεΩʔϚมߋͳͲ͕͓ޓ͍ʹӨڹ͢ΔΑ͏ʹ ͳͬͯਏ͍
  9. ΞΧ΢ϯτͷ౷߹ • SAML ౳ͷඪ४ٕज़Λར༻ͨ͠ Single Sign-onΛ࣮૷ ͢Δ (language-agnostic) • ͦͷ্ͰɺRailsʹ޲͚ͨศརͳํ๏΋༻ҙ͢Δ

    • ྫ͑͹ɺ Rails Engine ͷgemΛಋೖ͢Δ͚ͩͰͰ͖ ΔΑ͏ʹ͢Δ • ඪ४ + ศརϥΠϒϥϦͷೋஈߏ͑
  10. Micro Frontends • ͜ͷಓΛಥ͖٧Ί͍ͯ͘ͱ Micro Frontends
 ͱ͍͏ΞʔΩςΫνϟʹͳ͍ͬͯ͘ • ֤αʔϏε͕ Web

    Components Λఏڙ͠ɺ
 ౷߹ϨΠϠʔ͕ͦΕΒΛ഑ஔ͢Δ • ֤Component͸ΠϕϯτͳͲͰڠௐͯ͠ಈ͘
  11. FiNC ❤ Micro Frontends • Micro Frontends ͷಓ͸զʑ͕ઌಋ͢Δ • ຊ౰ʹඞཁͱ͍ͯ͠Δ͔Β΍Δ

    • ΋ͪΖΜɺ୭΋͕ඞཁͱ͢ΔΞʔΩςΫνϟͰ ͸ͳ͍ • େࣄͳͷ͸ɺઌʹਐΈ͍ͨͱ͖ͷಓ͕͋Δ͜ͱ
  12. Rails ͱ Ϋϥ΢υαʔϏε • Web αʔϏεͷकඋൣғͷ֦େ • ྫ͑͹ IoT ͷձࣾ

    => AWS IoT ͱͦͷपลͷ ϚωʔδυαʔϏεΛϑϧ׆༻͍ͨ͠ • ͚ͩͲɺWebαʔϏε΍ϞόΠϧΞϓϦ޲͚ API͸ Rails Ͱఏڙ͍ͨ͠
  13. ΞʔΩςΫνϟͷҰྫ • Web αʔϏε͸ Rails • AWS ޲͚ʹ͸ Serverless Framework

    Λར༻͢Δ • ࣮ଶͱͯ͠͸ AWS Lambda ʹσϓϩΠ͞ΕΔ • ϝϦοτ • Web API ΍ SNS/SQSͰͷΠϕϯτͳͲɺ࿈ܞΛ͢Δͷ͕؆୯ʹग़དྷΔʂ • AWS IoT ΍ DynamoDB ͳͲͷ௿ϨϕϧͳίϯϙʔωϯτΛ Rails ͕ҙࣝ ͠ͳ͍Ͱྑ͘ͳΓɺૄ݁߹ʹͳΔ
  14. ྫ: Web API ࢓༷ • Web API ΛͲͷΑ͏ͳܗࣜͰఏڙ͢Δ͔? • RESTful

    + JSON + OpenAPI • RESTful + ಠࣗϑΥʔϚοτ + JSON + Open API • JSON API (RESTfulͳAPIͷҰͭͷ࢓༷) • Netflix/fast_jsonapi : JSON API ܗࣜΛαϙʔτ͢Δgem • GraphQL + JSON • gRPC + Protocol Buffers
  15. ྫ: Web API ࢓༷ • RESTful + OpenAPI ͳΒɺ࠷ѱOpenAPI͕ඇରԠͷݴޠΛ ࢖ͬͯ΋μϝʔδ͕গͳ͍

    • ಠࣗϑΥʔϚοτ΍ࣗલϥΠϒϥϦΛఆٛ͗͢͠Δͱɺଞͷݴ ޠʹߦͬͨͱ͖ʹ͖͍ͭΑͶ.. • JSON API, GraphQL, gRPC • ίϛϡχςΟͷαϙʔτঢ়گ͸Ͳ͏͔ʁ • ࠷ѱɺࣗ෼Ͱ࣮૷ͨ͠ΓOSSߩݙͰ͖ΔϨϕϧ͔ʁ
  16. ݴ͍͔ͨͬͨ͜ͱ • "ϚΠΫϩαʔϏε" ͱ͍͏ݴ༿ʹଉۤ͠͞Λײͨ͘͡ͳ ͍ɾײͯ͡΄͘͠ͳ͍ • RailsΤϯδχΞʹ "ࣗ෼ʹ͸ϚΠΫϩαʔϏε͸ؔ܎ͳ͍" ͳΜͯࢥͬͯ΄͘͠ͳ͍ •

    খ͞ͳ૊৫Ͱ΋ϚΠΫϩαʔϏεΛҙ͍͍ࣝͯ͠ • "ϚΠΫϩαʔϏε΍ͬͯ·͢" ͬͯݴͬͨΒୟ͔ΕΔੈͷ த͸·ͬͽΒͩ