My flask application stores some data in a database. I want this data to be discarded if my application has been down for some time. The reason for this is that I want to be sure that I missed no REST call to my application.
The obvious and efficient solution is storing this data in memory but I am open to any solution (e.g. delete old records on application restart).
If you don't need persistence in your application, why don't you use the SQLite backend (easy in flask) and store the database in memory (using the :memory:
filename as data base), then on each shutdown your data will be cleaned.
You can use persisted memory-mapped files. Python has a facility (mmap) to work with such files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With