Design django models such that your future self will thank you 👋

Oct 23 1:30 PM CDT :calendar:
Audience level: Intermediate

About This Talk

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.


    Photo of Tarun Garg

    Tarun Garg

    I’m currently working as Engineering Manager at SquadStack, I’ve been here since 5 years and have seen the team and processes grow from 3 member engineering team to a now ~50 people engineering team. Being the early member of the engineering team, I got to experience a fair share of challenges and make a lot of mistakes along the way and that’s why I wanted to share those learnings so that other people don’t make those same mistakes and the community keeps on growing :D.

    More about me? I’ve recently made a step into management and till now(6 months in) i’m liking it; make no mistake it is stressful but rewarding also(in it’s own way). I love solving people, process & product challenges. When not working I can found reading books, or playing some strategic games like Catan or Chess.

    You can read more about me here