Jump to content


How to uniquely identify a device.

  • Please log in to reply
1 reply to this topic

#1 nick1

  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 21 October 2006 - 12:25 AM


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
-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.

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,


#2 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 22 October 2006 - 08:14 PM

For a DB, use a UID (i.e. from an auto-increment field) -- but this never has to leave the DB... where are you going to "display" this number, anyway?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users