Re: Creating and saving IDs - is there a theory?
Posted in 1997
Topics: General Discussion
Al Froehler wrote: > > On 1 Apr 1997 19:23:09 -0700, doug@modsoft.com (Doug Dumitru) wrote: > > >"Lior Messinger" <messingr@netvision.net.il> wrote: > > > >>Hi, > > > >>We are designing a project where we need to create, save and then verify > >>huge amounts of IDs (or serial numbers), for inventory items. We need to do > >>the saving part and the verification very fast, on a server. This is done > >>to verify that the items are not faked. The project is done on NT and Unix. > >>Is there any theory about doing that? > >>We thought of saving the IDs in a database, where each item belongs to one > >>user. Have you heard of something that was done in this way? Any ideas of > >>your own? If we take the database approach, what is the most suitable > >>database to do that? Would it be a relational database, or else? > > > >>So many questions... > > > >From a purely theoretical point of view, you need an application that can > >maintain a very fast "direct hit" index...... Hashing > >is far and away the fastest indexing method when only direct hits are required > >(as opposed to sequential access). > > One further suggestion, put a check digit on your "Id" numbers. A > simple calculation can determine if the digits are scrambled proior to > look-up. > > Al If you are going to the trouble of using a database to store the ID's, then why not use a sequence. The values are generated but the DBMS atomically so that no two requestors get the same value. I'm most familiar with ORACLE on this but I'm sure any relational DB has them. Keep in mind that if multiple sources are requesting these ID's, the sequence may appear to have gaps to any one source. (e.g., A & B both need two ID's. A requests one, then B requests one and then another, then A gets another. so A gets 1 and 4 while B gets 2 and 3. The only thing you know for sureis that the sequence increases.) Just one more idea. -- I shall be telling this with a sigh | email: Somewhere ages and ages hence: | edprochak@interfacefamily.com Two roads diverged in a wood, and I-- | I took the one less travelled by, | and that has made all the difference. --Robert Frost