Slide 1

Slide 1 text

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 !

Slide 2

Slide 2 text

Background @JesseTetsuya - There are many kinds of web application frameworks. - REST API developments for micro service architecture and AI / ML projects are in demand.

Slide 3

Slide 3 text

Numbers @JesseTetsuya 1ZUIPO%FWFMPQFST4VSWFZ3FTVMUTz IUUQTXXXKFUCSBJOTDPNMQQZUIPOEFWFMPQFSTTVSWFZ l%FWFMPQFS4VSWFZz IUUQTJOTJHIUTTUBDLPWFSqPXDPNTVSWFZNPTUQPQVMBSUFDIOPMPHJFTXFCGSBNF

Slide 4

Slide 4 text

Questions - How can we choose Python frameworks ? - Which is better Flask 2.0 or FastAPI ? @JesseTetsuya

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

'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

Slide 8

Slide 8 text

Answers 1. Variety of functions and extensions 2. Performance(Speed and Stability) 3. Flexibility of REST API Architecture 4. Learning Cost @JesseTetsuya

Slide 9

Slide 9 text

'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 TJUFHJUIVCDPNqBTL &YUFOTJPOT/POF #VUUIFSFBSFTFWFSBM UIJSEQBSUZMJCSBSJFT *OEFYTFBSDI SFTVMUT RVFSZ TJUFHJUIVCDPNGBTUBQJ @JesseTetsuya 'BTU"1*&YUFOTJPOMJTUIUUQTHJUIVCDPNNKIFBBXFTPNFGBTUBQJ 'MBTL&YUFOTJPOIUUQTqBTLQBMMFUTQSPKFDUTDPNFOYFYUFOTJPOEFW 1. Variety of functions and extensions

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

@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*

Slide 12

Slide 12 text

@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

Slide 13

Slide 13 text

@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).

Slide 14

Slide 14 text

'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 TJUFHJUIVCDPNqBTL &YUFOTJPOT/POF #VUUIFSFBSFTFWFSBM UIJSEQBSUZMJCSBSJFT *OEFYTFBSDI SFTVMUT RVFSZ TJUFHJUIVCDPNGBTUBQJ @JesseTetsuya 'BTU"1*&YUFOTJPOMJTUIUUQTHJUIVCDPNNKIFBBXFTPNFGBTUBQJ 'MBTL&YUFOTJPOIUUQTqBTLQBMMFUTQSPKFDUTDPNFOYFYUFOTJPOEFW 1. Variety of functions and extensions

Slide 15

Slide 15 text

Answers 1. Variety of functions and extension 2. Performance(Speed and Stability) 3. Flexibility of REST API Architecture 4. Learning Cost @JesseTetsuya

Slide 16

Slide 16 text

@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

Slide 17

Slide 17 text

@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

Slide 18

Slide 18 text

@JesseTetsuya 2. Performance(Speed and Stability) *NBHFXSJUUFOCZ5FUTVZB)JSBUBIUUQTUFDIDMBTTJKQFOUSZ 7FHFUB"UUBDL FDIP(&5IUUQcWFHFUBBUUBDL SBUFEVSBUJPOTcUFF

Slide 19

Slide 19 text

'MBTL VXTHJ 'BTU"1* VWJDPSO 4QFFE 4UBCJMJUZ 3FRVFTUT %VSBUJPOT T T -BUFODJFTNT T T T T T T #ZUFT*O #ZUFT0VU 4VDDFTT 4UBUVT$PEFT &SSPS4FU 3FRVFTUT %VSBUJPOT T NT -BUFODJFTNT NT NT NT NT NT NT #ZUFT*O #ZUFT0VU 4VDDFTT 4UBUVT$PEFT &SSPS4FU @JesseTetsuya 2. Performance(Speed and Stability)

Slide 20

Slide 20 text

