From O(N³) to O(1): Scaling M2M Validation in Django
Adding a few cities to a delivery zone is instant. Adding 5,000 cities ran over 5,000 database round-trips and regularly timed out the request. The root causes were two common Django patterns that don
blog.acel.dev7 min read