V
V
vitovt2017-05-03 10:38:14
Images
vitovt, 2017-05-03 10:38:14

How to implement the distribution of photos across servers?

There is an average project with private announcements. Users upload pictures that are placed in a folder like this:
/files/photos/00/00/01/01543/image.jpg
On the main server, the place is running out and you need to somehow think over the system for distributing photos to different servers. Roughly speaking, we start a new server on which there is only Ngnix or Apache and put all the new pictures there, then we connect another one and so on.
How to implement the distribution of photos, so that they are loaded there immediately. It was possible to somehow delete / resize / rotate them.
Maybe there are some inexpensive cloud solutions for storing photos, apart from AS3 and so on?

Answer the question

In order to leave comments, you need to log in

7 answer(s)
T
ThunderCat, 2017-05-03
@ThunderCat

on habré
in the same
place in google

I
Ilya Myasin, 2017-05-03
@dubr

Here is a fairly well-known article: Scalable photo storage - with pictures and snippets in php.

P
Puma Thailand, 2017-05-03
@opium

how much space on the server?
Let's say take a server with 4 disks of 6 TB for 69 euros
https://www.hetzner.de/ua/hosting/produkte_rootser...
or let's say they can take 10 TB disks,
this is a head-on solution

S
sasha, 2017-05-03
@madmages

depending on what the goal is.
if you go stupid then you take N ververs and pour pictures in a circle.
If a little smarter, then you can organize the choice of a server depending on the load or speed of the channel, or depending on other priorities. Also a wagon of parameters.

I
Ilya Karavaev, 2017-05-03
@Quieteroks

If the server is on Linux, you can also connect a virtual disk. And in saving and receiving, starting from some parameter in the path line, the same aliases, get the image. And how to distribute between servers, a question to your implementation. Randomly, sequentially, by load or free space, by "disk" availability.

V
vyachin, 2017-05-03
@vyachin

if you want to store files in the cloud, then I would recommend selectel
for crop, resize, set up a separate nginx server with the image_filter module and be sure to set up caching
if there is money for servers (at least 3, but better than 5-7) you can raise gluster for storage and nginx for bestowal. Gluster requires proper configuration and monitoring, but the upside is that all servers can distribute content.
https://habrahabr.ru/post/94435/
https://habrahabr.ru/post/77873/
https://habrahabr.ru/post/251931/

S
Svetlana, 2017-05-05
@Esmi

It is not necessary to use several servers, it is enough to take storage, for example, from G-Core or SkyparkCDN . If there is not enough space, then increase without any problems. Upload via FTP, SFTP or Rsync. Upload via HTTP and HTTPS. If you need to send photos to the Internet at a fast speed, then they have a CDN for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question