Product Keys optimization
===

I am seeking advice on the following:

Keeping a list of what product key belongs to which client. For example, if i was issued with product key 8456-7894-4567-7894 This should be design in such a way that it would be easy to write the list to a database instead of a file.

How to  keep record of them in a file. 

If i want to migrate to a database in future and do not want to redo everything.

Thanks,