3 ms·
Assuming this needs to be optimized for massive scale, just hash the values to a single indexed field. And use something other than an RDBMS. Put the hash in R
by stickfigure 5y ago
Assuming this needs to be optimized for massive scale, just hash the values to a single indexed field.
And use something other than an RDBMS. Put the hash in Redis and expire the key; your code simply does an existence check for the hash. You could probably handle gmail with a big enough cluster.
That super-normalized schema looks terrible.
- kodt 5y agoI too recommend using Redis in 2002.
- stickfigure 5y agoFair enough, but I think the issue here is recognizing that the underlying business operation is a hit test on an expiring hash key. You could have used MySQL as a key/value store or looked for something more specialized.
- ummonk 5y ago“Hash it and store in BerkeleyDB” would have been a ridiculously easy solution at the time.
- teen 5y ago++ correct answer here