Setting up floating IP with 2xDjango droplets, 2xLoadBalancers and 1xPostgreSQL droplet

November 9, 2015 1.8k views
High Availability Django Scaling DigitalOcean Load Balancing PostgreSQL Clustering Networking Ubuntu


First, let me admit that I posted a short question about this on the Floating IP tutorial. But that thread seems inactive right now. Allow me to ask again in detail here.

I'm building a marketplace website where user can post things for sale. I came from a shared hosting so I'm still learning my way around VPS.

After I read about Digital Ocean floating IP, I'm trying to setup high availability using...

  • 2 x Django droplets
  • 2 x Load Balancer droplets
  • 1 x PostgreSQL droplet

I've read through Floating IP tutorial but one thing is still unclear.

--- Question ---
Where to store media files like videos or user-uploaded images?

If one image is in Django droplet #1 but not in #2 then this setup is not possible.

All tutorials mentioned moving database to separate droplet. But no one says anything about media files at all. (Or the media files should stay on a database droplet?)

Thanks in advance!

1 Answer

You can upload the media/static files to a separate droplet (you can also upload it to your database droplet, but I will recommend a separate droplet). Generally you would create a subdomain such as media.example.com and point it to your media server. When you are linking the media, you can use media.example.com/file.png for example. :)

Have another answer? Share your knowledge.