[Tutor] design advise

Kent Johnson kent37 at tds.net
Thu Aug 27 16:28:06 CEST 2009


On Thu, Aug 27, 2009 at 7:26 AM, <davidwilson at safe-mail.net> wrote:
> I was thinking more in terms of how python would find it more efficient in retrieving the information, this being:
> 1) Storing all the user files in one place and then selecting only the files with the correct permissions for the user views
>  2) Storing the files in the user's folder and then building a list of this files on the main views, such as /news/index.html
>
> I guess in the first instance the code will only has to traverse one directory and build the dictionary of all the files for that specific user when the user wants their files. i.e /users/user/news/list_of_news_items.html
>
> Whereas on the second method the code will have to travererse each user's directory and build a dictionary for all the published documents to display for the main view i.e /news/index.html

There is no right answer to your question the way you have asked it.
Organizing per user will be faster for the per-user search. All files
together will be faster for locating all files. Which one do you want
to prefer?

> The thing that bothers me is that I ma have 10 users or 100,000 users and really wanted to get an opinion as to which option would scale better, leaving aside the relational DB approach.

I'm no expert on scaling but I can't imagine that any approach based
purely on scanning a filesystem is going to scale to 100,000 users.
Perhaps you should use a database to make an index of the files?

Kent


More information about the Tutor mailing list