Website Database Management

This may be a very simple type of question for you! But for me it is very important. 1) How do these (orkut, facebook or other) websites store images on a server?

Parameters: a) Save all images in the database by converting to bytecode / binary. b) Creating a new folder for each user and saving photos in accordance with their library name. c) Or something else that I (Anup) have not guessed yet.

Please answer me.

Sayiing thanx to see my question and many many of them to answer my question.

+4
source share
2 answers

a) There is no conversion to byte code / binary code, the image is a binary date and is simply stored in the same way as in the database. This is certainly not the best way to save photos, because each image request includes a database, web servers faster serve static content directly.

b) it's a little better, but for privacy reasons you have to make sure that you can’t view images

c) Facebook: Facebook uses a content distribution network (CDN) to store images of its users, so if a browser requests a specific image, it is downloaded from the server closest to it. The image is distributed to several servers dedicated around the world. The same goes for YouTube files and videos.

+5
source

Definitely store images as binary files on disk. Storing them in a database would create unnecessary overhead. I heard that some large image hosters store many images in a single file and byte offset in the database, so the server can store the storage files and just seek in them to get other images. This will save you from open and close calls in the kernel.

+3
source

Source: https://habr.com/ru/post/1312421/


All Articles