Wednesday, September 17, 2008

Day 3 - Session 6 - Caching and Scaling

I'm late to this session... We opted to stop and talk with Katie w/Zend Technologies. No news there.

Ok so we walk in, and this guy's talking about caching - most of which is real obvious.

Right now he's talking about Memcached server farms.

Real quick, I'm going to interject my own thoughts on cache:
  • Do NOT cache entire objects that contain sub objects. You should cache each object independantly.
  • As objects need common sub-objects, you find that your cache is used more often.
  • It is very important to clear your cached object when it is updated. One problem I've often hit is when the DB/external (read as NON-PHP) scripts update records, it's usually met with dismay to have to clear the cache.. I'm not sure why yet, but that's pretty common.
  • This one is critical...... ONLY CACHE SOMETHING YOU'RE WILLING TO LOSE!!! As expected, something will creep up and cause issues (failures, bugs in caching schemas, etc).
So this guy's saying one important thing to consider is Failover protection. If (when) it fails, you need to have a failover protection in order to not overload your remaining servers. Dynamic allocation might be hard, but it's nice to be able to change them based on real tests.

No comments: