In general, flat-files (which I take to mean CSV, and not XML or similar) are not the answer for data that you want to update and query. They are more useful for data exchange. When database systems were difficult to come by, they were more common as a backend. These days, there's not much reason to use them for storage on a new project. I suggest you use SQLite, or at least abstract them with BDB::CSV.