Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.databases.mysql Subject: Re: Can MySql database store images? Date: Sun, 24 Apr 2011 11:13:53 +0200 Lines: 40 Message-ID: <91i7uiFr9fU1@mid.individual.net> References: <91i1fkFetdU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net KPqPCvRHhEqFj2+s8SPKKAIFUPQGbuI8iHlpCa5bBYejSsnCx+ Cancel-Lock: sha1:2ZvLcrNFqtp5wIrdA57QTAEriDM= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.17) Gecko/20110306 Gentoo/2.0.12 SeaMonkey/2.0.12 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.databases.mysql:599 Robert Crandal wrote: > "J.O. Aho" wrote in message > news:91i1fkFetdU1@mid.individual.net... >> Robert Crandal wrote: >> >> There are different ways you can do this, the more traditional way >> would be to >> have a directory where you create one directory per user (say the user >> name) >> and then store that users images there. >> >> You could also store the images in a database table >> > > In your opinion or best guess, how do you think Facebook does this? > Do you think Facebook creates a directory per user where each user > can upload his personal photos? I would think the images are stored on disk and served by a static content web service, where access is limited by configuration settings. When I was working with an on-line web based game with 800k users, all images were served by lighttpd while all dynamic content was served by apache. All dynamic data was middle stored in memcached, so that pages would load far faster as you didn't need to fetch the data from a database (and you can settle with a cheaper database server solution). Nowadays many of the big ones are using custom versions of apache, lighttpd and mysql or even self developed applications to make the sites as fast as possible. Personally I prefer to have images on disk than in database, and I think there will be a slight overhead with the database (I know Jerry will tell you differently), but do your own tests and see what you think it faster and easier to handle and use that. -- //Aho