[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
If I want to index all of my media into a RDBMS like MariaDB,
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 14
Thread images: 2
File: radiation.webm (3 MB, 1280x720) Image search: [Google]
radiation.webm
3 MB, 1280x720
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.
>>
File: 1440019074724.jpg (62 KB, 400x600) Image search: [Google]
1440019074724.jpg
62 KB, 400x600
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
Thread replies: 14
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.