最优雅的方式来对抗重复的条目

I am working on a solution to prevent duplicate entries into a database that may occur as a result of my configuration.

I am planning to do a md5 hash of some values and check the table to see whether that hash already exists.

Is this more efficiently achieved using a mysql table or something along the lines of a txt file on the server?

Can anyone propose a more elegant solution?

I appreciate any and all help.

You can create a UNIQUE INDEX and add to it the column set in which values you don't want to be duplicated. Then the DB will return you an error on every transaction that attempts to duplicate that data. Check this: Create Index on MySQL reference