Creating the database schema and models
In this book, we are building a to-do tracking app, which means we need to store data about the member and their to-dos. We will do so by placing the data into the database, which means we need to define the structure of the data. This structure is called the schema and describes the tables in the database.
While the schema describes the structure of the data in the database, we will use models in the backend and frontend. Each model is a class that represents a row in the database. For example, a table with only an ID could be represented by a class with a single id
attribute.
ORMs
Schemas and models are often conflated as the same thing, especially when an Object Relational Model (ORM) is used. While using an ORM is simpler to begin with, I find it hides important details and makes development harder after a short while. This is why, in this book, the model and schema are related but different. This also means that we’ll write...