Using models and Django ORM
For any organization, data is one of the most important foundational elements in Django, and the models.py
file is used to structure how data is stored in the database. A well-architected system would have a strong Django model foundation, where the developer has spent enough time and done proper research before creating the database schema.
One of the most common questions developers have while designing the schema is whether to perform normalization or denormalization. The answer is always “it depends.” It depends on multiple factors, such as the data access pattern and the performance bottleneck we are trying to solve. So, as a rule of thumb, it is always preferred to start with a normalized database schema design and then, as we find different use cases, try to solve the problem by introducing caching or indexes, and then finally perform denormalization.
Important note
We won’t focus on the basics of how to work with Django...