Description
While designing Django models, our primary objective is to develop a structure that'll enable us to build the said product feature, but while doing so ~we~ I used to neglect things like a) Ease of debugging/Auditing, b) Query patterns, c) and Scalability, and later when push came to shove these things used to become a blocker. While we can't possibly think and preempt everything from day 1(and if you try to - it'll take long to roll that feature out), we can do something better 🤔.
In this talk, we're going to be focusing on how you can avoid those mistakes early in your design phase 😌 - these are all the learnings I have had after making mistakes. We are going to cover the following -
- Auditing your models
- Boolean field for flags vs. timestamped field
- Soft delete vs. hard delete
- Many boolean flags in a model?
- How do you decide when to de-normalize?
- And much more ...
As with every piece of advice in life, the answer of whether you should apply these or not is - *" it depends."** In this task, we'll also discuss when you can use this advice and when you can choose to skip it.*