I have a process that builds a list from a database table and runs real time. Every now and then new data gets added to the database table. Querying data from the table every now and then is cumbersome, and time consuming, and this need to be as real time as possible.What is the right way to approach the problem?
The process is as follows
list gets build from an SQL Query that takes 2-4 seconds to execute.
List is used by Process A to perform some functions
Data gets constantly added to the Database Table. We need only the new data to get appended to the list, which will be used real time by the process A.
I have not tried writing any code yet, I am still not sure what kind of design it should be. Python is the only language we can use since there are 10,000 lines of Python code already deployed as a part of the system.
Can someone help me with the right approach, modules etc?
EDIT Process A is a procedure within the program. Pusedo code I am thinking off is something like this
def processA(list): while 1: parse file do something
def run(): list = generate list from run sql query processA(list)
if name=="main": run()