473,563 Members | 2,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how does social networking web site store images?

bilibytes
128 New Member
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 15065
Atli
5,058 Recognized Expert Expert
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 New Member
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 Recognized Expert Expert
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 New Member
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 Recognized Expert Expert
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 Recognized Expert Expert
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 Contributor
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 Recognized Expert Contributor
@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 New Member
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
3386
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, friendster, linkedin, yelp... ) with one of these PHP CMS tools? ???? any suggestions ? pros / cons of any of them? thanks! - dan
10
6307
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 will take some fairly complex database structure. Here is what I have planned: The site will function a lot like the hit social networking website...
2
1441
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
3134
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
1626
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
2303
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
1710
by: Shalini Bhalla | last post by:
Which is the best social networking site CMS
1
4838
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. can anyone help me to implement the database design with fast and accuracy retrieval of data from the database using the Index and Hash table...
0
8106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7642
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6255
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.