10

I have my django website, which I want to make distributed, I know all the concept of system design and distributed system but still cannot figure out how can I serve it using multiple server. I am trying to make my systems distributed, so that I can serve my website from two machines (that is how the distributed system works). I have coded my website in Django. I want to know the steps of making my same website to be served from 2 machines. That is how will the two systems know about each other, how will they be connected and whenever a request comes in one of the server will be chosen to process the request. What software or tool should I have to join my servers and which software will accept the request in this case so that it can decide which machine to send the request to and how should the database be configured in this case?

P.S : the only thing is I know is how to serve my django website using one server(get an instance of machine from Linode, DigitalOcean). I want to implement system design distributed system concept for my website so that I can learn all concepts of system design by personally implementing it

  • What you're willing to achieve works pretty much as a client-server architecture, you would have various Django webpages ( clients ) that would communicate via API with the centralised Database server ( server ), to do so, you'd only have to make AJAX calls from the clients to the Database in order to CRUD the data. – Alejandro Vicaria Nov 28 '19 at 06:57
  • Where/how is your application going to be deployed? HAProxy is great open source load balancer, nginx (and most web servers) can be configured as load balancers. There should be no issue having a centralised database if you use any of the popular database solutions – Iain Shelvington Nov 28 '19 at 06:58
  • @FarhanAhmed It really depends on how you intend to deploy your app. If you intend to deploy on a bunch of VMs then it's a very different solution to if you are going to containerise your app on kubernetes. This page might help https://django-book.readthedocs.io/en/latest/chapter12.html, the section "Implementing Load Balancing and Redundancy" is relevant to what you're asking – Iain Shelvington Nov 28 '19 at 07:07

1 Answers1

3

The step from single server setup to a distributed (highly available) is not a very simple one and is not so much related to Django, but much more to general server infrastructure. However, there are a lot of resources that can help you started.

Considering you mentioned DigitalOcean, I believe the following tutorial on their website will guide you in the right direction: Building for Production: Web Applications — Overview.

Before going through that article completely, make sure to read 5 Common Server Setups For Your Web Application as well. It gives a great overview of common server setups, from single server to your desired state.

Jeffrey Klardie
  • 3,020
  • 1
  • 18
  • 23