youtube use file system or mysql database?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
dsick
Forum Commoner
Posts: 57
Joined: Fri Mar 27, 2009 3:34 pm

youtube use file system or mysql database?

Post by dsick »

i know with photo sites they use a combination of the database and the file system, is this the way youtube works? all my users pictures, and videos are saved in this directory

i wasn't quite sure which forum to put this in

but im pretty sure when you upload videos you upload to a directory on youtubes server..

could be wrong tho, but id rather work with my database than the file system
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: youtube use file system or mysql database?

Post by onion2k »

YouTube use a custom version of BigTable, which is a very, very fast "database" for storing massive amounts of information that's based on GFS. It's not really a database like MySQL though, in so far as tables don't have "columns" in the traditional sense. It uses a "cloud" of data. It's a bit weird.

There's a free version based on Hadoop called hbase ( http://hadoop.apache.org/hbase/ ), but don't expect it to be anywhere near as easy to use as MySQL. It's really complicated.
dsick
Forum Commoner
Posts: 57
Joined: Fri Mar 27, 2009 3:34 pm

Re: youtube use file system or mysql database?

Post by dsick »

i can accomplish everything they do in mysql but im wondering were they put videos people upload at, it can be done by putting the video in the user ids video directory, if you make a id dir once users submit there registration data, some sites have the auto-incrementing id inside the database and another one on there server that has the users mp3s and what not inside their respective dirs

one question can you read an image from a database, or a video, i know it will show the image path but not the image its self.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: youtube use file system or mysql database?

Post by onion2k »

dsick wrote:one question can you read an image from a database, or a video, i know it will show the image path but not the image its self.
You can, but reading from a database is very slow and memory intensive compared to reading from the filesystem. Your website would be considerably less scalable if you stored the data in a database table.
Post Reply