Hacker News new | past | comments | ask | show | jobs | submit login

> If a Get and Set can produce a collision and it is not dealt with, then it is unsafe for production.

That was confusing to me as well in the article. However they also wrote:

> If however, a key is already present in the cache, Set would update the key immediately. This is to avoid a cached key holding a stale value.

So it sounds like inserts to the cache might not immediately apply, but overwrites are guaranteed to invalidate stale data in cache.




The problem isn't stale data, the problem is getting data for an entirely different key. As an extreme example, if your terrible hashing algo was 'int(key) mod 10', then you have no collisions on keys "3", "45", and "99". However, if you asked for "19", you would get back the data for "99". If that data is their email address, name, address, or medical prognosis, then you just leaked PII when that data is served to a user. Worst of all, you wouldn't even know unless the customer calls up wondering why they got incorrect data.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: