We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

E-Commerce with Django at Scale: Effective Performance Lessons Learned

Formal Metadata

Title
E-Commerce with Django at Scale: Effective Performance Lessons Learned
Title of Series
Part Number
8
Number of Parts
46
Author
Contributors
License
CC Attribution 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
I'll take you through the most effective performance lessons we've learned and show you how you can implement them (with example code). TWO-PASS CACHING WITH CLASS-BASED VIEWS By far, this is one of the most effective performance optimizations we have done in terms of HTTP response time. Using class-based views, we are able to do two-pass caching. On the first pass of the view, we render everything that's not specific to the user. No AJAX calls needed to get user specific content on the page. I'll show you how. DATA CACHING STRATEGY I'll review how we use multiple levels of data caching to greatly improve the amount of time it takes to rebuild the entire cache. DB READ REPLICAS FOR PERFORMANCE / CUSTOM BACKEND FOR FAILOVER Read replica databases are great for performance. You've set up a few read replicas and implemented a fancy new database router which sends read queries to the read replicas (round robin) for any data that doesn't need to be up-to-the-millisecond fresh (e.g. blog posts, product descriptions). You're sitting back and relishing in the improved performance when one of your database read replicas goes offline. Now what? I'll show you how we implemented a custom database backend to handle this gracefully. MIGRATIONS RULES This is less of a performance optimization and more of a set of rules we try to stick to. I'll review some snafus we've had and how we avoided future production issues while keeping the site at 99% uptime.