If I want to index all of my media into a RDBMS like MariaDB, what would be more matching to best practise: create a separate database for each type of media (music, images, movies) or create a table in a single database for each type of media?
I'm just trying to wrap my head around how I'm going to design the tables with my basic knowledge of SQL.
Bump.
I guess /g/ really is nothing but shills and Winfags.
Holy shit.
Why are you allowed to vote.
And reproduce.
>>53559357
What?
>>53558885
>create a separate database for each type of media (music, images, movies) or create a table in a single database for each type of media?
yes
>>53558885
I've been thinking about this as well. I'm actually writing a media organizer program, and I've been struggling with table design. Ultimately, I decided that media type should be a field instead of its own table, but I can think of how one could go either way. My question would be how important is it that you separate them? Are the tables actually going to have a lot of significantly different data? I unified it because ultimately what I am working on is more about file organization based on user-selected categories than any sort of search specialized for a specific type of media.
>>53558885
> index
Chum, if all you are doing is creating an index of your porn and Chinese cartoons then you're overthinking your database design. You need one database with one table. Give each row fields like title, description, url, file type, tags, etc, and then query that.
>>53558885
What's the point of a database with multiple columns if all you're going to do is overthink the problem and separate everything into its own special snowflake table?
By the end of it, would you finally realize how stupid you were when you end up having to unify all filetypes into a single "File" table?
what are you trying to achieve?
Indexing is for speeding up lookups so the trick is to index an ID so that you get the value from the other columns quicker.
I hope you're not storing blobs but what I think you want is something like this http://sqlfiddle.com/#!15/4490c/1 then you can just serve up the files through apache or something.
>>53562187
> http://sqlfiddle.com/#!15/b9232/1
wrong one
Separate database???
Dude you could put it all in one table. Easy.
For speed I would normalize a bit (have lookup tables for file type identifiers, separate path in to multiple columns to save space)
But this is totally doable in 1 data table. For the love of God don't store blobs in a database. DB storage will always be slower and more expensive than filesystem, store the path as a varchar and write a procedure to decipher the path and determine which app to launch.
>>53558885
>putting it in a database
>and not in a search engine
>>53558885
use mongodb and don't give a fuck about your schema