Proposed Database Schema for Photo Website

I am trying to organize my photos and create some front end ajax. I have a lot of photos and the existing hosting site I’ve paid for, it has a lot of disk space, so I don’t want to pay for storage on picasa website or an alternative.

I am creating an asp.net site to view these photos, but I am trying to determine the best storage scheme. You have a few fundamental questions:

Photos
Albums | Tags (maybe)

A few questions: 1. I have a separate table for each album or all the photos in one photo. the individual tables will be the same, so I'm trying to determine if there is any benefit to this partition 2. Is there any significant advantage to using the SQL server compared to MYsql (this is my choice in this case) for this schema. I do not think that I am doing something unusual.

+3
source share
2 answers

You should put all the photos in one table where you have 1: N with a foreign key in albums, for example

Photos | id, title, url, description, album
Albums | id, title, description

where the album is a foreign key Albums.id

, , , N: N, , ,

Tags | id, name
Photo_Tag | id, id_tag, id_photo

id_tag id_photo Tag.id Photo.id

, , MySQL .

+12

(id, Name, Description), (id, name, description, PhotoData, parentAlbum), , . , , 1: N : , . , , ( , ), , , 1: N AlbumTags PhotoTags

, , , ( ).

+2

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


All Articles