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

Rails 経験者が FastAPI 本を読んで感じたこと / 2023-11-28

Rails 経験者が FastAPI 本を読んで感じたこと / 2023-11-28

Takuma Yamamoto

November 28, 2023
Tweet

More Decks by Takuma Yamamoto

Other Decks in Programming

Transcript

  1. Rails ܦݧऀ͕ FastAPI ຊΛಡΜͰײͨ͜͡ͱ
    Takuma Yamamoto

    View full-size slide

  2. BIOGRAPHY
    ͋ͳͨ͸୭Ͱ͔͢ʁ
    5BLVNB:BNBNPUP
    8PSLBUTOBQNF
    'SPN.JZB[BLJ
    ٕज़ελοΫ
    4/4
    झຯ
    ɾόοΫΤϯυ3VCZPO3BJMT
    ɾϑϩϯτΤϯυ3FBDU
    ɾΞϓϦ3FBDU/BUJWF
    ɾɹɹIUUQTHJUIVCDPNUBNBHPLFSBO
    ɾɹɹIUUQTUXJUUFSDPNZBNBUBLV
    ɾɹɹIUUQTRJJUBDPNUBNBHPLFSBO
    ɾɹɹIUUQT[FOOEFWUBNBHPLFSBO
    ɾ͓΍ͭ
    ɾα΢φ
    ɾΞχϝ

    View full-size slide

  3. INTRODUCTION
    લ৬Ͱ͸ Ruby on Rails ͰαʔόʔαΠυΛ։ൃ
    લ৬Ͱ͸೥ؒ3VCZPO3BJMTΛ࢖༻ͯ͠αʔόʔαΠυΛ։ൃͯ͠·ͨ͠ɻ

    8FCଆͷ࣮૷΋͍ͯ͠·ͨ͠͠ɺϞόΠϧΞϓϦͷ"1*Λ࣮૷͍ͯ͠·ͨ͠ɻ

    View full-size slide

  4. INTRODUCTION
    εφοΫϛʔͰ͸ FastAPI Ͱ΋αʔόʔαΠυΛ։ൃ
    εφοΫϛʔͰ͸ɺࣾ಺ΦϖϨʔγϣϯγεςϜΛ3VCZPO3BJMTͰ։ൃ͍ͯ͠·͢ɻ

    ҰํͰίϯγϡʔϚʔ޲͚ͷϓϩμΫτ͸'BTU"1*Ͱ։ൃΛߦ͍ͬͯ·͢ɻ

    View full-size slide

  5. INTRODUCTION
    ΩϟονΞοϓͷͨΊ FastAPI ຊΛखʹऔΓ·ͨ͠
    ΤϯδχΞ࠾༻Λ୲౰͢Δ਎ͱͯ͠ɺࣗࣾͷٕज़ʹؔͯ͠ΩϟονΞοϓ͍ͨ͠ͱࢥ͍·ͨ͠ɻ

    ͦ͜Ͱʮಈֶ͔ͯ͠Ϳʂ1ZUIPO'BTU"1*։ൃೖ໳ʯͱ͍͏ຊΛखʹऔΓ·ͨ͠ɻ

    View full-size slide

  6. TODAY’s TOPIC
    Rails ܦݧऀ͕ FastAPI ຊΛಡΜͰײͨ͜͡ͱΛڞ༗
    ࠓ·Ͱ3VCZPO3BJMTͰͷΈαʔόαΠυΛ։ൃ͖ͯͨ͠ͷͰɺษڧʹͳΔ͜ͱ͕ଟ͔ͬͨͰ͢ɻ

    ࠓճ͸'BTU"1*ຊΛಡΜͰɺັྗʹײͨ͜͡ͱ΍৽઱͞Λײͨ͡෦෼Λڞ༗͠·͢ɻ
    ςοΫϒϩάʹ΋ॻ͍͍ͯΔͷͰͥͻ

    View full-size slide

  7. TODAY’s GOAL
    FastAPI ʹڵຯͷ͋Δ Rails ܦݧऀͷ൑அࡐྉʹͳΕ͹
    3BJMTܦݧऀͷײ૝Λڞ༗ 'BTU"1*Ͱͷ։ൃΛݕ౼
    3BJMTܦݧऀ͕'BTU"1*ຊΛ
    ಡΜͰײ༷ͨ͡ʑͳ͜ͱʹͭ
    ͍ͯɺ঺հ͠·͢ɻ
    3BJMTܦݧऀͰ'BTU"1*ʹڵ
    ຯͷ͋Δํʹͱͬͯͷ൑அࡐ
    ྉʹͳΕ͹خ͍͠Ͱ͢ɻ

    View full-size slide

  8. What is FastAPI?
    ͦ΋ͦ΋ FastAPI ͱ͸ԿͰ͔͢ʁ

    View full-size slide

  9. INTRODUCTION
    High-performance API framework
    'BTU"1*JTBNPEFSO GBTU IJHIQFSGPSNBODF

    XFCGSBNFXPSLGPSCVJMEJOH"1*TXJUI1ZUIPO
    CBTFEPOTUBOEBSE1ZUIPOUZQFIJOUT
    'BTU"1*͸ɺ1ZUIPOͷඪ४Ͱ͋Δܕώϯτʹج
    ͍ͮͯ1ZUIPOҎ߱Ͱ"1*Λߏங͢ΔͨΊ
    ͷɺϞμϯͰɺߴ଎ ߴύϑΥʔϚϯε
    ͳɺ
    8FCϑϨʔϜϫʔΫͰ͢ɻ
    Ҿ༻ݩIUUQTGBTUBQJUJBOHPMPDPN
    UJBOHPMPGBTUBQJ
    'BTU"1*GSBNFXPSL IJHIQFSGPSNBODF FBTZUP
    1ZUIPO

    View full-size slide

  10. What attracted me to the book?
    ࢲ͕ FastAPI ຊΛಡΜͰײͨ͡ັྗతͳ෦෼ʹ͍ͭͯ

    View full-size slide

  11. IMPRESSION
    ෆ۩߹ΛܕఆٛʹΑΓະવʹ๷͙
    1ZUIPO͸ʮܕώϯτʯͷ࢓૊ΈΛ͕࣋ͭɺಈతܕ෇͚ݴޠͰ͋ΔͨΊɺܕΤϥʔ͸ൃੜ͠ͳ͍ɻ

    Ұํ'BTU"1*͸1ZEBOUJDͷྗʹΑΓɺ"1*ͷೖग़ྗʹ͓͍ͯόϦσʔγϣϯΛߦ͍·͢ɻ
    ͦͷͨΊɺϑϩϯτΤϯυͱ઀ଓͯ͠ಈ࡞֬ೝ͢Δલʹෆ۩߹Λݕ஌͢Δ͜ͱ͕Ͱ͖·͢ɻ

    ࡢࠓܕΛ࢖༻ͨ͠։ൃ͕Ұൠతʹͳ͖ͬͯͨϑϩϯτΤϯυ։ൃͱ૬ੑ͕ྑͦ͞͏Ͱ͢ɻ

    View full-size slide

  12. IMPRESSION
    ϑϩϯτΤϯυͱͷڠۀΛεϜʔζʹ͢Δ࢓૊Έ
    ύεΦϖϨʔγϣϯؔ਺ͱϦΫΤετɾϨεϙϯεͷεΩʔϚΛఆٛͨ͠ஈ֊Ͱɺ4XBHHFS6*ͷυ
    Ωϡϝϯτͱ"1*ϞοΫ͕ࣗಈతʹఏڙ͞ΕΔͷͰɺૣ͍ஈ֊͔ΒϑϩϯτΤϯυͷ։ൃΛ։࢝͢
    Δ͜ͱ͕Ͱ͖·͢ɻ
    ͦΕʹΑΓυΩϡϝϯτͷߋ৽࿙Ε΍ͦΕʹ൐ͬͯى͖Δ࣮૷ͷख໭ΓΛɺීஈͷ։ൃͷྲྀΕͰղফ
    ͢Δ͜ͱ͕Ͱ͖Δ࢓૊Έʹͳ͍ͬͯ·͢ɻ

    View full-size slide

  13. IMPRESSION
    อकੑΛߴΊ΍͍͢ΞʔΩςΫνϟʔ
    'BTU"1*ຊͰ঺հ͞Ε͍ͯͨΞʔΩςΫνϟʔͳͷͰ͕͢ɺ3VCZPO3BJMTͱ͸ҧ͍ɺ$36%ͷॲཧ
    ͕3PVUFSʢ.7$ʹ͓͚Δ$POUSPMMFSʣ͔Β੾Γ཭͞Ε͍ͯ·ͨ͠ɻ
    ͦΕʹΑΓɺॲཧ΍ϩδοΫ͕ΧϓηϧԽͰ͖ΔͨΊɺ࠶ར༻ੑ͕޲্͠ɺͦΕʹ൐ͬͯςελϏϦ
    ςΟ΋޲্͢Δ͜ͱ͕Ͱ͖·͢ɻ
    .PEFM
    $POUSPMMFS
    7JFX
    CRUD

    View full-size slide

  14. What did I
    fi
    nd odd in the book?
    ࢲ͕ FastAPI ຊΛಡΜͰ৽઱ʹײͨ͡෦෼ʹ͍ͭͯ

    View full-size slide

  15. IMPRESSION
    ࣗલͰΤΫηϓγϣϯΛฦ͢ඞཁ͕͋Δ
    'BTU"1*ຊͰ͸ɺσʔλ͕ͳ͍࣌ʹ)551ΤΫηϓγϣϯΛฦ͢ॲཧΛࣗΒ࣮૷͍ͯ͠·ͨ͠ɻ

    3VCZPO3BJMTͰ͸"DUJWF3FDPSE΍"DUJPO$POUSPMMFSͷ͓͔͛ͰɺࣗಈͰΤϥʔΛฦ͍ͤͯͨ
    ͷͰɺࣦ೦͠ͳ͍Α͏࣮૷͢Δඞཁ͕͋Δͱࢥ͍·ͨ͠ɻ
    404 Not found…

    View full-size slide

  16. IMPRESSION
    ࣗ༝౓ͷߴ͍ઃܭ͕Մೳ
    3VCZPO3BJMTʹ͸$P$ͱ͍͏ઃܭཧ೦͕͋Γɺ3BJMT8BZʹԊͬͨϓϩάϥϛϯάΛ͢Δ͜ͱͰɺ
    νʔϜ։ൃʹ͓͍ͯ༨ܭͳίϛϡχέʔγϣϯίετ΍υΩϡϝϯτ؅ཧίετͷൃੜΛ࠷খݶʹ͠
    ͍ͯ·ͨ͠ɻ
    Ұํ'BTU"1*͸3VCZPO3BJMTͱൺ΂ͯɺࣗ༝౓ߴ͘ઃܭ͢Δ͜ͱ͕Ͱ͖ΔͨΊɺઃܭॻΛݴޠԽ͢
    ΔͳͲͯ͠ɺνʔϜͰೝࣝΛἧ͑ͳ͕Β։ൃ͢Δඞཁ͕͋Δͱײ͡·ͨ͠ɻ
    ઃఆΑΓن໿
    $P$ʢ$POWFOUJPOPWFS$PO
    fi
    HVSBUJPOʣ
    ࣗ༝౓ͷߴ͍ઃܭ

    View full-size slide

  17. Summary
    Rails ܦݧऀ͕ FastAPI ຊΛಡΜͰײͨ͜͡ͱΛ·ͱΊΔͱ…

    View full-size slide

  18. SUMMARY
    Rails ܦݧऀ͕ FastAPI ຊΛಡΜͰΈͯ…
    ɾෆ۩߹ΛܕఆٛʹΑΓະવʹ๷͙

    ɾϑϩϯτΤϯυͱͷڠۀΛεϜʔζʹ͢Δ࢓૊Έ

    ɾอकੑΛߴΊ΍͍͢ΞʔΩςΫνϟʔ

    ɾࣗલͰΤΫηϓγϣϯΛฦ͢ඞཁ͕͋Δ

    ɾࣗ༝౓ͷߴ͍ઃܭ͕Մೳ

    View full-size slide

  19. Recruitment
    ΤϯδχΞืूதͰ͢ʂ

    View full-size slide

  20. RECRUITMENT
    We are Hiring!
    εφοΫϛʔͰ͸ɺʮ͓΍ͭͱɺੈքΛ໘ന
    ͘ʯ͍ͯ͘͠ɺͦΜͳ׆ಈΛ࢓ࣄͱͯ͠औΓ૊
    Έ͍ͨΤϯδχΞΛืू͍ͯ͠·͢ɻ
    IUUQTUFBNTOBRNFDPN
    εφοΫϛʔ࠾༻

    View full-size slide