6 ms·
I feel like this particular piece of advice should be post-fixed with "... but don't be stupid!" In particular, keep an eye out for n^2 loops and the like. Wa
by sanj 19y ago
I feel like this particular piece of advice should be post-fixed with "... but don't be stupid!"
In particular, keep an eye out for n^2 loops and the like. Watch for shard-jumping queries. Easy stuff like that can go a long way.
- mrtron 19y agoAnd keep a list of potential problems that won't scale. 'Hey we serialize a list of ALL users for this...that won't scale!'
- apathy 19y agoYes it will, if you break it up onto multiple shared memcached servers. Or re-think how you're serializing it. Or why. Or use a distributed hash table (although if you own all the machines, memcached is easier and faster to ramp up). Basically, all of these exceptions people are cleverly bringing up are exactly the sorts of things that get in the way. Do everything well enough to get a usable product. Throw it out in front of customers. If you need to make it better because people are beating down the door, go for it; that's a much better problem to have than a scalable but unused resource soaking up your operational budget.
- bayareaguy 19y agoAgreed. I'd add linear lookups to that list since they easily lead to n^2 when someone comes along later on and puts your lookup inside a loop of their own.
- sanj 19y agoIt seems like there needs to be a list of these. In another thread: http://news.ycombinator.com/item?id=131216 http://news.ycombinator.com/item?id=131216
- t0pj 19y agoNothing like "jumping the shard", aye?