Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GraphQL を活用したスキーマ駆動開発の実践 / schema-driven develo...
Search
qsona
September 08, 2021
Technology
6
4.9k
GraphQL を活用したスキーマ駆動開発の実践 / schema-driven development with GraphQL
MIDAS TECH STUDY #2
qsona
September 08, 2021
Tweet
Share
More Decks by qsona
See All by qsona
サーバー間 GraphQL と webmock-graphql の話 / server-to-server graphql and webmock-graphql
qsona
4
310
Backend エンジニア視点からの GraphQL / GraphQL from a perspective of backend engineer
qsona
28
7.8k
3 Practices about Service-to-Service GraphQL Ruby Client
qsona
1
790
いかにして GraphQL を組織に導入するか (新規開発編) / how we introduce GraphQL on scratch development
qsona
6
3.8k
Well-organized Transaction Script - リファクタリングの妥協的手法 -
qsona
4
1.2k
GraphQL と Prisma から考える次のN年を見据えた技術選定 / Architecture decision for the next N years at StudySapuri
qsona
25
13k
最高のマスターデータ管理手法考察 & VSCode Extension を活用した話 / developing masterdata management tool by using vscode extension
qsona
9
6k
GraphQL を利用したアーキテクチャの勘所 / Architecture practices with GraphQL
qsona
37
15k
純粋培養GraphQL / Pure GraphQL Architecture
qsona
9
2.9k
Other Decks in Technology
See All in Technology
Agile in Automotive Industry, puzzles and lights.
hiranabe
2
940
Road to Single Activity
yurihondo
1
220
プログラム検証入門
riru
6
820
株式会社M2X エンジニアチーム紹介資料
m2xsoftware
0
660
四国クラウドお遍路 2024 in 高知 オープニング
yukataoka
0
190
「認証認可」という体験をデザインする ~Nekko Cloud認証認可基盤計画
logica0419
2
400
JEP 480: Structured Concurrency
aya_ebata
0
130
Autonomous Database Serverless 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
15
40k
AWS SAW を広めたい @四国クラウドお遍路
kazzpapa3
0
230
OR学会2024秋_短期収益と将来のオフ方策評価性能を考慮したクーポン割当方策混合比の決定
recruitengineers
PRO
4
440
Estrategias de escalabilidade para projetos web
jessilyneh
2
240
DuckDB雑紹介(1.1対応版)@DuckDB座談会
ktz
6
1.3k
Featured
See All Featured
Ruby is Unlike a Banana
tanoku
96
11k
GraphQLとの向き合い方2022年版
quramy
43
13k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
28
1.6k
Creatively Recalculating Your Daily Design Routine
revolveconf
215
12k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
58k
KATA
mclloyd
27
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
23
1.7k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
How to name files
jennybc
75
98k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Designing for humans not robots
tammielis
248
25k
Git: the NoSQL Database
bkeepers
PRO
425
64k
Transcript
GraphQL Λ׆༻ͨ͠ εΩʔϚۦಈ։ൃͷ࣮ફ @qsona 2021-09-08 MIDAS TECH STUDY #2
whoami • @qsona • Web Engineer at Quipper Ltd •
Microservices / Rails / Node.js / GraphQL
ࠓճͷςʔϚ: ϑϩϯτΤϯυ։ൃޮԽ
։ൃʹ͓͚ΔʮޮԽʯͱ?
Ϧιʔεޮͱϑϩʔޮ • ΞδϟΠϧ։ൃͷจ຺ͰΑ͘ొ͢Δ֓೦ • ʮޮʯ(Efficiency) Λೋͭͷଆ໘͔Βఆ͍ٛͯ͠Δ
Ϧιʔεޮ γεςϜ։ൃͷจ຺ʹ͓͍ͯɺେࡶʹ͍͏ͱ: • ਓతϦιʔεͷྔ (ਓɾ) ʹରͯ͠ɺੜΈग़ͤΔػೳͷྔ • Ϧιʔεޮ͕ѱ͍ྫ • ϑϩϯτΤϯυͷ։ൃ͕։࢝Ͱ͖Δͷɺ
όοΫΤϯυͷ։ൃ͕ऴΘ͔ͬͯΒ => όοΫΤϯυͷ։ൃྃ·ͰɺϑϩϯτΤϯδχΞ͕Ջ͍ͯ͠Δ
ϑϩʔޮ γεςϜ։ൃͷจ຺ʹ͓͍ͯɺେࡶʹ͍͏ͱ: • Ϣʔβʔʹػೳ͕ϦϦʔε͞ΕΔ·Ͱͷɺ࣌ؒͷ͞ • ϦϦʔε͞Εͳ͍ͱՁʹͳΒͳ͍ɻ ՁʹͳΔ·Ͱͷ͕͍ͪ࣌ؒͱޮ͕ѱ͍ɺͱ͍͏ߟ͑ํ • ϑϩʔޮ͕ѱ͍ྫ •
ػೳͷ͏ͪόοΫΤϯυͷ։ൃ͕ͨ͠ɺϑϩϯτΤϯυͷ։ൃ͕·ͩɻ όοΫΤϯυࢹͰϦϦʔεͪͷঢ়ଶ͕͘ଓ͍͍ͯΔ
εΩʔϚۦಈ։ൃͱ ։ൃޮ
લఏɾԾఆ • ࠷ۙͷΞϓϦέʔγϣϯ։ൃ͍͠ શһ͕ͯ͢ͷྖҬΛ͜ͳ͢ͷࠔ • େ͖͘ϑϩϯτΤϯυɾόοΫΤϯυͰ εΩϧηοτ͕͔ΕΔʹ͋Δ • ࠓճ όοΫΤϯυνʔϜ
ͱ ϑϩϯτΤϯυνʔϜ ͕ଘࡏ͢Δঢ়گΛԾఆ͢Δ
ґଘ͕ؔ͋Δ • ґଘؔ ϑϩϯτΤϯυ => όοΫΤϯυ • όοΫΤϯυ͕ఏڙ͢Δ API Λ
ϑϩϯτΤϯυ͕ར༻͢Δ • ૉʹߟ͑ΔͱɺόοΫΤϯυ => ϑϩϯτΤϯυͷॱͰ։ൃ ͢Δ͜ͱʹͳΔ => ޮ͕ѱ͍ (࣍ϖʔδ͔Βઆ໌)
(1) ϑϩʔޮ͕ѱ͍ • όοΫΤϯυͰ࣮͞Εͨػೳ͕ɺ σϓϩΠ͞ΕΔ·Ͱʹ ͕ͪ࣌ؒͰ͖Δ
(2) Ϧιʔεޮ͕ѱ͍ • ϑϩϯτΤϯδχΞ͕࣮ͪͷؒɺՋʹͳͬͯ͠·͏
(2) Ϧιʔεޮ͕ѱ͍ • ෳͷػೳΛॱʹճ͢͜ͱͰվળՄೳ • ͕ɺݱ࣮ʹ͜Μͳʹ៉ྷʹ͍͔ͳ͍ • όοΫΤϯυͷ࣮͕গ͠ͰΕΔͱɺϑϩϯτΤϯυͷՋ͕ൃੜͯ͠͠·͏
ͦ͜Ͱ εΩʔϚۦಈ։ൃ
εΩʔϚۦಈ։ൃ • ͡Ίʹ API ͷεΩʔϚΛఆΊɺ ϑϩϯτΤϯυ - όοΫΤϯυ ؒͰ߹ҙ͢Δ •
ϑϩϯτΤϯυɺόοΫΤϯυͷ API ͷ࣮Λͨͣʹ API εΩʔϚΛར༻࣮ͯ͠։࢝͢Δ • ΫϥΠΞϯτ্Ͱͷ੩తܕɺϞοΫαʔόʔͳͲ͕ಘΒΕɺ ͋Δఔෆ߹ͳ͘։ൃͰ͖Δ
εΩʔϚۦಈ։ൃͱ։ൃޮ • (1) ϑϩʔޮͷد༩ • (2) Ϧιʔεޮͷد༩
(1) ϑϩʔޮͷد༩ • όοΫΤϯυͱϑϩϯτΤϯυ͕ฒྻͰ։ൃͰ͖ΔͷͰɺ ϑϩϯτΤϯυͷͪ࣌ؒΛͳͤ͘Δ
(2) Ϧιʔεޮͷد༩ • όοΫΤϯυͱϑϩϯτΤϯυͷ։ൃͷґଘؔΛͳͤ͘ΔͷͰɺ ͦΕͧΕͷ։ൃͷॱং͕ࣗ༝ʹͳΔ • ݁Ռͱͯ͠ɺϦιʔεޮΛ͍ٻΊΔ͜ͱ͕ՄೳʹͳΔ
ελσΟαϓϦʹ͓͚Δ GraphQLɾεΩʔϚۦಈ։ൃͷ ࣮ફࣄྫ
None
৽ن։ൃϓϩδΣΫτʹ͍ͭͯ • ։ൃ͢Δͷ • iOS / Android / PC Web
Apps • Backend APIs • ίϯςϯπΛཧ͢ΔγεςϜ • ։ൃظؒ: > 1 • ։ൃऀͷਓ: > 10ਓ
৽ن։ൃʹ GraphQL Λશ໘࠾༻ • client => gateway => backends શମͰ
GraphQL Λ࠾༻ • gateway schema stitching Λར༻͍ͯ͠Δ • ͦͷଞར༻ٕज़ • Ruby on Rails • Node.js + TypeScript + Apollo Server + Prisma 2 • React, Apollo Client
εΩʔϚۦಈ։ൃͷԸܙ • ίϛϡχέʔγϣϯͷϩε͕গͳ͘ɺ ҆ఆͯ͠։ൃΛਐΊΒΕͨ • ϦιʔεޮΛٻΊɺ backend / frontend ͦΕͧΕ
~9ϲ݄ؒ ಠཱͯ͠։ൃͨ͠ • ܨ͗͜ΈεϜʔζ • 1िؒͰશ෦ܨ͗͜Έྃͨ͠
εΩʔϚۦಈ։ൃʹ GraphQL Λར༻͢ΔϝϦοτ • εΩʔϚͱ࣮͕ဃ͍͢͠ͱɺܨ͗͜Έ࣌ʹൃ֮͢Δ͕૿͑ɺ࣌ؒ ͕͔͔Δ (=ޮ͕Լ͕Δ) • GraphQL Λར༻͢ΔͱɺαʔόʔɾΫϥΠΞϯτํͰ
εΩʔϚͱ࣮ͷဃ͕ى͖ʹ͍͘ • αʔόʔ: εΩʔϚΛຬͨ͞ͳ͍ϨεϙϯεΛฦͦ͏ͱ͢ΔͱΤϥʔʹͳΔ • ΫϥΠΞϯτ: ੩తܕΛࣗಈੜ͠ɺར༻Ͱ͖Δ
ฐνʔϜʹ͓͚Δ GraphQL εΩʔϚۦಈ։ൃͷϑϩʔ • εΩʔϚ࠷ऴతʹ GraphQL Gateway ʹఆٛ͞ΕΔɻ ͜Ε֤ Backend
Service ʹఆٛ͞Εͨͷ͕ू͞Ε͍ͯΔ • ϑϩϯτΤϯυओಋͰεΩʔϚΛॻ͘ͱ͖ Ұ୴ GraphQL Gateway αʔϏεʹॻ͘ • ϞοΫαʔόʔͱͯ͠ఏڙͰ͖Δ • ࣮࣌ʹɺεΩʔϚఆٛΛ֤όοΫΤϯυαʔϏεʹҠಈ͢Δ • ※ ͜ͷ෦Ͱͪΐͬͱͨ͠Έ͋Γ (ӈͷπΠʔτ)
Q. ୭͕εΩʔϚΛॻ͖͔͘? • A. ͦͷػೳͷಛੑʹΑΔ • ࠷ऴతʹ߹ҙͰ͖ΕΑ͍ɻ୭͕ॻ͍ͯΑ͍ • ϑϩϯτΤϯυΤϯδχΞϓϩμΫτϚωʔδϟʔ͕εΩʔϚΛॻ͚Δͱɺ ϑϩʔޮԽʹͭͳ͕Δ
• ։ൃͷग़ൃͰ͋Δʮཁٻʯʹ͍ۙ • όοΫΤϯυ࣮͕͍͠ػೳɺόοΫΤϯυΤϯδχΞ͕ఆٛͨ͠΄͏͕ྑ͍ • ࣮Ͱ͖ͳ͍εΩʔϚʹҙຯ͕ͳ͍ͨΊ
Q. ୭͕εΩʔϚΛॻ͖͔͘? • εΩʔϚઃܭʹίπ͕͋Γɺ୭͕ॻ͘ʹͯ͠ମಘ͢Δඞཁ͕͋Δ • ը໘༷ͱDBઃܭͷؒʹ͋ΔʮϦιʔεʯΛ͏·͘ଊ͑Δ • GraphQL ͷ߹ͦΕΛ GraphQL
Type ͱͯ͠දݱ͢Δ • ͭ·ΓɺϑϩϯτΤϯυΤϯδχΞͰ͋ΕDBઃܭΛΠϝʔδ͠ɺ όοΫΤϯυΤϯδχΞͰ͋Εը໘࣮ΛΠϝʔδͰ͖Δͱ͏·͘ ͍͖͍͢
·ͱΊ • εΩʔϚۦಈ։ൃΛ࣮ફ͢Δ͜ͱͰɺ Ϧιʔεޮ·ͨϑϩʔޮΛߴΊΔ͜ͱ͕Ͱ͖Δ • GraphQL Λར༻͢Δͱɺͭͳ͗͜Έͷਫ਼ඇৗʹߴ͍ • εΩʔϚ୭͕ॻ͍ͯΑ͍ɻ ରػೳͷಛੑɺνʔϜͷঢ়گͳͲʹΑͬͯม͑ΔͱΑ͍
We're hiring! • GraphQL, Microservices ͪΖΜ ϑϩϯτΤϯυ͔ΒόοΫΤϯυ·Ͱ ͍ٕज़ʹ৮ΕΒΕΔػձ͋Γ • ·ͣΧδϡΞϧ໘ஊ͔Βɺͥͻ͝Ԡื͍ͩ͘͞
😁