IFDB's predecessor, Baf's Guide to the IF Archive, was an extensive catalog of the games at the IF Archive. Baf's Guide included search and cross-referencing features, and provided well-written capsule reviews for a huge selection of the IF Archive's games.
Baf's Guide assigned a unique number to each game in its database. This number was designed to be a permanent ID for the game. If you go to the Baf's Guide site and navigate to a page for one of the games, the original URL of the game page should look something like this:
http://www.wurb.com/if/game/395
The number at the end of the URL is the Baf's ID - in this case, 395.
Since Baf's Guide is no longer maintained, newer games won't have a Baf's Guide ID.