News for hackers. Stuff that matters.

Optimize Code or Upgrade Memory?

Myself and my partners are building a very large online comparison site.

There are currently millions of products in the site and when we move to compare other things there could theoretically be 100 million or more.

The database is taking a hammering at the moment and the site keeps going down.

My partner is a tech nerd and wants to throw more hard drives and ram at it but i want him to optimize the code more.

Memory and ram is very cheap now so this is actually a good short term solution and we will need to upgrade eventually anyway.

My problem is that i personally think even though the memory and ram is a cheap solution we should spend the time to optimize the code a lot more even though this could cost many expensive hours of work combined to a few dollars for more ram.

What does Ycombinator think?

( 6 comments | 4 points | on HN )
Re:Optimize Code or Upgrade Memory? by kls on Monday January 30, 2012 @10:07PM (#3531629)
Do you have new features that could be implemented with that time?

There are a lot of other variables as well, but at a high level, if there are new features that could generate revenue, then I personally would throw hardware at the problem while building an iterative plan to deal with optimization.

Re:Optimize Code or Upgrade Memory? by mrb on Monday January 30, 2012 @10:55PM (#3531749)
It is not an either/or choice. Sometimes you need to do both: throw hardware at the pb and optimize the code.

Sometimes you need do do everything possible to scale up.

Re:Optimize Code or Upgrade Memory? by msahil on Monday January 30, 2012 @10:12PM (#3531645)
Do some quick tests on your app to figure out what part of your app is the bottleneck. Rememeber the 80/20 rule applies here as well. You might get a lot of performance improvement by focussing only on few key areas. DO NOT, EVER, OVER OPTIMIZE YOUR APP. If you need to spend lot of time to rework then do it in phases rather than taking a big bang approach
Re:Optimize Code or Upgrade Memory? by lsb on Monday January 30, 2012 @10:22PM (#3531673)
What does "my partner is a tech nerd" mean?

Does he know what he's talking about, when it comes to code?

Do you know what you're talking about, when it comes to code?

Who knows more?

Why do you not trust his suggestion to throw more hardware at the problem?

Why does he think more hardware will matter?

Re:Optimize Code or Upgrade Memory? by dholowiski on Monday January 30, 2012 @11:07PM (#3531787)
Both.

Never underestimate the effect of speed on traffic. Throw everything you can at it.

Re:Optimize Code or Upgrade Memory? by sohn on Wednesday February 01, 2012 @11:39AM (#3538682)
Both.