Quora Userさんのプロフィール写真

向いていると思います。

他の回答に挙げられている問題点としては動的型付けであることとパフォーマンスですが、FastAPIはそれらもしっかり考慮されています。

まずパフォーマンスについてはFastAPIは従来のWSGIではなくてASGIという非同期処理に対応した新しいPythonのWebAPI仕様に則っていてasync/await構文をしっかり理解して使用し、DBコネクタ関連もasyncio対応の物に置き換えればGoやNodejsレベルとは言いませんが十分に高速に動作します。DjangoやFlaskなどの従来のWSGIよりかは全然速い。ベンチマークの取り方に依存しますが、非同期処理を正しく書ければ10倍はでます。

動的型付けの件についてはFastAPIと内部で利用しているPydanticはPython 3.5から登場したtype hinting機能をエディタの補完補助にとどまらず、積極的に機能として利用していて自動的にリクエストパラメータのvalidationやドキュメント(OpenAPI)の自動生成が可能になっています。特に後者のOpenAPIドキュメント生成は他のフレームワークには見られない機能でこれだけでも採用する価値があると思います。

後発であることがゆえに採用例や情報が少ないというのが懸念になるかもしれませんが、FastAPIは公式サイトのドキュメントが完璧に整備されており、英語はもちろん、日本語でもすでに多くの紹介記事があります。Microsoft, Uber, Netflixなどの一流テック企業も採用しています。

Opinions

"[...] I'm using FastAPI a ton these days. [...] I'm actually planning to use it for all of my team's ML services at Microsoft. Some of them are getting integrated into the core Windows product and some Office products."

Kabir Khan - Microsoft

"We adopted the FastAPI library to spawn a REST server that can be queried to obtain predictions. [for Ludwig]"

Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala - Uber

"Netflix is pleased to announce the open-source release of our crisis management orchestration framework: Dispatch! [built with FastAPI]"

Kevin Glisson, Marc Vilanova, Forest Monsen - Netflix

FastAPI
FastAPI framework, high performance, easy to learn, fast to code, ready for production
この質問に対する他の2件の回答を表示