Hi Steve - welcome to the mailing list and to Redis :)
Josiah covers the topic of searching quite extensively in his (excellent until the very end) book in
Chapter 7: Search-based applications. I don't want to spoil your learning pleasure, but the post you linked to (yes, links still work) describes some of the ideas in it.
What you probably want to avoid is scanning the keyspace to obtain all the URLs. This sort of full scan can be done with the `SCAN` command (or the **evil** `KEYS` command <- do not use it in production)
Grabbing a list of all the original URL can definitely be solved by maintaining a index that maps values to keys like in that post. But given the nature of the application (low index cardinality), you could just store all of the original URLs in a Set and `SSCAN` it to fetch everything.
Even better - instead of just a Set, you could use a Sorted Set to store the Original URLs as members and the score to keep the epoch value of the date_added. Then use `ZSCAN` for all, fetch URLs by ranges of dates and so forth. Note that the Sorted Set will contain the same data as your shortened Hash, so unless you have additional properties you can use a String for the short->original mapping. That said, every shortURL will require a key of its own (as you current design also does), so you may want to group them in Hashes to optimize memory consumption (see
Using hashes to abstract a very memory efficient plain key-value store on top of Redis). Although this will require the use of two calls to hashing functions, this is generally an acceptable tradeoff as hashing functions are relatively inexpensive. Essentially you'll end up with something like the following "schema":
shortURLs:<crc32(original_URL)> | Hash
<sha256(original_URL)> -> Original_URL
originalURLs | Sorted Set
<date_added as epoch> Original_URL