Best practices: zip codes as csv or in database?

Hello Everyone,
I would like to implement the following:
when entering a zip code, the name of the city and possibly the state/region is automatically entered in another field in the form. For this I will create a client script, but here the question arises for me which is the better way to solve it.
A) A doctype “ZIP code” is created and the data is all imported into the database once. This could then be linked to another doctype “City”.
B) There is a CSV file from which the city names are searched. However, nothing is written to the database

What do you think is the better solution, or is there already a solution here?