 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
|
 |
|
 |
02-10-2008, 06:46 PM
|
#1 (permalink)
|
|
The Addict
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
|
what kind of data can go into a mysql database?
can huge zip files or .img files go in?
or is it best to put things like images etc.
__________________
no signature set
|
|
|
|
02-10-2008, 07:34 PM
|
#2 (permalink)
|
|
The Addict
Join Date: Nov 2007
Posts: 264
Thanks: 2
|
anything can go into a mysql database if you use blob
|
|
|
|
02-10-2008, 07:46 PM
|
#3 (permalink)
|
|
The Addict
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
|
do people usually insert files into their database or just trow it into a upload directory?
__________________
no signature set
|
|
|
|
02-10-2008, 08:07 PM
|
#4 (permalink)
|
|
The Addict
Join Date: Nov 2007
Posts: 264
Thanks: 2
|
Upload directory in tangent with databse to keep the the path to the files, megaupload does this.
|
|
|
|
02-10-2008, 08:27 PM
|
#5 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
Never store files in mysql, its not mysql's purpose. You store the files as files on your hard drive (where it belongs) and the links to them in the database if need requires.
|
|
|
|
02-10-2008, 08:35 PM
|
#6 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
If databases weren't meant to store binary data, why do we have the BLOB column type available? There are strong arguments for and against on both sides of the argument, though often the strongest side tends to be to store the files in the file system and make a reference to the file name and/or path using a simple VARCHAR column.
|
|
|
|
02-10-2008, 09:28 PM
|
#7 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Databases store infinite amount of data.
And that data can be anything.
I think that vBulletin stores avatars in blob field types. :]
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
02-10-2008, 09:39 PM
|
#8 (permalink)
|
|
The Frequenter
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
|
I'm interested. How does vBulletin store that data? Is it the same if I open an .JPEG image with notepad?
__________________
"Life is a bitch, take that bitch on a ride"
|
|
|
02-10-2008, 09:41 PM
|
#9 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by ReSpawN
I'm interested. How does vBulletin store that data? Is it the same if I open an .JPEG image with notepad?
|
blob :P Really, just get vbulletin some how ( no, don't warez it ), look it up yourself.
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
02-10-2008, 09:42 PM
|
#10 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
Quote:
Originally Posted by Orc
Databases store infinite amount of data.
And that data can be anything.
I think that vBulletin stores avatars in blob field types. :]
|
Nope
http://www.talkphp.com/avatars/orc.gif
|
|
|
|
02-10-2008, 09:47 PM
|
#11 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Village Idiot
|
No no no, not that, theres a different method, by storing it in a php file.
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
02-10-2008, 09:48 PM
|
#12 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Village Idiot
|
No no no, not that, theres a different method, by storing it in a php file.
The files aren't duplicated or created from the original, cause I looked all over in vbulletin. I dunno, check the dump
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
02-10-2008, 10:42 PM
|
#13 (permalink)
|
|
The Frequenter
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
|
If I had 10,000 2k images/files, I'd probably store them in the DB. If I 1000 100k files, I'd probably put them on the filesystem.
As for the vBulletin thing, vB has support for storing attachments, sig pics, profile pics, avatars and thumbnails in the database using Blob columns.
Alan
|
|
|
02-10-2008, 10:44 PM
|
#14 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Alan @ CIT
If I had 10,000 2k images/files, I'd probably store them in the DB. If I 1000 100k files, I'd probably put them on the filesystem.
As for the vBulletin thing, vB has support for storing attachments, sig pics, profile pics, avatars and thumbnails in the database using Blob columns.
Alan
|
Thank you for clearing that up.
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
|
The Following User Says Thank You to Orc For This Useful Post:
|
|
02-11-2008, 12:15 AM
|
#15 (permalink)
|
|
The Addict
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
|
interesting,
now can someone explain why type of php code inserts an image uploaded into the db
thanks
wow i have so much gas, the smell is strong
__________________
no signature set
|
|
|
|
02-11-2008, 01:18 AM
|
#16 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by sarmenhb
interesting,
now can someone explain why type of php code inserts an image uploaded into the db
thanks
wow i have so much gas, the smell is strong
|
the below comment was not needed but umm, also, I've never tried inserting images, or anything into a blob field, just that I make it save the path in the database, and grab the image. thats about it.
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
02-23-2008, 12:08 PM
|
#18 (permalink)
|
|
The Wanderer
Join Date: Jan 2008
Posts: 21
Thanks: 0
|
One of the benefits of using a database system over the file system to store files is to overcome throughput issues.
Having directories of millions of files for example can kill IO throughput. Databases can overcome this because usually they use a single table space. Not to mention they have sophisticated data caching methods.
But do remember, a file system was designed to store files, so in the majority of cases it is advisable to use it.
|
|
|
|
02-23-2008, 01:21 PM
|
#19 (permalink)
|
|
The Frequenter
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
|
So the most likely conclusion is to store small types of binary data in the database, like documents and small images, but store files of great size, like say 100MB or maybe 1000MB (1GB) on the filesystem.
__________________
"Life is a bitch, take that bitch on a ride"
|
|
|
02-23-2008, 07:42 PM
|
#20 (permalink)
|
|
WebDev'n Beer Drnkn' Fool
Join Date: Dec 2007
Location: Denver, CO
Posts: 59
Thanks: 2
|
There is a significant amount of overhead when using the BLOB field type for storing much of anything last i knew :S
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|