The Case for GUIDs

  • I was reading Baseline yesterday and there was an article about Phillip Morris and their supply chain. There was a ruling recently that is requiring them to track every box of cigarettes from packaging to sale.

    Every box.

    Not just those cases or cartons sent to their suppliers, but every single box, including those that are illegally moved in and out of countries. The ruling is basically about capturing lost tax revenue, but it poses an incredible data requirement. Forget about the scanning, the equipment, the coordination, etc. Think about just the data.

    In reading the article, they talk about the challenges of applying the tags to the boxes, which can be cranked out at 14,000 a minute.

    Wow, talk about fast. Considering the Microsoft folks at the 2003 PASS Summit talked about identity fields getting bogged down at 400/sec, which is more than 14k/minute, but think about how quick you'd run out of space at this rate. With an int you'd run out of numbers in less than a year. With a BigInt you'd survive longer, but with multiple brands and the potential for keeping data around, not to mention the possible growth in packaging rates, this is a problem that seems perfectly made for a GUID.

    So Microsoft if you're listening, you might want to send a few sales guys out to Phillip Morris 🙂

    Steve Jones

  • Just to throw a monkey wrench in the mix (I like argumentation who would'a guessed); what about this situation with respect to Social Security Numbers.  Cigarettes boxes, like people, do not live forever.  If a package is not sold in, say a year, then it could be considered waste product. 

    With that premise, couldn't you simply restart your BigInt after a certain amount of time?  Maybe GUID's have improved dramatically, but whenever I have seen them implemented in the past, something went screwy with them, (yes, I knowingly used that technical term "went screwy") and they were abondanded.... 

    I wasn't born stupid - I had to study.

  • Sounds like it's time for the RFID factor to start kicking in!! Stick the Mac Address of the chip in as the Unique Identifier and have at it! (Course - when do we run out of those IDs??).

    Glad I don't have to solve this one! 🙂

  • Yes it's an interesting technical question, but its a very ominous political development. Notice that there was no indication that PM had anything to do with contraband, but they were being held responsible for what others did with their products in the distribution chain. For a first target, the EU starts with 'bad guy' tobacco, but this may be only the first step in mandating companies control what their customers do with products, and monitor who owns them and when.

    The implications for both businesses and their customers are not good.

    ...

    -- FORTRAN manual for Xerox Computers --

  • Guids, love them.  Nair a problem with them, but I don't let users edit them manually. .

     

    Consider the Phillip Morris issue again.  They could serialize each packet of cigarettes in a manner like this. One  scheme one could use here.   A combination of date and big-integer field as a compound key.  Zero out the big-int field each night and start from 1.  22305-1. 

    psuedo-code:

    read current date and highest big-int column number. increment big-int column by 1, write new record.

     

    Combine the date and bigint field together.  I'm not sure the performance statistics of this.

    With this schema, the cigarette manufacturer would know on the pack when it was made.  Using internal database they would know when it was stamped in the factory.

    date - big int field - boolean field production stamp ( 0 - not stamped; 1 - stamped ) - datestamp of stamping - machine #.

     

  • Jay,

    I could see the firearm industry being next! I have never understood how it can be considered the sellers responsibility to make sure the buyer doesn't use their product for illegal purposes?

    We (society in general) seem to be in a mode of passing the buck back up the chain (it can't be my fault - they did it!!).

  • Send a salesman to PM, for what?  SQL Server could never handle that amount of data...ever.  Call Oracle.

  • I don't see an issue with using a BigInt, or any other number, maybe even using an increment smaller than 1 for a Float, for an even longer life span.  I had a friend who needed a unique ID for web traffic transactions and they found that the GUIDs would actually recycle and were not guaranteed unique.  They went with the incremental ID and BigInt for greater success.  Also started out the counter at -2^63 - 1 to double the range.

    The way that I understand how GUIDs are created, I couldn't see how that could happen, but the source was pretty reliable.

    Andre

  • Mike;

    Check your facts.

    Winters Group: http://www.wintercorp.com/vldb/2003_TopTen_Survey/TopTenWinners.asp

    SQL Server runs 4 of the world's top 10 largest transaction processing databases by rows, across All Environments.  SQL Server runs the world's sixth largest transaction processing database for All Environments.

    Yes, Oracle is on there also.  But SQL Server fits multi-terabyte sizes just as well.

    Mark



    Mark

  • I think everyone is losing the point about using GUID on sql server...  I have a problem with this before because one in 20 milion or so I got duplicate record ....  Let's just say out of 50 milion GUID there are about 30-50 duplicate record generated and Microsoft hasn't really fix this problem yet.

     

    mom

  • I share mom's concern.  That's why I thought using the Numeric as an increment, and then using a decimal (say .001) and starting out with the lower end of the negative number range could really give you a large set of numbers to work with.

     

    Just a thought.

  • Just use a decimal(38,0) identity

    by my calculations at 14000/sec!!! plenty of room to grow it will take 226,343,484,385,921,073,121,620 melina to run out of numbers.

    We will not have to worry about it any more.

    But for extra room start at -9999999999999999999999999999999999999 for a seed

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply