<p>I have worked mostly with monolithic web applications over the years and have not spent very much time looking at Django high-availability scaling solutions.</p>

<p>There are plenty of NGINX/Postgres/Django/Docker builds on hub.docker.com but not one that I could find that would be a good starting point for a scalable Django web application.</p>

<p>Ideally the Docker project would include:</p>

<ul>
<li>A web container configuration that easily allows adding new web containers to web app</li>
<li>A database container configuration that easily allows adding new database shards</li>
<li>Django microservice examples would also be a plus</li>
</ul>

<p>Unfortunately, I do not have very much experience with Kubernetes and Docker swarms.</p>

<p>If there are none, I may make this my next github.com project.</p>

<p>Thank you in advance. </p>

Mark
<p>That is a very broad request. It depends on many factors:</p>

<p><strong>What is the performance requirement?</strong></p>

<p>Make sure, you really need that kind of scaling. In most cases, a single good server with docker-compose can handle your needs. If you want to reduce risk of downtime, create 2 servers, add a load balancer in between them and extract shared services like DB or Caching into another Service and have both server instances use them.</p>

<p><strong>How do you want to run your applications?</strong> </p>

<p><em>Docker-Compose:</em></p>

<p>Checkout <a href="https://github.com/pydanny/cookiecutter-django" rel="nofollow noreferrer">https://github.com/pydanny/cookiecutter-django</a> on how to do it with docker-compose on a single server.</p>

<p><em>Kubernetes:</em></p>

<p>Django is quite good to run in Kubernetes, I am running several applications on Kubernetes. The issue with that is, you need to setup all other services properly (redis, DB, ElasticSearch, etc.). Each of those services run independently of your main Django app and need to be connected through libraries like <code>haystack</code> or <code>python-redis</code>.</p>

<p><em>Heroku &amp; others</em></p>

<p>There are also providers like Heroku that offer a lot the auto scaling for a price. If price is less of a concern, go with these solutions because they are very easy to setup and maintain.</p>

<p><strong>How scalable should your DB be?</strong></p>

<p>If you are trying to setup your own DB cluster across different servers/regions, you will spend a lot of time building and maintaining it. I would recommend, use DB services like AWS RDS. They do this for you with easy setup and maintenance. You can configure how scalable it should be. It costs some money, but it's the least effort solution.</p>
