Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

social networking website database management

Tags:

mysql

This could be very basic type of question for you! But for me it is very important. 1) How these(orkut, facebook or other) website store the images in server?

Options: a) Keeping all the images in database by converting into bytecode/binary. b) Making a new folder for each user and saving photographs according to their library name. c) Or something else which i(Anup) didn't guess yet.

Please reply me.

Sayiing thanx to see my question and any many many thanx for answering my question.

like image 224
Anup Prakash Avatar asked Feb 27 '23 21:02

Anup Prakash


1 Answers

a) There is no converting into byte code/binary code, the image is binary date and is simply and directly stored as it is in the DB. This is definitely not the best way to save pictures, because every request for a picture involves the DB, Web servers are faster serving static content directly.

b) this is slightly better, but for privacy reasons you should make sure that it is impossible to browse your images

c) The Facebook way: Facebook uses a Content Distribution Network (CDN) to store the pictures of its users, so if a browser requests a specific picture it loads from a server that is the nearest to himself. The Picture is distributed to multiple servers allotted all over the world. The same goes for youtube and video files.

like image 188
jigfox Avatar answered Mar 08 '23 00:03

jigfox