Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (Oracle)
 Ok... how about this for an ID
 Forum Locked  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

h20
Starting Member

39 Posts

Posted - 16 November 2000 :  19:08:39  Show Profile
Another idea is to use MMDDYYYYhhmmss+username as the topic id... the only way to duplicate this is if there was a double posting... and we do not want that anyways...

the great thing about this is that all of the id processing would be independent of the databse... less querying trips... equals faster topic posting... plus it will be cross db.

<

gor
Retired Admin

Netherlands
5511 Posts

Posted - 17 November 2000 :  03:22:52  Show Profile  Visit gor's Homepage
quote:

Another idea is to use MMDDYYYYhhmmss+username as the topic id... the only way to duplicate this is if there was a double posting... and we do not want that anyways...

the great thing about this is that all of the id processing would be independent of the databse... less querying trips... equals faster topic posting... plus it will be cross db.


If you use:

YYYYMMDDhhmmss + Rnd(9) + user-ID

you would be have an easier to read date-format (the same as the current date-format), eleminate any risk of duplicate numbers.

I personally like this idea, it would just take some extra coding in the setup.asp to convert all the existing forums ... you would need some codechanges in the forums itself ... no need for locking or transactions ... AND easier to backup and restore topics.

Now this could work for category-ids, forum-ids, topic-ids, reply-ids.
All we would need then is to think about something to create an unique member-id

Pierre Gorissen

Even if you're on the right track,
you'll get run over if you just sit there.

Will Rogers<
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 17 November 2000 :  11:45:34  Show Profile
I would not adopt this idea. What if the admin changes the server clock (back)?

Plus you get a ID that is quite lengthy, and as I mentioned elsewhere I think sequential numbers for DB ID's is a better method.

.02


======
Doug G
======<
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20593 Posts

Posted - 17 November 2000 :  12:00:50  Show Profile  Visit HuwR's Homepage
I don't think sequential numbers for each db really helps that much, If I delete a load of stuff they are no longer sequential.

Using one sequential system, linked to a user id reduces the risk of duplicates significantly.

Without table locking, extracting a value to update and use is just as prone to failure on a large system.

.02

'Resistance is futile'<
Go to Top of Page

h20
Starting Member

39 Posts

Posted - 17 November 2000 :  12:51:29  Show Profile
Gor...

Whatever format we choose for the date and time... I think using this format:

date+time+userid

is the only way we are going to get this forum cross-db. There really is no performance advantage you using sequential numbers for the ID. Sure it is the most intuitive approach, but I think performance and cross compatibility is far more important. Besides, if we do use the date+time+userid format, the ID calculation is done in the asp code... less trips to the db... less processing on the server side... equates to faster posting.

We may even want to include something like this, hang on to your boots:

forumid+topicid+date+time+userid

This too would increase the querying. Think about it, you would not need to query multiple tables to display the replies -> for a topic -> for a forum. You could tell by the message id what forum and topic it belonged to. Instead of having to first query the topics once a forum is clicked.. than querying the replies once a topic is clicked... which takes 2 trips to the db.. you could do it all in one trip.... using the forumid+topicid+date+time+userid.

For those of you familiar with creating logical db designs... you will probably notice that this is basically changing the forum->topic->reply relationship to a classification structure... or ISA relationships...


<
Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 17 November 2000 :  12:59:16  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
quote:

I would not adopt this idea. What if the admin changes the server clock (back)?


This could definitely throw some monkeywrenches into the work. Especially in the US with Daylight Savings Time (I thought this was an American concept, or is it multi-national? I honestly don't know).

I agree with Doug, I think a sequential number system is best.

Dave Maxwell
--------------
When's the next meeting of Snitzaholics Anonymous

Edited by - davemaxwell on 17 November 2000 12:59:55<
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20593 Posts

Posted - 17 November 2000 :  13:00:34  Show Profile  Visit HuwR's Homepage
Wouldn't you need multiple functions to this, one for fourm id's , one for topic id's etc, would it not be better to just have a generic getnewid() function, this means it can't be based on userid either.

You should be able to work it with just the date/time string, if you keep it a unique field, you can trap for errors to ensure it posts, if not grab a new id and post again.

'Resistance is futile'<
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000 Version 3.4.07