I
I
Ilyas Galiev2015-04-09 22:40:54
Nginx
Ilyas Galiev, 2015-04-09 22:40:54

How to organize the separation of the application servers and the image loader?

A huge number of pictures are planned and must be stored on your server. There is already a server for applications and a server for pictures on 2TB.
How to take out the logic of saving pictures? How to organize such an API? Or better any cross-domain requests, such as cURL?
What do you think?
And yet, after saving the pictures, you need to save the paths in the database, how to organize a connection to the database for this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
vyachin, 2015-04-10
@vyachin

Check out this solution https://coderwall.com/p/swgfvw/nginx-direct-file-u...

A
Alexander N++, 2015-04-09
@sanchezzzhak

1 accepts everything and scatters via SSH
2 in the database we store the paths so
path1, path_preview or json fields, you can wound the server id, save on the domain name on the way.
The latest mysql can work with json and sphinx learned to index json last year
Well, as an advertisement
https://github.com/sanchezzzhak/yii2storage
Can download images via http resize through 3 drivers according to availability priority, the worst option is GD)
Upload files to current server
Transfer files via SSH to another server
Upload files to amazon
Also has a file upload widget...
well, if something doesn’t work, you can write to Skype kak_kotyavo (hour zone MSK)

V
Vlad Zhivotnev, 2015-04-10
@inkvizitor68sl

Distribute pictures from the storageX.project.com domain.
Upload them to the second server with a curl (you can use the nginx webdav module so that you don’t mess around with the code on the second server).
When the first one ends - put storageY.project.com and change the url for the upload.
> how to organize a connection to the database for this?
Exactly the same as for all other cases.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question