开发者

Storing Developer API Key/Secret on the server

开发者 https://www.devze.com 2022-12-17 12:22 出处:网络
Amazon\'s API requires you to have a signature which is a combination of many elements one being the secret. Thesever checks this signature by matching the API key passed in the parameters with a secr

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号