++ on using a database
SQLite files are wonderful for this sort of thing ... there is no “server.” There are useful utilities for importing text-files and so forth. The only gotcha, when you finally get down to programming that updates things, is a rather important one: use transactions. SQLite is specifically designed to commit data to disk and to re-read the data to verify it, every single time, unless a transaction is in-progress. (If there is, it buffers the data much more sensibly.) But, with that being said, it is an excellent and robust tool ... and free. (It is actually in the public domain.)
You’ve got millions of records to deal with, and you can’t be writing a Perl program every single time . . . You might find need to get to this data in all sorts of ways – reports, spreadsheets, who-knows. SQLite can take you there.