I'm working on multi user web application in Flask. Till yet I used MySQL as data source. Now, I'm adding some functionality that would require Prolog as inference engine. My question is related to way, how to handle fact and rules data. I don't think it is good option to create on each web request Prolog file from MySQL data a consult this new created file on server. Prolog data should be somehow persisted on server and Prolog engine update after addition of some fact or rule. Has anybody encountered this before? What is correct way of implementation of this kind of functionality?
So please, how to persist Prolog data in multiuser web application, where each user can add some facts or even rules. And other users should immediately see changed data. How to to it robust and proper way?