Use Database Identity Fields for Primary Key?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
johntalbott
Posts: 619
Joined: Wed Jun 17, 2015 11:16 pm
Location: Omaha, Nebraska
Contact:

Re: Use Database Identity Fields for Primary Key?

Post by johntalbott »

ACDC wrote:There are pros and cons of moving to GUID, all you have to do is google GUID VS INT and see the concerns of using GUID as the ID, specifically regarding database performance.
I completely agree that performance is a a big deal. As long as an ID using a GUID is not configured as a clustered index, the hit should be negligible relative the performance constraints of web applications in general.

Specifically within the AwareIM stack of moving parts, the performance bottleneck is never going to be using GUID as an ID.

1. Business Rules Engine rule processing
2. Queries - FIND is always translated to a "Select *"
3. The extra database call to increment and select the new id from the BAS_IDGEN table for every insert
4. The client-side parsing and rendering of every part of the UI
5. The generation of the XML containing the data sent over the wire which is then parsed on the client.

If we're looking for top-end performance, AwareIM isn't the right platform.
ACDC wrote: If AwareIM decides to go with GUID it should be optional, so a developer can choose based on the circumstance and type of application. I use the ID number for numbering and naming of documents and transactions. I can't imagine using a GUID for that purpose. The simplicity of using the ID for its uniqueness and ordered sequence across the DB is compelling.
In any event, you can have an Identity column for sequential numbering that is the clustered index if you like.
VocalDay Solutions - Agility - Predictability - Quality

We specialize in enabling business through the innovative use of technology.

AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
intra
Posts: 279
Joined: Thu Oct 11, 2012 1:30 pm
Location: Australia

Re: Use Database Identity Fields for Primary Key?

Post by intra »

On a totally non technical topic.
I know you still consider me the new kid on the block and rightly so.
Arnold,

Even if you have [x] amount of years exp with AwareIM, being the 'new kid on the block' shouldn't be a indication of the quality of your response.

Just ask the question. :)

I still make silly mistakes all the time! :oops:
Avid Linux user....
customaware
Posts: 2397
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Use Database Identity Fields for Primary Key?

Post by customaware »

The more you learn, the more you can forget.... ;-)
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Arnold
Posts: 24
Joined: Mon Apr 09, 2018 11:58 pm
Location: San Francisco Bay Area - California - USA

Re: Use Database Identity Fields for Primary Key?

Post by Arnold »

Just wondering in this discussion - what strategy would fit best to keep Aware IM working effectively but also be attractive to many new developers to the Aware IM community that have existing databases in production that they want to use Aware IM to develop their the web (and mobile) application version of their seasoned back office desktop application.

It appears that the "external database" concept as it is now is not really supportive of this market of developers. If the "external database" concept were eliminated with a change to the IDGEN concept - that could also eliminate the need to worry about redoing shortcuts every time an external database was updated via Discover Attributes - if I understand this right.
Jaymer
Posts: 2443
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Use Database Identity Fields for Primary Key?

Post by Jaymer »

Arnold wrote: It appears that the "external database" concept as it is now is not really supportive of this market of developers.
It would be nice if some development time could be put into "external database" connections period.
...to make it easier, more stable, more features, less restrictive, etc.

Don't know anything about "redoing shortcuts every time", but easier connectivity to bring legacy databases to the Web is a win win for everyone.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Arnold
Posts: 24
Joined: Mon Apr 09, 2018 11:58 pm
Location: San Francisco Bay Area - California - USA

Re: Use Database Identity Fields for Primary Key?

Post by Arnold »

BLOMASKY wrote: my 0.02 cents worth is PLEASE stay with INTs not GUID! Many times doing maintenance, I will find 1 (or more) records that I have to update and it is MUCH easier to type "UPDATE Table set field = 123 where ID between 100001 and 100003"

Bruce

Bruce - what kind of maintenance are you talking about and why is it needed - is it the result of the ID_GEN strategy or just "normal" maintenance? Just curious. Thanks
BLOMASKY
Posts: 1471
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: Use Database Identity Fields for Primary Key?

Post by BLOMASKY »

I am either "fixing" stuff that I coded wrong in aware, or (most of the time) the customer needs some data changed (like, WHOOPS, I entered new orders and I forgot to update the selling price 1st. Can you please update the following orders....)

So its stuff like "Update OrderLines set tripNumber = 0 where ID between ......"

Bruce
Post Reply