正文
- 使用 Python 和 FastAPI 构建 Web API:我主要用 Python 开发,所以这对我来说是很自然的选择。如果你是 JavaScript/TypeScript 开发者,你可能会做出不同的选择。我发现 FastAPI 非常易用,且适合部署基于 Python 的可扩展 Web 服务(API)。
Uvicorn to run the backend application server (to execute code and serve web pages) for local testing on my laptop.
- 使用 Uvicorn 运行后端应用服务器(用于执行代码和提供网页服务),以在笔记本电脑上进行本地测试。
If deploying on the cloud, then either Heroku for small apps or AWS Elastic Beanstalk for larger ones (disclosure: I serve on Amazon's board of directors): There are many services for deploying jobs, including HuggingFace Spaces, Railway, Google's Firebase, Vercel, and others. Many of these work fine, and becoming familiar with just 1 or 2 will simplify your development process.
- 如果部署在云端,小型应用选择 Heroku,大型应用选择 AWS Elastic Beanstalk(声明:我是亚马逊董事会成员):有很多用于部署任务的服务,包括 HuggingFace Spaces、Railway、Google 的 Firebase、Vercel 等。这些服务大多都很好用,只要熟悉其中一两个就能简化你的开发流程。
MongoDB for NoSQL database: While traditional SQL databases are amazing feats of engineering that result in highly efficient and reliable data storage, the need to define the database structure (or schema) slows down prototyping. If you really need speed and ease of implementation, then dumping most of your data into a NoSQL (unstructured or semi-structured) database such as MongoDB lets you write code quickly and sort out later exactly what you want to do with the data. This is sometimes called schema-on-write, as opposed to schema-on-read. Mind you, if an application goes to scaled production, there are many use cases where a more structured SQL database is significantly more reliable and scalable.