I was thinking about the fastest way to retrieve a "set" of objects related to a specific user. For instance, if I was to create a website similar to Flickr where people upload lots and lots of photos(jpegs) what would be the fastest way to be able to retrieve those photos from the SQL Server database. Scenario 1: You store metadata about each file they upload to the website as a single row in a database table. Then when you want to retrieve a specific users uploaded files you simply scan the database file for every row matching the UserID and store them in memory.
SELECT PictureId, UserId, PathToFile, Caption, (etc.)
This, of course, gets all the information about all the photos a single user has uploaded. My concern with this approach is when the user activity goes from a few thousand to being in excess of a million.
This approach seems fine for a small website but does this method work for a million plus user website like Flicker or MySpace? When you have a million users and millions more photos does this approach still perform at acceptable speeds?
My idea was to actually attempt to create a collection in memory of "ALL" the PictureIds' for a single user and store them in-memory, in a collection and then save this collection as a single VARBINARY(MAX) field in the SQL
View Complete Post