I have been building rails apps for a while now, but unfortunately for me, none of my apps have had a large amount of data or traffic. But now I have one that is gaining steam. So I am diving in head first into scaling and optimizing my app.
It seems the first and easiest step to do this is with database indexes. I've got a good huge list of indexes that should cover pretty much all of my queries, but when I added them to my database via migrations it only took a few seconds to add them. For some reason I thought they would have to go through all of my entries (of which there are thousands) and index them.
Does this mean my indexes haven't been applied to my already existing data? Will they only be added to new entries?
Additionally, I am looking into other scaling solutions, such as memcached, and all around slimming down my queries, etc.
If anyone can point me to some good resources for optimizing my rails 3 app I would greatly appreciate it!
Thanks!
EDIT:
Thanks for all the great answers regarding database indexes! What else should I be looking at in terms of optimizing and scaling my app? Memcached? What has the best performance boost/effort ratio in terms of optimization?