How to externalize Django's Media Data and Serve it to the Frontend

i'm building a restful web service with Django as the backend and am currently concerned with scaling. I want to have an architecure like this: http://www.djangobook.com/en/2.0/_images/scaling-4.png where i can just start up more django instances on high load. My Problem is that i don't know how to externalize the user uploaded content (in django refered to as Media).

My Basic ideas are: Amazon S3, FTP Upload, SMT or NFS Mount, or some kind of file db like GridFS.

Because the EU canceled the Save Harbour Agreement and there is a lot of legal uncertainty for EU companies to put user data on non EU servers, i cant use Amazons S3 or any non EU based storage solution. I have looked at Minio, a S3 API compatible storage server. I could only get the posts to minio working with the latest (non stable) release, but not the gets. Other S3 compatible servers like CEPH are "too big" for my usecase.

I thought of uploading the files to an ftp server and serve them from there with nginx. The Problem is, that django-storages ftp functionality does not appear to be stable and django-resto is deprecated and no longer maintained.

SMB/NFS mounts are unstable and django would loose data it whats to write, when the mount is unavailabe due to network failures.

GridFS i could not get to work because it uses mongodb, which is non relational and django is relational. The non-relational django fork is not well maintained. In terms of serving files from GridFS there is nginx-gridfs and mod_gridfs, both are not maintained anymore.

Do you have any ideas on how to externalize django's media?

Answers


Well, I solved my problem by using Minio library. Created special storage class, which inherits django's FileStorageClass. Overrided url() and save() methods. Moved it to external module.


Need Your Help

Can't change JProgressBar color in Mac OS look and feel

java swing colors look-and-feel jprogressbar

I know this question has been answered before, but it's just not working for me. I followed the instructions from here: How to change JProgressBar color?

What is the fastest way to convert float to int on x86

c optimization x86 floating-point assembly

What is the fastest way you know to convert a floating-point number to an int on an x86 CPU. Preferrably in C or assembly (that can be in-lined in C) for any combination of the following: