Closed tmilewski closed 10 years ago
@tmilewski See my fork at https://github.com/ezkl/ziptastic-python/tree/add-redis-backend for a really rough Redis implementation.
I haven't programmed in Python in ages and put this together in a few minutes, so excuse the sloppy code.
Ah yes, Redis would be amazing...actually TBH it's out backup plan if our api server gets too overloaded haha.
@daspecster Using Hashes w/ namespace'd keys (i.e. zip:12345
) is a really easy way to store the data. Lookup time is negligible due to the unique keys.
If you ever decide to add data from other countries, the hashes could be transitioned to sets (key='zip:12345', val=some_reference_id) that use lists (key=some_reference_id, vals=hash_id#n) of hashes (key=hash_id#n, vals=city,country,state) as a kind of lookup table.
Wouldn't this be the perfect candidate for using Redis as the datastore?
(Note: My opinion. Certainly open to debate.)