PyCon Portugal 2023

Django Apps at Scale: Mistakes to Avoid

Every developer makes mistakes while developing new things and experiments. Apparently, those mistakes help us programmers learn more as a developer. I & the team at StackGuardian wrote everything from scratch and in the process, we did a lot of research and experiments to build scalable Django Apps with Microservice Architecture. I’ve learned a lot about what works well and what doesn’t with Django, and hope I can share some useful tips on how to work with this popular web framework.


History:
I started using Python in school and started developing apps with Django in 2018. To enhance my experience and learnings I also worked at an Infrastructure as Code Platform StackGuardian. It’s an OpenSource robust and scalable platform built with Django. We wrote everything from scratch and in the process, we did a lot of research and experiments to build scalable Django Apps with Microservice Architecture. I’ve learned a lot about what works well and what doesn’t with Django, and hope I can share some useful tips on how to work with this popular web framework.

Agenda for the Talk:

→ Monoliths & Microservices Brief Intro & general misconception
I’ll start with a layman's introduction to Monoliths & Microservices so that even beginners get the idea about the terminologies which will be used later. I will also touch upon the common misconception junior engineers or students have about these architectures.

→ Moving away from Monolith
Under this, I’ll be discussing problems with Monolith Architecture or monolith Django Apps. Here I’ll be discussing the problems with monoliths like Adapatability, Single point of failure, More coupling, difficult testing & deployments. Examples of companies that moved from Monolith to Microservice architecture.

→ Why Microservices usage skyrocketed?
Real-world instances of organizations that skyrocketed after switching to Microservices architecture. I’ll be sharing the strategies or high-level changes added. Moving to microservices not only helped us scale but 100s of startups around the globe. The benefits it provided are enabled ownership & less context to new members, parallel development, testing & deployments, and improved fault tolerance. I’ll be explaining these points in detail.

→ Why Django for Microservices, How to make the move & Mistakes to avoid or Best Practices
Understanding Microservice Architecture in Django via a reference app. Multiple factors teams should consider while making the move from monolith to microservices like when the team scales, defining boundaries for each service, separating resources, and inter-process communication. Further, Insights on where we made mistakes like while dealing with multiple Django apps, Unfaithful Migrations, Squash Migrations, Less bulky signals, and Avoid ORM as the main layer. Will be explaining these mistakes.

→ StackGuardian overview & Tirith
In this, I’ll give a bird's eye view of StackGuardian’s architecture and how its open-source tool “Tirith” built with Python will help security engineers to write policies in a human-readable way but still machine enforceable.

→ Key Takeaway & Django Trivia/QnA
I’ll conclude the talk with fun Django Trivia.

Audience:
The target audience for the talk ranges from Beginner to Intermediate Programmers.

I’m Kushal Vijay, A Software Engineer @Microsoft & a Content Creator on YouTube & LinkedIn serving an audience of over 135,000. Previously, I have done Internships at Microsoft and StackGuardian. I have also given Tech talks at PyCon'22 Hong Kong and Xtreme Python'22 conferences. I'm an ACM ICPC’19 Regionalist and also mentored students in Google Code-In’19 for TensorFlow Organization. I have taken 40+ Webinars to date in my Computer Science journey and judged multiple hackathons across Engineering Colleges in India.