I would like my program (written in Python) to monitor a given file system's hierarchy, record it into persistent data storage, and be able to update it when the file system changes. It might be read into volatile memory for quick access.
I've found some posts that suggested "the best persistent storage method to use with Python" here and here, as well as another post that answered "how to represent a filesystem in a relational database" here.
From the above links, it appears that SQLite is a good choice for persistence, as it is quick. However, I couldn't find much opinion on how good it is to use a database to store and represent filesystem hierarchy.
My considerations for the method implemented are:
- Performance/Speed
- Scalibality: I need to monitor and keep updated a hierarchy potentially up to hundreds of thousands of files
- Ease of use: when I read the file system hierarchy into memory
- Any other suggested considerations?
Is it a good idea to use a RDBMS to represent a filesystem hierarchy? What are the pros and cons in this method? Do you have other suggested methods, and what are the pros and cons of such methods?