Re: Schema for storing download codes
Posted by: Zach Werner
Date: June 10, 2013 01:27AM

Rick, thank you for your response.

Yes, I have settled on InnoDB.

> A popular quote: "Premature optimization is the root of ..."

Yes, you are right and I would be wise to remember this. However, I would hate for unforeseen growth cause issues down the road. An old military adage: "Proper prior planning prevents piss poor performance." By your quote I assume you would favor using only a random string instead of the two part code I purposed?

> It is more efficient to insert 500 at once

Yes, this is was at meant. Sorry I was not clearer.

> You have painted only part of the picture.

Ideally, there would be one insert for each code, one select to check the validity of the code, and one update to mark the code as used. In practice there will probably be many times more selects than inserts. The application code will work to minimize an exorbitant number of selects. There would be slightly more updates than inserts. Depending, on how the random code is generated it may be necessary to update any code that contains an inappropriate sequence of characters. I would expect less than 1 in a 1,000 extra updates. The server also has more RAM than 4GB and that can easily be expanded (although I don't want to rely on vertical growth).

> Even if you are I/O bound, 100 simple queries per second is probably achievable.

This is a great insight and I will review your link. This would be far greater than required. Thank you.

Options: ReplyQuote


Subject
Written By
Posted
Re: Schema for storing download codes
June 10, 2013 01:27AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.