Question

I'm working on a database for a website with around 500,000 links. We need to add a photo feature to the site. We can have two tables such as table_links (for each link content, text, keywords, etc) and table_images (for image title, image URL, thumbnail, etc). In www.domain.com, there are link summaries required to have one image thumbnail for the links. Inside each link, we should have 0-25 photos plus their thumbnails, plus text content. My question is about those thumbnails (one for each link) in www.domain.com. Do you think we should save that one image (URL, title) in a column inside table_links for simplicity and a better response time or any other reason I cant think of, or shall we keep all images in the table_images. Or do you have any better suggestion about what would be a better way to add this photo feature. It is noteworthy to remind that, not all of the links are going to have images.

Thanks in advance,

Était-ce utile?

La solution

Since not all The links will have a thumbnail, i'd personally prefer seperate tables. Another reason is that thumbnails could simply be reused by different links. Or in future versions you could even add multiple thumbnails per link. All this without affecting The structure of the db.

Performance wise seperate tables could BE usefull as Well. Suppose you want The thumbnails to BE shown On hover: On page load, you can load all The links, and afterwards (eg with Ajax) you can start loading the images (bulk load or On demand, 1 by 1). This reduces page-load time significantly.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top