I am working on the website that could deal with 1000s of images for my clients. Say 20,000 files per user, circa 200 users (with hopes for 1000s soon).
- Images are represented by
vFile
(unique id) records in MySQL InnoDB database describing ownership and permissions, location in the folder tree, location of physical files on S3, size etc. - Users can create, delete, reorder etc those
vFiles
. - Each user can alter only
vFiles
he owns.
The database dilemma is:
- all the
vFile
records in one table or - separate table for each user.
Second solution seems to have a few advantages:
- as queries will search for
vFiles
for one user only, second solution reduces load on the db. - operations on
vFiles
(like renaming, deleting, reordering) will affect much smaller tables.
Your thoughts would be appreciated.