So, right now, I'm working with a project that can potentially have thousands of users logging into it. At this time, it is simply in development, maybe 3 users at the moment. Regardless, the goal is to give users access to an online file editor, and in this editor, they can only see and edit their own files and folders. No one else's.
The issue at hand, is I'm trying to (I want to) avoid having to create a subdirectory for every user registered. However, I'm having a hard time wrapping my head around an idea and infrastructure for organizing something like this. My first thought was to use a virtual host, but that would still entail have a directory for every single user, and having that many subfolders to maintain would be a nightmare. What if the configuration files' structure has to be changed? Then, a script would need to run to loop through each and every user's subdirectory to update that configuration file. Of course, I suppose there could be a single config file that all user's are tied to.
I realize there isn't a one shoe fits all for this design, but I know this isn't the first project in the world to have this problem. I'm making every effort possible to keep scalability in mind.
**These will not be Linux users or even Windows users, they will be entries in a users table in a MySQL database; just your run-of-the-mill CMS. Surely Wordpress/Github/Blogpost/etc don't create a new subfolder for every user registered?
Ideally, at the surface, it would appear that each user has their own directory, but behind the scenes there would be a system in place that is only rewriting the URL to appear that way.
www.website.com/user1
www.website.com/user2
and so on.
When in reality, the actual URLs before being rewritten might be
www.website.com?uid=123
www.website.com?uid=4833
and so on...
Although I'm aware of how to setup something like that, I'm just not convinced is the most efficient solution. As it is, users will have their how row in the users table in the MySQL database, and there would most likely a be a table for files and folders with a foreign key for the user_id found in the user table. (I haven't taken into account the possibility of groups yet, that would be down the road).
Anyway, I'm just curious as to what kind of solutions people may or may have not designed into their current systems that address the ability to avoid thousands of subfolders for thousands of users.. Please let me know if I need to provide more details. As I have posted this in the Application Design forum, this is mostly a theory based question. I'm not expecting a concrete copy and paste solution. I just need to warp my head around a potential solution and how I could make it work.