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

画面に合わせたAPI設計をしたら残業が死ぬほど増えた話

 画面に合わせたAPI設計をしたら残業が死ぬほど増えた話

kinocoboy

March 08, 2022
Tweet

More Decks by kinocoboy

Other Decks in Programming

Transcript

  1. Hiroki Kinoshita Peacock Engineer Group ओ࠵ גࣜձࣾKUNO ϑϩϯτΤϯδχΞ(gcp, aws, angular,

    nuxt) Twitter @kinocoboy2 SELF INTRODUCTION Ϋϥ΢υ × ϩέʔγϣϯϑϦʔ × ஍ํҠॅ Ͱൃ৴தʂ
  2. ը໘ઌߦͰߟ͑Δͱʁ Instagramతͳը໘ΛΠϝʔδͯ͠Έ·͠ΐ͏ ߲໨Λฏ໘తʹଊ͑Δͱɺ λΠτϧ 1 : 1 ೔෇ 1 :

    1 ৄࡉςΩετ 1 : 1 ͍͍Ͷ਺ 1 : N λά 1 : N ೔෇ ͍͍Ͷ਺ Tags λΠτϧ ৄࡉText
  3. ը໘ઌߦͰߟ͑Δͱʁ Instagramతͳը໘ΛΠϝʔδͯ͠Έ·͠ΐ͏ ߲໨Λฏ໘తʹଊ͑Δͱɺ λΠτϧ 1 : 1 ೔෇ 1 :

    1 ৄࡉςΩετ 1 : 1 ͍͍Ͷ਺ 1 : N λά 1 : N ೔෇ ͍͍Ͷ਺ Tags λΠτϧ ৄࡉText
  4. ը໘ઌߦͰߟ͑Δͱʁ Instagramతͳը໘ΛΠϝʔδͯ͠Έ·͠ΐ͏ ߲໨Λฏ໘తʹଊ͑Δͱɺ λΠτϧ 1 : 1 ೔෇ 1 :

    1 ৄࡉςΩετ 1 : 1 ͍͍Ͷ਺ 1 : N λά 1 : N ྫྷ੩ʹݟͨΒɺ ੑ࣭͕ҧ͏͜ͱ͕Θ͔Δ ೔෇ ͍͍Ͷ਺ Tags λΠτϧ ৄࡉText
  5. ը໘ઌߦͰߟ͑Δͱʁ API ΠϯλʔϑΣʔε͸ɺ ೔෇ ͍͍Ͷ਺ Tags λΠτϧ ৄࡉText Request: {

    Title: string, Created: timestamp, detailText: text, Likes: number, Tags: string[], }
  6. ը໘ઌߦͰߟ͑Δͱʁ API ΠϯλʔϑΣʔε͸ɺ ͦͯ͠ςʔϒϧ͸ɺ ೔෇ ͍͍Ͷ਺ Tags λΠτϧ ৄࡉText Request:

    { Title: string, Created: timestamp, detailText: text, Likes: number, Tags: string[], } ౤ߘςʔϒϧ: { Title: string, Created: timestamp, detailText: text, Likes: number, Tags: string[], }
  7. ղܾํ๏ ࠓճͷ৔߹ͰࢲͩͬͨΒɺςʔϒϧΛ̏ͭ ʹ෼͚Δɻ ౤ߘςʔϒϧ: { postId: string, Title: string, Created:

    timestamp, detailText: text, } ͍͍Ͷ਺: { likeId: string, postId: string, } λά: { tagId: string Name: string }
  8. ղܾํ๏ ࠓճͷ৔߹ͰࢲͩͬͨΒɺςʔϒϧΛ̏ͭʹ ෼͚Δɻ ͜ΕͰߋ৽λΠϛϯά΍ର৅ςʔϒϧ΋͹Β ͚ΔͷͰɺσουϩοΫͷස౓͕Լ͕Δ͸ ͣɻ ౤ߘςʔϒϧ: { postId: string,

    Title: string, Created: timestamp, detailText: text, } ͍͍Ͷ਺: { likeId: string, postId: string, } λά: { tagId: string Name: string }
  9. • API͸ࣗ໌Ͱ͋Δ͜ͱΛҡ࣋͢Δ͜ͱ • ௐࠪΛ؆ུʹɻ • ࢖༻ײΛ໌Β͔ʹɻ • σʔλͷੑ࣭΍ߏ଄Λ͔ͬ͠ΓਪᏏ͢Δ͜ͱ • ϞσϦϯά΍DDD,

    Iconix ͸༗ޮɻ • WebAPIΛ࢖͏ͳΒɺͦͷੑ࣭Λ೺Ѳ্ͨ͠Ͱ࢖ ͓͏ɻ ͜Ε͕ແࢹ͞ΕΔͱɺ࢒ۀ͕૿͑ΔΑɻ ݁࿦
  10. Peacock Engineer Group • ڌ఺ • ৽ׁݝ௕Ԭࢢ • PEGͷ໨త •

    ஍Ҭ΍ձࣾɾࣾձਓ΍ֶੜͳͲͷ֞ࠜΛ௒͑ͯɺࣗ ༝ʹٕज़ྗΛߴΊ߹͑ΔίϛϡχςΟʹ!! • PEG͕औΓѻ͏ςʔϚ • ໌೔͔Β࢖͑ΔTips!! • ӡӦελοϑਵ࣌ืूத!!