I am building a forum type site whereby the users will have an avatar. The main page will have a small version whereas the single page will have a large version of the avatar.
So for sake of bandwidth, I will have different sizes:
example.png
example_thumb.png
What is the preferred storage and retrieval method for the different sizes?
Here’s what I have come up with so far:
User Table UserId | AvatarName | AvatarExt
1 | example | .png
This way I can get the base and thumb version with the same query as long as I know that there is a ‘_thumb’ version
Or should I create a meta table like so:
UserMeta UserId | Avatar | AvatarType
1 | example.png | original
1 | example_thumb.png | thumbnail
I would love some advice
You are on the right track.
Users:
Avatars
Then you can do:
This allows you to, say, allow users later on to have multiple avatars without modifying your tables.