views:

56

answers:

1

Amazon's API requires you to have a signature which is a combination of many elements one being the secret. The sever checks this signature by matching the API key passed in the parameters with a secret it has stored in the database.

My question is, how does amazon match the api key and secret, wont doing a query every time overload the database. Also wont caching the api key and result for millions of developers cause shortage of ram?

or since its just 30 characters, so 30 bytes? itll only take 286 megs of ram?

Also what about if Im using Memcached to store these key and value pairs. Assume I have 1GB of memcached allocated, how fast will the seek be to verify the key/value

+2  A: 

Amazon almost certainly has a very optimized means for storing and retrieving the secret. They aren't looking it up in a MySQL database. It's really not that huge of an architectural challenge to solve that problem.

I'd guess that the have a distributed hastable, large parts of which are cached in RAM. They have plenty of RAM.

Adam Crossland