So in my spare time, I've been developing a piece of network monitoring software that essentially can be installed on a bunch of clients, and the clients report data back to the server(RAM/CPU/Storage/Network usage, and the like). For the administrative console as well as reporting, I've decided to use Django, which has been a learning experience in itself.
The Clients report to the Server asynchronously, with whatever data they happen to have(As of right now, it's just received and dumped, not stored in a DB). I need to access this data in Django. I have already created the models to match my needs. However, I don't know how to go about getting the actual data into the django DB safely.
What is the way to go about doing this? I thought of a few options, but they all had some drawbacks:
- Give the Django app a reference to the
Server, and just start a thread that continuously checks for new data and writes it to the DB. - Have the
Serveraccess the Django DB directly, and write it's data there.
The problem with 1 is that im even more tightly coupling the server with the django app, but the upside is that I can use the ORM to write the data nicely.
The problem with 2 is that I can't use the ORM to write data, and I'm not sure if it could cause blocking on the DB in some cases.
Is there some obvious good option I'm missing? I'm sorry if this question is vague. I'm very new to Django, and I don't want to write myself into a corner.