don't click here

Advice for Client Server Interaction

Discussion in 'Technical Discussion' started by Elektro-Omega, Apr 16, 2012.

  1. Elektro-Omega


    Mushroom Hill'in Member
    Hey Retro,

    I am doing a project at the moment which would require a simple python script to read information from an sql database on a server every 5 seconds and print a message if the information changes.

    I was wondering if having a python script connected to a server and reading an sql database opens up a huge security hole or whether this would create a huge system resource hog.

    If I cannot do it this way, are there any alternatives to retrieving data from a server to a local machine at samples of about 5 secs?

  2. Rolken


    Tech Member
    With the given information, the answer is "it depends." Implementation matters a lot; "keep a sql connection open across local ethernet and check whether the notification table is empty every 5 seconds" may have invisible resource impact, while "re-run a script every 5 seconds that opens a new sql connection across the Internet and checks all of the users to see if their information has changed" could bring your server to its knees and blow your attack surface wide open. You also have to be careful about race conditions.