Search code examples
mysqldjangodistributed-computingdistributed-systemsystem-design

How to connect to the centralized MySQL database from my django website?


Lets say I have two systems that will runs a Django server and one system that will be a centralised database that will only contain database application running on this machine. How can I have two machines connect to same database i.e Read/Write from/to database? What software needs to be running on my MySQL database side so it can get the data from the server and return the data from the database in case of read query ?

The question is how can two server make connection to a centralized database to read/write from it? What code/technology should be running on the database server to send/receive data?

If there are to systems that are solely dedicated as a server and one as a database then how can I make a connection from my two server machine to the centralized database. Which technologies can help me in achieving this? What code should be run on the third machine and how the other two server makes connection to this database?


Solution

  • I fail to understand why you need extra softwares/technology for this.. If all you want to do is make both your django servers access the shared database kn the third server, just point both your django servers to the server running your MySQL.. it should do the job..