Thanks! I'll check redis out.
On Jan 14, 2:11 pm, Adam Lee <[email protected]> wrote: > Honestly, this probably isn't the best response for this list, but use > redis<http://redis.io/>, > that's exactly what it was designed for. It has native support for basic > data structures, like hashes (associative arrays, dictionaries, whatever you > wanna call em), lists, sets and sorted sets. Your code would actually end > up being even simpler, since you could store the dictionary directly in > redis. Not sure about the client situation for python, but it looks like > there are a few of them:http://redis.io/clients > > > > On Fri, Jan 14, 2011 at 3:24 PM, Gustav <[email protected]> wrote: > > I'm working on a specific problem where I'd like to keep a unique set > > as the value and was wonder if there is a better way of doing this. > > > Here is the scenario: > > > I want to store all accounts that try to login from one IP. So I want > > to keep a unique set of accounts in a key for that IP. I currently use > > Python to store a dictionary in the value for that IP and I have to > > pickle/unpickle everytime to see if I need to insert the account into > > to dictionary. This is terribly slow when there are a ton of them. > > > Are there any sneaky ways of keeping a unique set of values in a key > > that scales better than my approach? > > > Thanks. > > -- > awl