@JesseTetsuya 2. Performance(Speed and Stability) IUUQTXFCGSBNFXPSLTCFODINBSLOFUMJGZBQQDPNQBSF GGBTUBQJ qBTL IUUQTHJUIVCDPNUIFCFODINBSLFSXFCTJUF IUUQTXFCGSBNFXPSLTCFODINBSLOFUMJGZBQQDPNQBSF GGBTUBQJ qBTL

Slide 21

Slide 21 text

@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 \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 \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 ʜ ʜ

Slide 22

Slide 22 text

@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)

Slide 23

Slide 23 text

'MBTL VXTHJ 'BTU"1* VWJDPSO 4QFFE 4UBCJMJUZ 3FRVFTUT %VSBUJPOT T T -BUFODJFTNT T T T T T T #ZUFT*O #ZUFT0VU 4VDDFTT 4UBUVT$PEFT &SSPS4FU 3FRVFTUT %VSBUJPOT T NT -BUFODJFTNT NT NT NT NT NT NT #ZUFT*O #ZUFT0VU 4VDDFTT 4UBUVT$PEFT &SSPS4FU @JesseTetsuya 2. Performance(Speed and Stability)

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

'MBTL 'BTU"1* 4DBMBCJMJUZGSPNTNBMMUP CJHUFBNT &BTZUPNPEVMBSJ[FUIFDPEF /PSFBEZNBEFQSPKFDUTUSVDUVSF &BTZUPNPEVMBSJ[FUIFDPEF /PSFBEZNBEFQSPKFDUTUSVDUVSF %JSFDUPSZ5FNQMBUF /VNCFST *OEFYTFBSDISFTVMUT RVFSZ TJUFTJUFHJUIVCDPNDPPLJFDVUUFS qBTL *OEFYTFBSDISFTVMUT RVFSZ TJUFTJUFHJUIVCDPNDPPLJFDVUUFSGBTUBQJ @JesseTetsuya 3. Flexibility of REST API Architecture 1BUUFSOTGPS'MBTLIUUQTqBTLQBMMFUTQSPKFDUTDPNFOYQBUUFSOTJOEFYIUNM #JHHFS"QQMJDBUJPOT.VMUJQMF'JMFTIUUQTGBTUBQJUJBOHPMPDPNUVUPSJBMCJHHFSBQQMJDBUJPOT

Slide 26

Slide 26 text

@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

Slide 27

Slide 27 text

@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

Slide 28

Slide 28 text

'MBTL 'BTU"1* 4DBMBCJMJUZGSPNTNBMM UPCJHUFBNT &BTZUPNPEVMBSJ[FUIFDPEF /PSFBEZNBEFQSPKFDUTUSVDUVSF MJLF%KBOHP &BTZUPNPEVMBSJ[FUIFDPEF /PSFBEZNBEFQSPKFDUTUSVDUVSFMJLF %KBOHP %JSFDUPSZ5FNQMBUF /VNCFST *OEFYTFBSDISFTVMUT RVFSZTJUFTJUFHJUIVCDPN DPPLJFDVUUFSqBTL *OEFYTFBSDISFTVMUT RVFSZ TJUFTJUFHJUIVCDPNDPPLJFDVUUFS GBTUBQJ @JesseTetsuya 3. Flexibility of REST API Architecture

Slide 29

Slide 29 text

Answers 1. Variety of functions and extension 2. Performance(Speed and Stability) 3. Flexibility of REST API Architecture 4. Learning Cost @JesseTetsuya

Slide 30

Slide 30 text

'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@

Slide 31

Slide 31 text

@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.

Slide 32

Slide 32 text

@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)

Slide 33

Slide 33 text

@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)

Slide 34

Slide 34 text

@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)

Slide 35

Slide 35 text

'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@

Slide 36

Slide 36 text

'MBTL 'BTU"1* 7BSJFUZ ˓ ˚ 1FSGPSNBODF ˚ ˓ 'MFYJCJMJUZ -FBSOJOH$PTU ˓ ˚ Summary @JesseTetsuya

Slide 37

Slide 37 text

@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.

Slide 38

Slide 38 text

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 !!