There is a system whose architecture at the time of development was as follows:
+--------+ http | server | <------> +--------+ | nginx | | uwsgi | | django | | db | +--------+
But when starting up in the future into battle, I would like to have scalability and fault tolerance of the system, so the modules were separated from each other:
http +-------+ +-------+ +-------+ <------> | nginx | <---> | app | <---> | db | +-------+ +-------+ +-------+ | uwsgi | | django| +-------+
There was a problem with loading images, or rather, in returning the image to the user after loading, since nginx
out of the box does not know how to get into the file system of another server. In this regard, there were two ideas on how to solve this problem:
- Using
samba
create a shared folder betweennginx
and theapp
, into whichdjango
will upload images, and from whichnginx
will pull them when prompted; - Use
FileWrapper
to let theapp
know how to send images to a request fromnginx
. - Put on the
app
software for issuing downloaded images:nginx
orapache
.
Can you give arguments, which of these solutions is better to use, or bring your decision?
rsync
better, then write what it is better for. - MichaelPak