Photo Album Table Design

For photo albums, I see that most people use 3 tables:

Albums Photo PhtoAlbums.

However, if I look at a site like facebook, this scheme will not work (if I understand correctly), because I can have a photo in my profile album and in general albums, but I can give the same image of different descriptions, different tags, etc. Even the photo id is different. Therefore, I assume that when a user creates a copy of a photo, it is processed by a completely new photo, and therefore we only need two tables: Albums and photos (which have FK for the album)

In other options, there is a photo table with only 1 column (photo_id) and put all the photo data in the PhotoAlbum table so that I can provide each unique property for the album.

Am I really in this project?

+3
source share
3 answers

Photo<- Photo_AlbumAlbum. Is the relationship, so add various useful data (description, tags, etc.) to the table Photo_Album(as well as the photo), so when the photo is in the database, each copy of the photo in the album is also marked / described.

Then you can be smart about how you combine / display this data to the user.

, , Facebook . "NoSQL" -. "NOSQL" Google .

+2

Photo/Photo_Album/Album . , ( ) , .

"" , . ( , ect) , Photo_Album, , Photo. , .

( ) , , .

, , - . SQL/TSQL "" .

+1

n Photo/Photo_Album/Album - . , ( ) , .

"" , . ( , ect) , Photo_Album, , Photo. , .

( ) , , .

It all comes down to the final state and potential future requirements, of course, but the essence of this design pattern is to consider your database as a separate, economical and optimized storage system. Then you use SQL / TSQL and many other "intermediate" mechanisms to provide your GUI interface. You can create the best photo album design and make the service http://www.albumkart.com

0
source

Source: https://habr.com/ru/post/1783961/


All Articles