I’m developing a Django app that makes a lot of similar queries in different views, and I’m planning on using Redis to speed things up by querying Redis instead of the database.
I was reading the question: How can I use redis with Django? to get started, and at the end of the best voted answer I see the advice: “Don’t start using Redis or any other cache until you need the speed – don’t prematurely optimize.”, and I thought maybe I’m doing things wrong, what does he mean by “don’t prematurely optimize”? Is prematurely optimizing going to hurt my app or the developing process? if it does, what should I look for? what metric can I use to decide when it’s a good time to use Redis or any other cache?
By prematurely optimizing your solving problems you don’t have.
When the UX is impacted because of load times. Or when the UX is impacted in any way it is probably time to start looking.
Adding more technologies could make your build/deployment process more complicated when there is no need for it to be. People (myself included) always think about how many millions of visitors our apps will support and how we will be writing millions of entries everyday to the db, how to efficiently manage all the data and keep queries fast for all our future ghost users. While it is excellent to think about how an app is goign to scale and grow, there is certainly no reason to scale it before necessary. Using django and a trad RDBMS with a well thought out db schema, and correct indexing will probably support your app to larger than it will be.