Save 37% off PRO during our Black Friday Sale! »

Flask 2.0 vs FastAPI in REST API development

32aaa4ac3529ab1886190d7ed5acdcbc?s=47 tetsuya0617
October 16, 2021

Flask 2.0 vs FastAPI in REST API development

Python Conference Talk 2021 at Japan

32aaa4ac3529ab1886190d7ed5acdcbc?s=128

tetsuya0617

October 16, 2021
Tweet

Transcript

  1. Flask 2.0 vs FastAPI in REST API development Tetsuya (Jesse)

    Hirata @JesseTetsuya ———————————————————————————————————————————————————————————————————————————————— Software Engineer at an EdTech company based in Tokyo. I mostly work in both data science and engineering. PyCon 2021 talk at !
  2. Background @JesseTetsuya - There are many kinds of web application

    frameworks. - REST API developments for micro service architecture and AI / ML projects are in demand.
  3. Numbers @JesseTetsuya 1ZUIPO%FWFMPQFST4VSWFZ3FTVMUTz IUUQTXXXKFUCSBJOTDPNMQQZUIPOEFWFMPQFSTTVSWFZ l%FWFMPQFS4VSWFZz IUUQTJOTJHIUTTUBDLPWFSqPXDPNTVSWFZNPTUQPQVMBSUFDIOPMPHJFTXFCGSBNF

  4. Questions - How can we choose Python frameworks ? -

    Which is better Flask 2.0 or FastAPI ? @JesseTetsuya
  5. Approaches Evaluation based on the four criteria between Flask 2.0

    and FastAPI for REST API development 1. Variety of functions and extensions 2. Performance(Speed and Stability) 3. Flexibility of REST API Architecture 4. Learning Cost @JesseTetsuya
  6. Follow up: Flask 2.0 Flask has major version up in

    May 2021 - Nested Blueprint - Async/Await - Type Hinting - 15x speed up of multipart/form-body - Routing shortcut - etc. @JesseTetsuya 'MBTLSFMFTFOPUFIUUQTqBTLQBMMFUTQSPKFDUTDPNFOYDIBOHFT
  7. 'MBTL 'BTU"1* 0WFSWJFX 1ZUIPONJDSPGSBNFXPSLGPSCVJMEJOH XFCBQQMJDBUJPOT 1ZUIPONJDSPGSBNFXPSLCBTFEPO TUBSMFUUFGPSCVJMEJOHXFCBQQMJDBUJPOT VTJOHBTZOD*0 "VUIPS 3FMFBTF%BUF

    -JDFODF "SNJO3POBDIFS #4%DMBVTFMJDFOTF 4FCBTUJÂO3BNÍSF[ .*5-JDFOTF *OUFSGBDF 84(* "4(* Flow up: Summary of Flask 2.0 and FastAPI @JesseTetsuya
  8. Answers 1. Variety of functions and extensions 2. Performance(Speed and

    Stability) 3. Flexibility of REST API Architecture 4. Learning Cost @JesseTetsuya
  9. 'MBTL 'BTU"1* 'VODUJPOT  #MVFQSJOU  3FRVFTU"QQMJDBUJPO$POUFYU  1ZEBOUJD 

     +40/TDIFNB4QIJOY   FUD  "1*3PVUFS  TUBSMFUUDPOUFYU   1ZEBOUJD  0QFO"1*  FUD &YUFOTJPOT  &YUFOTJPOT'MBTL"ENJO 'MBTL"VUI  'MBTL42-"MDIFNZ 'MBTL&NBJM  *OEFYTFBSDI SFTVMUT RVFSZ TJUFHJUIVCDPN qBTL   &YUFOTJPOT/POF #VUUIFSFBSFTFWFSBM UIJSEQBSUZMJCSBSJFT   *OEFYTFBSDI SFTVMUT RVFSZ TJUFHJUIVCDPN GBTUBQJ @JesseTetsuya 'BTU"1*&YUFOTJPOMJTUIUUQTHJUIVCDPNNKIFBBXFTPNFGBTUBQJ 'MBTL&YUFOTJPOIUUQTqBTLQBMMFUTQSPKFDUTDPNFOYFYUFOTJPOEFW 1. Variety of functions and extensions
  10. Pydantic: - Input data validation and settings management using python

    type annotations. -> Pydantic have good match with data class, type hint, mypy, and OpenAPI. OpenAPI: - Swagger Editor - API document editor which has preview function - Swagger UI - Browsing the api documentation based on schemas written on yaml or json - OpenAPI Generator - Generate automatically the client server stub code based on the yaml or json -> Sphinx and JSON schema is recommended, specially in AI/ML projects. Request/Application Context: - Request context keeps track of the request-level data (URL, HTTP method, headers, request data, session info) and allows us to access them by using proxies such as request and session. - Application context keeps track of the application-level data (configuration variables, logger, database connection) allows us to access them by using proxies such as current_app and g. -> Next Slide @JesseTetsuya 1. Variety of functions and extensions
  11. @JesseTetsuya 1. Variety of functions and extensions GSPNGBTUBQJJNQPSU'BTU"1* 3FRVFTU BQQ'BTU"1*

     !BQQHFU   EFGHFU@SFRVFTU@JOGP SFRVFTU3FRVFTU  DMJFOU@IPTUSFRVFTUDMJFOUIPTU SFUVSO\DMJFOU@IPTUDMJFOU@IPTU^ GSPNqBTLJNQPSU'MBTL DVSSFOU@BQQ SFRVFTU KTPOJGZ BQQ'MBTL @@OBNF@@  !BQQHFU   EFGHFU@SFRVFTU@JOGP  DMJFOU@IPTUSFRVFTUDMJFOUIPTU DVSSFOU@BQQMPHHFSJOGP GzSFRVFTU\DMJFOU@IPTU^l  SFUVSOKTPOJGZ \lDMJFOU@IPTUDMJFOU@IPTU^ 'MBTL 'BTU"1*
  12. @JesseTetsuya 1. Variety of functions and extensions 8FC4FSWFS /HJOY"QBDIF 8*4(*4FSWFS

    V84(*(VOJDPSO "QQMJDBUJPO$POUFYU 4UBDL XFSL[FVHMPDBM-PDBM4UBDL 3FRVFTU $POUFYU4UBDL XFSL[FVHMPDBM-PDBM4UBDL 'MBTL"QQMJDBUJPO 'MBTLXTHJ@BQQ  'VODUJPOT (MPCBM 8PSLFS BUISFBE  QSPDFTT  PSDPSPVUJOF 3FRVFTU 3FTQPOTF 4QBXOT 1VTIFT "QQMJDBUJPO1SPYZ DVSFOU@BQQ H 3FRVFTU1SPYZ SFRVFTU TFTTJPO UISFBETBGFBOE UISFBEVOJRVFz
  13. @JesseTetsuya 1. Variety of functions and extensions - Context-Locals are

    implemented by werkzeug.local.LocalStack "QQMJDBUJPO$POUFYU 4UBDL XFSL[FVHMPDBM-PDBM4UBDL 3FRVFTU $POUFYU4UBDL XFSL[FVHMPDBM-PDBM4UBDL (MPCBM $SFBUFUISFBET UISFBE@ DPOUFYU VOJRVFBDDFTT YYYQZ UISFBE@ DPOUFYU VOJRVFBDDFTT UISFBE@ DPOUFYU VOJRVFBDDFTT "DDFTTEBUB $POUFYU-PDBMT ʜ ʜ GSPNXFSL[FVHMPDBMJNQPSU-PDBM1SPYZ GSPNXFSL[FVHMPDBMJNQPSU-PDBM4UBDL ʜ ʜ ʜ DPOUFYUMPDBMT @SFRVFTU@DUY@TUBDL-PDBM4UBDL  @BQQ@DUY@TUBDL-PDBM4UBDL  DVSSFOU@BQQ'MBTL-PDBM1SPYZ @pOE@BQQ UZQFJHOPSF SFRVFTU3FRVFTU-PDBM1SPYZ QBSUJBM @MPPLVQ@SFR@PCKFDU SFRVFTU UZQFJHOPSF TFTTJPO4FTTJPO.JYJO-PDBM1SPYZ UZQFJHOPSF QBSUJBM @MPPLVQ@SFR@PCKFDU TFTTJPO   H@"QQ$UY(MPCBMT-PDBM1SPYZ QBSUJBM @MPPLVQ@BQQ@PCKFDU H UZQFJHOPSF qBTLTSDqBTLHMPCBMQZ - The right picture means that a unique werkzeug.local.LocalStack object has multiple unique threads - The data need to be stored in a way that only one worker(thread) can retrieve back, which means the data get back their own specific data that’s unique to each worker(thread).
  14. 'MBTL 'BTU"1* 'VODUJPOT  #MVFQSJOU  3FRVFTU"QQMJDBUJPO$POUFYU  1ZEBOUJD 

     +40/TDIFNB4QIJOY   FUD  "1*3PVUFS  TUBSMFUUDPOUFYU   1ZEBOUJD  0QFO"1*  FUD &YUFOTJPOT  &YUFOTJPOT'MBTL"ENJO 'MBTL"VUI  'MBTL42-"MDIFNZ 'MBTL&NBJM  *OEFYTFBSDI SFTVMUT RVFSZ TJUFHJUIVCDPN qBTL   &YUFOTJPOT/POF #VUUIFSFBSFTFWFSBM UIJSEQBSUZMJCSBSJFT   *OEFYTFBSDI SFTVMUT RVFSZ TJUFHJUIVCDPN GBTUBQJ @JesseTetsuya 'BTU"1*&YUFOTJPOMJTUIUUQTHJUIVCDPNNKIFBBXFTPNFGBTUBQJ 'MBTL&YUFOTJPOIUUQTqBTLQBMMFUTQSPKFDUTDPNFOYFYUFOTJPOEFW 1. Variety of functions and extensions
  15. Answers 1. Variety of functions and extension 2. Performance(Speed and

    Stability) 3. Flexibility of REST API Architecture 4. Learning Cost @JesseTetsuya
  16. @JesseTetsuya 2. Performance(Speed and Stability) 8): 5IF*0CPVOEQSPDFTTJOHMBSHFMZJOqVFODFTUIFGSBNFXPSLBOEBQQMJDBUJPOTFSWFSTFMFDUJPO XIJMF$16CPVOEQSPDFTTJOHDBOCFSFDPWFSFECZPUIFSUZQFPG1ZUIPOTVDIBT$ZUIPO PSPUIFSMBOHVBHFTFMFDUJPOTCFDBVTF(MPCBM*OUFSQSFU-PDL (*-

    DPOTUSBJOUTJOHMFQSPDFTTBOETJOHMFUISFBE 8)"5 4JNQMFTUBOETBNFBTZODCBTFEDPEFPG'MBTL VXTHJ BOE'BTU"1* VWJDPSO POBTJOHMFXPSLFS )08 5PPMT7FHFUB -0$645 "QBDIF#FODINBSL "QBDIF+.FUFSʜ .FUSJDT-BUFODZ TQFFE 4VDDFTT3BUF TUBCJMJUZ 7FHFUBIUUQTHJUIVCDPNUTFOBSUWFHFUB
  17. @JesseTetsuya JNQPSUBTZODJP JNQPSUUJNF GSPNqBTLJNQPSU#MVFQSJOU 'MBTL BQQ'MBTL @@OBNF@@  BTZOD@BQJ#MVFQSJOU BTZOD@BQJ

    @@OBNF@@  BTZODEFGBTZOD@UBTLT OBNFTUS TFDqPBU TUS QSJOU G\OBNF^TUBSUFE  BXBJUBTZODJPTMFFQ TFD  QSJOU G\OBNF^pOJTIFE  SFUVSOG\OBNF^\TFD^TFD !BTZOD@BQJHFU   BTZODEFGFYFD@BTZOD TUS TUBSUUJNFUJNF  SFTVMUTBXBJUBTZODJPHBUIFS  BTZOD@UBTLT 5BTL"   BTZOD@UBTLT 5BTL#   BTZOD@UBTLT 5BTL$     QSJOU G\SFTVMUT^  QSJOU GQSPDFTTUJNF\UJNFUJNF TUBSU^  SFUVSO"MMUBTLTBSFEPOF BQQSFHJTUFS@CMVFQSJOU BTZOD@BQJ 'MBTLl"TZODz#BTFE$PEF 2. Performance(Speed and Stability) VWJDPSOBQJBTZOD@BQJMPPQBTZODJPXPSLFST JNQPSUBTZODJP JNQPSUUJNF GSPNGBTUBQJJNQPSU'BTU"1* BTZOD@BQJ'BTU"1*  BTZODEFGBTZOD@UBTLT OBNFTUS TFDqPBU TUS QSJOU G\OBNF^TUBSUFE  BXBJUBTZODJPTMFFQ TFD  QSJOU G\OBNF^pOJTIFE  SFUVSOG\OBNF^\TFD^TFD !BTZOD@BQJHFU   BTZODEFGFYFD@BTZOD TUS TUBSUUJNFUJNF  SFTVMUTBXBJUBTZODJPHBUIFS  BTZOD@UBTLT 5BTL"   BTZOD@UBTLT 5BTL#   BTZOD@UBTLT 5BTL$     QSJOU G\SFTVMUT^  QSJOU GQSPDFTTUJNF\UJNFUJNF TUBSU^  SFUVSO"MMUBTLTBSFEPOF 'BTU"1*"TZOD#BTFE$PEF
  18. @JesseTetsuya 2. Performance(Speed and Stability) *NBHFXSJUUFOCZ5FUTVZB)JSBUBIUUQTUFDIDMBTTJKQFOUSZ 7FHFUB"UUBDL FDIP(&5IUUQcWFHFUBBUUBDL SBUFEVSBUJPOTcUFF

  19. 'MBTL VXTHJ 'BTU"1* VWJDPSO 4QFFE 4UBCJMJUZ 3FRVFTUT<UPUBM SBUF UISPVHIQVU> 

     %VSBUJPO<UPUBM BUUBDL XBJU>T T T -BUFODJFT<NJO NFBO     NBY>NT  T T T T T T #ZUFT*O<UPUBM NFBO>  #ZUFT0VU<UPUBM NFBO>  4VDDFTT<SBUJP> 4UBUVT$PEFT<DPEFDPVOU> &SSPS4FU 3FRVFTUT<UPUBM SBUF UISPVHIQVU>   %VSBUJPO<UPUBM BUUBDL XBJU>T T NT -BUFODJFT<NJO NFBO     NBY>NT  NT NT NT NT NT  NT #ZUFT*O<UPUBM NFBO>  #ZUFT0VU<UPUBM NFBO>  4VDDFTT<SBUJP> 4UBUVT$PEFT<DPEFDPVOU> &SSPS4FU @JesseTetsuya 2. Performance(Speed and Stability)
  20. @JesseTetsuya 2. Performance(Speed and Stability) IUUQTXFCGSBNFXPSLTCFODINBSLOFUMJGZBQQDPNQBSF GGBTUBQJ qBTL IUUQTHJUIVCDPNUIFCFODINBSLFSXFCTJUF IUUQTXFCGSBNFXPSLTCFODINBSLOFUMJGZBQQDPNQBSF

    GGBTUBQJ qBTL
  21. @JesseTetsuya TQBXOFEV84(*XPSLFS BOEUIFPOMZ  QJE DPSFT  5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE

    5BTL$pOJTIFE 5BTL"pOJTIFE 5BTL#pOJTIFE <5BTL"TFD 5BTL#TFD 5BTL$TFD> QSPDFTTUJNF <QJEcBQQcSFR> \WBSTJOCZUFT^<4VO0DU>(&5 HFOFSBUFECZUFTJONTFDT )551 IFBEFSTJOCZUFT TXJUDIFTPODPSF  5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE 5BTL$pOJTIFE 5BTL"pOJTIFE 5BTL#pOJTIFE <5BTL"TFD 5BTL#TFD 5BTL$TFD> QSPDFTTUJNF <QJEcBQQcSFR> \WBSTJOCZUFT^<4VO0DU>(&5 HFOFSBUFECZUFTJONTFDT )551 IFBEFSTJOCZUFT TXJUDIFTPODPSF  5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE 5BTL$pOJTIFE 5BTL"pOJTIFE 5BTL#pOJTIFE <5BTL"TFD 5BTL#TFD 5BTL$TFD> QSPDFTTUJNF ʜ ʜ ʜ 'MBTLl"TZODz#BTFE$PEF0VUQVU 2. Performance(Speed and Stability) */'06WJDPSOSVOOJOHPOIUUQ 1SFTT$53- $UPRVJU  5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE 5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE 5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE 5BTL$pOJTIFE 5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE 5BTL$pOJTIFE 5BTL"pOJTIFE 5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE 5BTL"pOJTIFE 5BTL$pOJTIFE 5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE 5BTL$pOJTIFE 5BTL"pOJTIFE 5BTL#pOJTIFE <5BTL"TFD 5BTL#TFD 5BTL$TFD> QSPDFTTUJNF */'0(&5)5510, 'BTU"1*"TZOD#BTFE$PEF0VUQVU 5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE 5BTL"pOJTIFE 5BTL$pOJTIFE 5BTL#pOJTIFE <5BTL"TFD 5BTL#TFD 5BTL$TFD> QSPDFTTUJNF */'0(&5)5510, 5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE 5BTL"pOJTIFE 5BTL$pOJTIFE 5BTL#pOJTIFE <5BTL"TFD 5BTL#TFD 5BTL$TFD> QSPDFTTUJNF */'0(&5)5510, 5BTL$pOJTIFE 5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE 5BTL#pOJTIFE 5BTL"pOJTIFE <5BTL"TFD 5BTL#TFD 5BTL$TFD> QSPDFTTUJNF */'0(&5)5510, 5BTL"pOJTIFE 5BTL$pOJTIFE 5BTL"TUBSUFE 5BTL#TUBSUFE 5BTL$TUBSUFE 5BTL#pOJTIFE <5BTL"TFD 5BTL#TFD 5BTL$TFD> QSPDFTTUJNF ʜ ʜ
  22. @JesseTetsuya Performance test is very difficult only by just comparing

    frameworks… - web server (nginx/apache) - interfaces (WSGI/ASGI) - application server (uwsgi, gunicorn, uvicorn) - libraries (asyncio(explicit) / gevent(implicit)) - application code(sync / async) - language (CPython, Cython…) - architecture from tier one to tier three… - private cloud services(AWS/GCP/Azure…) 2. Performance(Speed and Stability)
  23. 'MBTL VXTHJ 'BTU"1* VWJDPSO 4QFFE 4UBCJMJUZ 3FRVFTUT<UPUBM SBUF UISPVHIQVU> 

     %VSBUJPO<UPUBM BUUBDL XBJU>T T  T -BUFODJFT<NJO NFBO     NBY>NT  T T T T T T #ZUFT*O<UPUBM NFBO>  #ZUFT0VU<UPUBM NFBO>  4VDDFTT<SBUJP> 4UBUVT$PEFT<DPEFDPVOU> &SSPS4FU 3FRVFTUT<UPUBM SBUF UISPVHIQVU>   %VSBUJPO<UPUBM BUUBDL XBJU>T T  NT -BUFODJFT<NJO NFBO     NBY>NT  NT NT NT NT NT  NT #ZUFT*O<UPUBM NFBO>  #ZUFT0VU<UPUBM NFBO>  4VDDFTT<SBUJP> 4UBUVT$PEFT<DPEFDPVOU> &SSPS4FU @JesseTetsuya 2. Performance(Speed and Stability)
  24. Answers 1. Variety of Functions / Extension / Tools 2.

    Performance(Speed and Stability) of sync and async 3. Flexibility of REST API Architecture 4. Learning Cost @JesseTetsuya
  25. 'MBTL 'BTU"1* 4DBMBCJMJUZGSPNTNBMMUP CJHUFBNT  &BTZUPNPEVMBSJ[FUIFDPEF  /PSFBEZNBEFQSPKFDUTUSVDUVSF  &BTZUPNPEVMBSJ[FUIFDPEF

     /PSFBEZNBEFQSPKFDUTUSVDUVSF %JSFDUPSZ5FNQMBUF /VNCFST  *OEFYTFBSDISFTVMUT RVFSZ TJUFTJUFHJUIVCDPN DPPLJFDVUUFS qBTL   *OEFYTFBSDISFTVMUT RVFSZ TJUFTJUFHJUIVCDPN DPPLJFDVUUFSGBTUBQJ  @JesseTetsuya 3. Flexibility of REST API Architecture 1BUUFSOTGPS'MBTLIUUQTqBTLQBMMFUTQSPKFDUTDPNFOYQBUUFSOTJOEFYIUNM #JHHFS"QQMJDBUJPOT.VMUJQMF'JMFTIUUQTGBTUBQJUJBOHPMPDPNUVUPSJBMCJHHFSBQQMJDBUJPOT
  26. @JesseTetsuya 3. Flexibility of REST API Architecture  ᵓᴷᴷ%PDLFSpMF ᵓᴷᴷ3&"%.&NE

    ᵓᴷᴷBQJ ᴹᵓᴷᴷ@@JOJU@@QZ ᴹᵓᴷᴷDPOpH ᴹᴹᵓᴷᴷ@@JOJU@@QZ ᴹᴹᵋᴷᴷCBTFQZ ᴹᵋᴷᴷVSMT ᴹᵓᴷᴷ@@JOJU@@QZ ᴹᵓᴷᴷFOEQPJOUQZ ᴹᵋᴷᴷFOEQPJOUQZ ᵓᴷᴷEPDLFSDPNQPTFZBNM ᵓᴷᴷNPEFMT ᴹᵋᴷᴷNPEFMTQZ ᵓᴷᴷSFRVJSFNFOUTUYU ᵓᴷᴷSVOQZ ᵓᴷᴷUFTUT ᵋᴷᴷWFOW  ᵓᴷᴷ%PDLFSpMF ᵓᴷᴷ3&"%.&NE ᵓᴷᴷBQJT ᴹᵓᴷᴷ@@JOJU@@QZ ᴹᵓᴷᴷDPOpH ᴹᴹᵓᴷᴷ@@JOJU@@QZ ᴹᴹᵓᴷᴷCBTFQZ ᴹᴹᵓᴷᴷTUBHJOHQZ ᴹᴹᵓᴷᴷQSPEVDUJPOQZ ᴹᴹᵋᴷᴷMPDBMQZ ᴹᵓᴷᴷW ᴹᴹᵓᴷᴷ@@JOJU@@QZ ᴹᴹᵓᴷᴷFOEQPJOUQZ ᴹᴹᵋᴷᴷFOEQPJOUQZ ᴹᵋᴷᴷW ᴹᵓᴷᴷ@@JOJU@@QZ ᴹᵓᴷᴷFOEQPJOUQZ ᴹᵋᴷᴷFOEQPJOUQZ ᵓᴷᴷEPDLFSDPNQPTFZBNM ᵓᴷᴷSFRVJSFNFOUTUYU ᵓᴷᴷNPEFMT ᴹᵋᴷᴷNPEFMTQZ ᵓᴷᴷUFTUT ᵋᴷᴷSVOQZ 'MBTLEJSFDUPSZGPSBTNBMMUFBN JOBOJOUFSOBM"1*EFWFMPQNFOU 'MBTLEJSFDUPSZGPSBCJHUFBN JOBOJOUFSOBM"1*EFWFMPQNFOU
  27. @JesseTetsuya 3. Flexibility of REST API Architecture  ᵓᴷᴷ%PDLFSpMF ᵓᴷᴷ3&"%.&NE

    ᵓᴷᴷBQJQZ ᵓᴷᴷVSMT ᴹᵓᴷᴷ@@JOJU@@QZ ᴹᵓᴷᴷFOEQPJOUQZ ᴹᵓᴷᴷFOEQPJOUQZ ᴹᵋᴷᴷSPVUFSQZ ᵓᴷᴷEC ᴹᵓᴷᴷ@@JOJU@@QZ ᴹᵓᴷᴷNPEFMTQZ ᴹᵓᴷᴷTDIFNBTQZ ᴹᵋᴷᴷEBUBCBTFQZ ᵓᴷᴷEPDLFSDPNQPTFZBNM ᵓᴷᴷUFTUT ᵋᴷᴷWFOW  ᵓᴷᴷ%PDLFSpMF ᵓᴷᴷ3&"%.&NE ᵓᴷᴷBQJTQZ ᵓᴷᴷW ᴹᵓᴷᴷ@@JOJU@@QZ ᴹᵓᴷᴷFOEQPJOUQZ ᴹᵋᴷᴷSPVUFSQZ ᵓᴷᴷW ᴹᵓᴷᴷ@@JOJU@@QZ ᴹᵓᴷᴷFOEQPJOUQZ ᴹᵋᴷᴷSPVUFSQZ ᵓᴷᴷEC ᴹᵓᴷᴷ@@JOJU@@QZ ᴹᵓᴷᴷNPEFMTQZ ᴹᵓᴷᴷTDIFNBTQZ ᴹᵋᴷᴷEBUBCBTFQZ ᵓᴷᴷEPDLFSDPNQPTFZBNM ᵓᴷᴷUFTUT ᵋᴷᴷWFOW 'BTU"1*EJSFDUPSZGPSBTNBMMUFBN JOBOJOUFSOBM"1*EFWFMPQNFOU 'BTU"1*EJSFDUPSZGPSBCJHUFBN JOBOJOUFSOBM"1*EFWFMPQNFOU
  28. 'MBTL 'BTU"1* 4DBMBCJMJUZGSPNTNBMM UPCJHUFBNT  &BTZUPNPEVMBSJ[FUIFDPEF  /PSFBEZNBEFQSPKFDUTUSVDUVSF MJLF%KBOHP 

    &BTZUPNPEVMBSJ[FUIFDPEF  /PSFBEZNBEFQSPKFDUTUSVDUVSFMJLF %KBOHP %JSFDUPSZ5FNQMBUF /VNCFST  *OEFYTFBSDISFTVMUT RVFSZTJUFTJUFHJUIVCDPN  DPPLJFDVUUFSqBTL   *OEFYTFBSDISFTVMUT RVFSZ TJUFTJUFHJUIVCDPN DPPLJFDVUUFS GBTUBQJ  @JesseTetsuya 3. Flexibility of REST API Architecture
  29. Answers 1. Variety of functions and extension 2. Performance(Speed and

    Stability) 3. Flexibility of REST API Architecture 4. Learning Cost @JesseTetsuya
  30. 'MBTL 'BTU"1* %J⒏DVMUZUPXSJUF DPEF $PEJOHHSBNNBSJTTJNQMFBOETJNJMBS XJUI'BTU"1* $PEJOHHSBNNBSJTTJNQMFBOETJNJMBS XJUI'MBTL .645LOPXUIFUFSNJOPMPHZBSPVOE BTZODBOECFGBNJMJBSXJUI"4(*

    %J⒏DVMUZUPLOPX IPXUPXSJUFDPEF *OEFY4FBSDI<>  SFTVMUT l'MBTLz"/%"1*TIPSUVSMBULW#&+  .PWJFT<> SFTVMUT l'MBTLz"/% l"1*TIPSUVSMBUU,/7  #PPLT<> SFTVMUT l'MBTLz"/% l"1*TIPSUVSMBU,28  "NB[PO +1&OH <> *OEFY4FBSDI<> SFTVMUT l'BTU"1* "/%"1*TIPSUVSMBUHIMY  .PWJFT<> SFTVMUT l'BTU"1*z"/%l"1* TIPSUVSMBUU,/7  #PPLT<> SFTVMUT l'BTU"1*z"/%l"1* TIPSUVSMBUIQ%25  "NB[PO +1&OH <> @JesseTetsuya 4. Learning Cost <>(PPHMF4FBSDI <>'MBTL +1 IUUQTXXXBNB[PODPKQT L'MBTLJTUSJQCPPLTSFGOC@TC@OPTT <>'MBTL FOH IUUQTXXXBNB[PODPNT L'MBTLJTUSJQCPPLTJOUMTIJQSFGOC@TC@OPTT@ <>'BTU"1* +1 IUUQTXXXBNB[PODPKQT L'BTU"1*JTUSJQCPPLTSFGOC@TC@OPTT@ <>'BTU"1* FOH IUUQTXXXBNB[PODPNT L'BTU"1*JTUSJQCPPLTJOUMTIJQSFGOC@TC@OPTT@
  31. @JesseTetsuya OFF TOPIC Learning Strategies 1. Recognize what you do

    not know and categorize the type of knowledge: Capture the whole picture by reviewing movies, personally recommend python conference archives. 2. Acquire Declarative Knowledge: Google ambiguous terms, link word with meaning, and make relations between a term and a term. Indexes in this previous slides can be useful. 3. Acquire Procedural Knowledge: Focus on writing the code and develop a small application based on tutorial materials or primers.
  32. @JesseTetsuya 4. Learning Cost Learning materials for engineers without Async

    experience 1. Miguel Grinberg Asynchronous Python for the Complete Beginner PyCon 2017 (https://youtu.be/iG6fr81xHKA) 2. An introduction to ASGI, Asynchronous Server Gateway Interface - Philip Jones - PyLondinium19(https://youtu.be/t3gCK9QqXWU) 3. asyncio — Asynchronous I/O (https://docs.python.org/3/library/ asyncio.html)
  33. @JesseTetsuya 4. Learning Cost Learning materials for engineers without FastAPI

    experience 1. Modern Python through FastAPI and friends. Sebastián Ramírez. (https://youtu.be/37CcB2GBdlY) 2. Tutorial - User Guide - Intro (https://fastapi.tiangolo.com/tutorial/#tutorial-user-guide-intro) 3. Talks # 8: Sebastián Ramírez; Build a machine learning API from scratch with FastAPI (https://youtu.be/1zMQBe0l1bM)
  34. @JesseTetsuya 4. Learning Cost Learning materials for engineers without Flask

    experience 1. Armin Ronacher, "Flask for Fun and Profit", PyBay2016 (https://youtu.be/1ByQhAM5c1I) 2. CS50 2020 - Lecture 9 - Flask, Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. (https://www.youtube.com/watch?v=x_c8pTW8ZUc) 3. Tutorial: (https://flask.palletsprojects.com/en/2.0.x/tutorial/index.html)
  35. 'MBTL 'BTU"1* %J⒏DVMUZUPXSJUF DPEF $PEJOHHSBNNBSJTTJNQMFBOE TJNJMBSXJUI'BTU"1* $PEJOHHSBNNBSJTTJNQMFBOE TJNJMBSXJUI'MBTL .645LOPXJEJPNTBSPVOEBTZOD BOECFGBNJMJBSXJUI"4(*

    %J⒏DVMUZUPLOPX IPXUPXSJUFDPEF *OEFY4FBSDI<>  SFTVMUT l'MBTLz "/%"1*TIPSUVSMBULW#&+  .PWJFT<> SFTVMUT l'MBTLz"/%l"1* TIPSUVSMBUU,/7  #PPLT<> SFTVMUT l'MBTLz"/%l"1*TIPSUVSMBU ,28  "NB[PO +1&OH <> *OEFY4FBSDI<> SFTVMUT l'BTU"1*"/% "1*TIPSUVSMBUHIMY  .PWJFT<> SFTVMUT l'BTU"1*z"/%l"1*TIPSUVSMBU U,/7  #PPLT<> SFTVMUT l'BTU"1*z"/%l"1*TIPSUVSMBU IQ%25  "NB[PO +1&OH <> @JesseTetsuya 4. Learning Cost <>(PPHMF4FBSDI <>'MBTL +1 IUUQTXXXBNB[PODPKQT L'MBTLJTUSJQCPPLTSFGOC@TC@OPTT <>'MBTL FOH IUUQTXXXBNB[PODPNT L'MBTLJTUSJQCPPLTJOUMTIJQSFGOC@TC@OPTT@ <>'BTU"1* +1 IUUQTXXXBNB[PODPKQT L'BTU"1*JTUSJQCPPLTSFGOC@TC@OPTT@ <>'BTU"1* FOH IUUQTXXXBNB[PODPNT L'BTU"1*JTUSJQCPPLTJOUMTIJQSFGOC@TC@OPTT@
  36. 'MBTL 'BTU"1* 7BSJFUZ ˓ ˚ 1FSGPSNBODF ˚ ˓ 'MFYJCJMJUZ 

     -FBSOJOH$PTU ˓ ˚ Summary @JesseTetsuya
  37. @JesseTetsuya The Future - ASGI is not PEP yet. -

    There are still many unknown practices of architecture patterns including anti-patterns. The amount of experiences and practices can influence framework selection. - Japanese books of Flask and FastAPI are very rare for us to find them in bookstore. This influences the number of learners and the community size.
  38. Tetsuya (Jesse) Hirata @JesseTetsuya ———————————————————————————————————————————————————————————————————————————————— Software Engineer at an EdTech

    company based in Tokyo. I mostly work in both data science and engineering. If you have an interest in the EdTech domain or in what our team is doing, reach out to me !!