5
Connecting to a Relational Database
Our previous applications have only used Python collections to hold data records instead of persistent data stores. This setup causes data wiping whenever the Uvicorn server restarts because these collections only store the data in volatile memory, such as RAM. From this chapter onward, we will be applying data persistency to avoid data loss and provide a platform to manage our records, even when the server is in shutdown mode.
This chapter will focus on different Object Relational Mappers (ORMs) that can efficiently manage clients’ data using objects and a relational database. Object-relational mapping is a technique where SQL statements for Creating, Reading, Updating and Deleting (CRUD) are implemented ...
Get Building Python Microservices with FastAPI now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.