Jump to content
  • Advertisement
Sign in to follow this  
GCoda

[web] Files in mySQL database question

This topic is 4886 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I was thinking of storing files in to mySQL database and writing app to download the files using mySQL queries but my question is, how wise would that be? Would it be faster to download the files from database using FTP as example? I need store around 50-100 mb of files. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
I don't think it would be faster, and actually may be more trouble (mysql_packet_size problems and such).. I can only see some benefits if you want to store small files, like icons or so.

Otherwise, I'd advise to store links to the files in the database, and retrieve the files using those links.

Share this post


Link to post
Share on other sites
How do you mean, exactly? You can store binary data in a MySQL database (using BLOB as a field type, for example). I prefer to just store the file on the server and store the path to the file in a field on the database as it makes things slightly easier to code (you can just tell issue the user with the link to the file, unlike the storing the file on the database table which would require you to look up and set the HTTP headers correctly - which is not that much work, though).

Share this post


Link to post
Share on other sites
Thanks for your replies.

The reason I need the files in database is because the files are game files that the game updater program downloads.
Maybe I'm making it too complicated, perhaps I should just download the files directly using TCP.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!