I’m working on a web app that’s not even online yet. Is implementing memcache or memcached as of right now a bit premature? Should I use it only if:
- the web app is up, and
- the database is having a poor performance due to a high traffic/load?
Or is better to implement during development?
Also, in which cases is using a caching interface unnecessary or even disencouraged?
Know Your Problem Space
See memcached’s own wiki:
Get It Working First
Any optimization before you have a stable, working product is premature. You’ll spend all your time fiddling with knobs that have zero performance impact on your application.
Your best bet is to get it into a working state and then do several things:
Profile performance
Until you gather performance data you’ll have no idea where your bottlenecks truly are. Most likely they’re in areas you haven’t considered.
Identify Optimization Payoffs
Evaluate each problem area for potential performance improvements. Prioritize the areas that will give you the best ROI (return on investment). In some cases the best ROI may be more hardware.
Implement Optimizations
Once you’ve identified what needs to be optimized, create a plan and implement it.
Sources