Scalable code design with slimmer django model and more01:45 PM - 02:10 PM on July 16, 2016, Room CR5
- Audience level:
When you first start your Django project, adding functionality to your model comes really easy, because IT IS really easy to do so. However, as your application size grow, the code you end up might not be easy to work on anymore. As engineers, we should pay attention to scalability not only in terms of number of requests your server can handle, but also how your application can grow with more features, and more engineers working on it.
Code scalability is the ability to grow, modify, adopt your code without a major refactor, lets say every 6 months with many people working on it at the same time. While I know that it is really hard to predict the future needs, and designing for future proof architecture blindly is a waste of time and effort, I do see the need for some forethought when you put together a solution. A good balance between current need and future need can be achieved without sacrificing a lot of productive time. Common smells that indicate you do not have scalable code design are :
- Engineer cannot gain insight into what the code is doing by quickly reading the code ( bug introduction because of mis-understanding )
- Engineer cannot confidently make change to small area of the code (productivity delay, bug introduction )
- Engineer cannot easily evolve the data structure to support new use cases
- Engineer cannot easily to test, modify isolated business logic
All the the above are usually seen when you have a big Django model file with each model having multiple functionality. I would like to review some basic principles to help us build a scalable software system.