This guide shows how to build and deploy a crashproof Python backend for an online store using DBOS and FastAPI.
The guide covers a single service, several REST APIs, and a PostgreSQL database.
The checkout workflow is created and backed out if it fails, returning reserved inventory and marking the order as cancelled.
The guide also shows how to write the HTTP endpoints for payment and checkout and retrieve product information.
The guide concludes with creating a workflow to dispatch orders that have been paid for.
The source code for this example is available on GitHub and also provides additional information on deploying to the cloud and running the app locally.
DBOS serves as a backend to make the application scalable and resilient.
DBOS provides durable execution to write crashproof workflows, uses queues to manage API rate limits gracefully, and scheduled workflows to run functions at recurring intervals.
Other example applications created using DBOS can also be explored.
Overall the guide provides a useful showcase of how to build a crashproof cloud backend in Python using REST and PostgreSQL.