https://medium.com/@pesarakex/how-i-reduced-a-3gb-django-table-query-from-12s-to-200ms-with-just-3-indexes-eec82e99cec9
Django model:
Django model:
class Record(models.Model):
user = models.ForeignKey('auth.User', on_delete=models.CASCADE)
status = models.CharField(max_length=50)
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
indexes = [
models.Index(fields=['user', 'status'], name='idx_record_user_status'),
models.Index(fields=['-created_at'], name='idx_record_created_at'),
models.Index(fields=['user', 'status', '-created_at'], name='idx_record_user_status_created'),
]
Lesson?
You don’t need 17 microservices when you can write clean Django apps with clear domain boundaries. Monoliths scale just fine if you don’t treat them like spaghetti.
Link to the article
You don’t need 17 microservices when you can write clean Django apps with clear domain boundaries. Monoliths scale just fine if you don’t treat them like spaghetti.
Link to the article
Medium
How Disqus Scaled to Billions of Requests Using Django (Yes, Django!)
Everyone says Django can’t scale. Disqus proved otherwise—and they did it without going full microservices or rewriting everything in Go.
👍1
Pythonda katta hajmdagi tashqi API so'rovlarini qanday qilib qisqa vaqt ichida samarali amalga oshirish mumkin deb yurganlar uchun bir nechta maqolalar bilan bo'lishaman.
1. Yes, Python Scales: Lessons from Handling Millions of API Calls a Day
2. Efficient Techniques for Sending 100,000 HTTP Requests
3. Efficient Methods for Sending 100k Requests
1. Yes, Python Scales: Lessons from Handling Millions of API Calls a Day
2. Efficient Techniques for Sending 100,000 HTTP Requests
3. Efficient Methods for Sending 100k Requests
Medium
Yes, Python Scales: Lessons from Handling Millions of API Calls a Day
Python can absolutely scale. Four low‑effort tweaks gave us 60‑90% speed‑ups in the real‑world snippets below