473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how does social networking web site store images?

bilibytes
128 100+
Hi,

i am wondering how did a website like facebook, myspace or whatever social networking site store their images?

do they store them in a DB or roughly like files?

thankyou in advance and

cya!
Nov 18 '08 #1
9 15037
Atli
5,058 Expert 4TB
Without actually knowing anything about it, I would guess they have a central storage system that is probably very much database driven.
But being huge as they are, they would require an advanced caching system that spans multiple servers around the world. That system would not necessarily have to rely on a database, but rather "mirror" the actual image from the central database as a file served from the file-system.

But like I say, I don't really know what they actually do. I'm just guessing.
Nov 18 '08 #2
bilibytes
128 100+
I want to create a site with just profile pictures, but as i read you, it's quite complicated...
do you think it would work to have profile pictures saved on a databasw? or it would be too slow to retrieve data, or worse it would crash...?
i know this is a matter of size, if i have 2 users its ok but if i have lets say:
---------------------------
5,000 users that request their friends profile picture 20 times a day?
it would make -> 10,000 requests per day with:
1 picture per friend -> 50 friends per user ->
500,000 pictures in a day-> concentrating the users visits in 6 hours per day it makes->
83,000 pictures per hour->
1,300 pictures per minute->
23 pictures per second-> with a picture size of 12 KB per picture->
-----------------------------------
|....276 KB per second...|
|____________________|

and that is for an average volume, it would maybe raise to 200 mega per second i dont know...
will mysql be able to handle this?

thankyou
Nov 18 '08 #3
Atli
5,058 Expert 4TB
I try to avoid putting *files* into a database when I can, except when there is a good reason to do so. Like, for example, when you need extra security.
It is generally considered a bit less efficient to store files inside a database, so unless you have a good reason to, you really shouldn't do it.

In your case I see no reason or benefit from putting the images inside a database. Having them on the file-system and simply allowing the HTTP server to serve them from there sounds perfectly fine, and it might help a bit with the overhead.
Nov 18 '08 #4
bilibytes
128 100+
thankyou very much!

but the problem is that i could not forbid some users to see some images and allow others.. well, if i can i don't see how!

if you have any link from where i could read about this, i would be very grateful.

thank you again

Edit Post:
for those who are also interested, i have searched and found this:
http://www.extremeexperts.com/sql/FAQ/StoreImages.aspx
and this:
http://www.oracle.com/technology/pro..._database.html


it seems to point now that it's better to put images in databases, but these two articles were written by subjective people so i don't know what amount of trustiness give to them.

so i beg experts you please have a look at it and bring some light into this topic

thank you very much

bilibytes
Nov 21 '08 #5
debasisdas
8,127 Expert 4TB
You can store images in database ,but definately there will be performance issue as the number and size of files grows.
Nov 21 '08 #6
Atli
5,058 Expert 4TB
Ahh ok. So you do need to restrict access to some of the images?

If that is the case, then you may well be best of putting them into a database.
But that can affect the server performance.

You could of course also put the images on the file-system, out of reach from the public, and have PHP read them from there into the output. Might help a bit with the performance.
Nov 21 '08 #7
coolsti
310 100+
You can leave the images as files located someplace off the document tree so that they are not directly accessible via a browser. But place them in a directory that is accessible to PHP or whatever scripting you are using for your site.

You can store the filename or if needed also the directory path information of the user's active profile picture in the database. This would only be saving some text in the database rather than the entire image file. Access would therefore be quick.

You then need to write your scipts so that they read the filename (and maybe directory location) from the database, and then serve the correct profile image to the page. If the image itself is located off of the document tree, it cannot be accessed with a simple html image tag soyou will need to do some trick here to do this, but it can be done.

No idea how efficient this would be, nor how the job is really done on other sites.

By the way, as an aside, does anyone know what the "needs regular fix" under my signature is supposed to mean :):):)
Nov 25 '08 #8
mwasif
802 Expert 512MB
@coolsti
This is a good approach and practical in your case.
@coolsti
It is more efficient than storing the images in database.
Nov 27 '08 #9
bilibytes
128 100+
Ok thank you for your replies I think storing the url in databse is the best aproach for a small site, then if it grows, i think i should use other triks

tkanyou very much

bilibytes
Nov 27 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: harlow.28 | last post by:
Looking to build a Social Networking site and i've heard of Drupal and Joomla and a few others and i was wondering if anyone had experience building a social networking site (i.e. myspace,...
10
by: Fenix [Youth Director] | last post by:
Hello, I am in need of advice or examples of how I should build my database for a small non-profit youth computer gaming organization. I am a beginner at database design and I know this project...
2
by: sebhastian | last post by:
I’m interested in creating our own social networking site. Can anyone recommend a company or tech firm that does this?
4
by: avh | last post by:
Does anyone know of a white-label social networking framework that has been built in .NET? Seems like everything out there is PHP...
2
by: kevinhugh | last post by:
Hello, I am looking to develop a social networking site, but need advice on how to approach this in terms of development? Can you help? kevin
1
by: Grouchy.Oldgit | last post by:
Does anyone have experience (good or bad) with running any of the growing number of open source social networking platforms - eg elgg, phpizabi, PHP Social Flies etc etc
4
by: Shalini Bhalla | last post by:
Which is the best social networking site CMS
1
by: deepucando | last post by:
Hi i am trying to design a social networking site for my project. i have to design the database for the social networking with user profile and friends contact list as like facebook and orkut. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.