I’m writing a social networking application in VB.NET, with a target userbase of 1-2 million users.
All user data will be in memory in a dictionary of ‘User’ objects with properties such as Country, Region, Age etc exposed. I need to perform search against multiple user properties in memory – I’m not using SQL.
What’s the most performant way to implement a ‘user search’ against multiple properties?
Additional Info
I’m currently using UserID as the Key for the Dictionary, which is fine as most of the (non-search) lookups will be via UserID. I am considering using multiple Dictionaries as indexes using other User properties as keys, would this be workable? I’m really just trying to avoid an exhaustive itterative search of all users.
Probably LINQ to Objects, but I would use multiple dictionary lists if you’re planning on a million users, especially if the properties of the User objects are able to change. (For example, all of the Users who’s UserName starts with A go into one list, B-C into another, etc.)