Reputation: 695
I am making an app for android which uses quite a lot of images and videos so I decided a MySQL database would be the best idea for storing all the media. I have never done this before and when I looked around to try and find out how I could go about storing videos in a database, I was told that it is generally not a good idea to store whole videos in a database. Could someone please explain why this isn't a good idea, as I have looked around and can't find any decent info on the subject.
What I have done though is instead of storing the whole video as a blob, I instead stored a string of the url that links to the video. Is this how storing videos is usually done?
Upvotes: 3
Views: 889
Reputation: 4201
I Agreed storing video is not a good idea in database coz time comes up that you gonna face a serious problem when it comes of fetching data if you already have a bunch of videos and images in your tables. Must better to make it a file system then store the path at your table.
Good luck!
Upvotes: 1
Reputation: 641
Look, even when most relational databases such as MySQL can habdle media content, they are designed to store text information (characters, numbers, etc).
If you use your database to store images and/or video, everytime you run a query to get the content, the database will be working so hard because you're storing/reading a huge amount of data and database motor will have to reconstruct all the content on every query, and also, you may have to do some tricks to read it as a stream. This will impact the performance of your system in a negative way.
Remember that you'll be using that content so often, which means database will be handling a heavy load.
I suggest you use the database to store the URL's of the contents and just use it to retrieve the url of the element you want to use.
Upvotes: 2