this is a part from my database structure:
Table: Item
Columns: ItemID, Title, Content, Price
Table: Tag
Columns: TagID, Title
Table: ItemTag
Columns: ItemID, TagID
Table: Image
Columns: ImageID, Path, Size, UploadDate
Table: ItemImage
Columns: ItemID, ImageID
The items can have more than one image so i have a extra table “Image” and map this images to an items. I see now a problem with this structure. Before i can add Images i must enter an item.
My question is now. Is this structure a good way to solve my problem with many images / tags for one item?
Thank you
Yes, this is how it is commonly done. Perfectly normalized DB structure for that purpose.
Depending on your application, some kind of de-normalization might be required at some point to help performance, but I would wait with that until you have identified an actual bottleneck.
Make sure you have indexes on all foreign keys and any other fields you commonly filter on. Making composite indexes on
ItemTagandItemImagecould also be a good idea.