Flask Storage

In my application, the checkbox stores some data in the database. I want this data to be discarded if my application has been disconnected for a while. The reason for this is that I want to be sure that I did not miss a REST call in my application.

An obvious and effective solution is to store this data in memory, but I am open to any solution (for example, deletes old records when the application is restarted).

+7
source share
2 answers

If you don’t need persistence in your application, why don’t you use the SQLite backend ( easy in flask ) and save the databases in memory (using the file name :memory: as the database), then your data will be cleared every time you exit.

+9
source

You can use saved files with memory mapping . Python has an object ( mmap ) for working with such files.

+2
source

All Articles