Greetings,

It's been awhile since I've actually had to design a database schema.
Lets say you're an I.T. person at your organization and you want to development
some type of inventory system that keeps track of all your servers, switches, routers, environmental monitoring units, KVM's, etc. This inventory system will use a MySQL database to organize things. Your core question is "How do I uniquely identify each one of my devices?" That's my question too.

I was thinking this over and came up with several criteria by which a device could be uniquely identified. A device could be uniquely identified by:

-serial number
-name
-IP address
-MAC address
-some database-generated number

Then I thought about the pro's and con's of each of these items:

-Serial number:
Pro's: Each device has a unique serial number.
Con's: However each serial number can have several devices. For example, virtual hosts(think VMware). One virtual host can have many virtual servers inside of it. As a result, many devices can have the same serial number.

-Name:
Pro's: Each device has a unique name. No two devices can have the same name.
Con's: ?

-IP Address:
Pro's: Each device has a unique IP address. No two devices can have the same IP address.
Con's: One device can have several IP addresses (some funky NIC setup). A virtual host that uses NAT for its virtual servers (this is probably
rare though). A network device that performs NAT and has computers behind it(again, probably rare at our organization).

-MAC Address:
Pro's: Each device has a unique MAC address but do ALL devices have a MAC address? No two devices can have the same MAC address.
Con's: ?

-Some database-generated number:
Pro's: Each device would have its own unique # that would be generated by MySQL. No two devices can have the same #.
Con's: none.

So my question is: what's a solid "key" to use which can uniquely identify each device? Maybe the best option is using two keys? Or maybe there's a better key to use besides that which I've mentioned here? All suggestions are greatly appreciated.

Thank you for your time,

Nick

    The best thing is to have a database generated number as a primary key, then nothing would change that. But that key could be used just in the database, and there could be other unique values as well. How to decide what other value/values should be used as unique I can't help you with, but I can add a few comments to your list and a recommendation:

    Name:
    Con's: What if the name of a device is to be changed in the future?

    IP Address:
    Con's: Is there a chance that the IP address will change in the future? If you change ISP, will you still have the same address?

    MAC Address:
    Con's: MAC addresses can be changed. And when changing network card it will be changed.

    Some database-generated number:
    Con's: Hard to keep track of what device have what number.

    My recommendation:
    I suggest that you use a database-generated number as the primary key to be used in the database. Then you can use all the other identifiers to search, but the unique should probably be all together. Then you can search and find the right device, and you can change outdated information without problems.

      Write a Reply...