× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'll give you an example. Unique customer id. It was deemed that customer id's were only required to be up to 6 characters in length. However, we are now reaching 9999999 customers, no one ever thought you would get that many customers! They print customer id on hundreds of documents, and it is well known what it is by many units in the organization.

That key (6 character column) was used throughout hundreds of files. We now need to increase the length. What do you do? In RPG that means changing hundreds of RPG programs most likely and recompiling. In .NET we don't need to do anything, a string is a string, we don't care how long it is typically so .NET shields you from some of those types of changes.

Now, if all those hundreds of files were using surrogate integer (or better yet 64bit integer) single primary keys, we could instead increase the length on the customer id field (the 6 character one) in only ONE table. All the other tables are already using a surrogate key that can grow to trillions in length to link back to that one customer record.

This rule basically applies to anything where you need to change a data type in a table, and it is used as a reference in other tables to join. You cause yourself a lot of development pain when not using surrogate keys for everything because invariably someone always thinks of a reason to change a human readable key such as an order #, customer #, payment #, etc for one odd case or another due to an error in processing, a data modernization effort, or many other reasons and surrogate keys will shield you from a lot of those changes.

-----Original Message-----
From: Rob Berendt [mailto:rob@xxxxxxxxx]
Sent: Monday, August 28, 2017 11:49 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: RE: Database design question

Trying to see what business reason there would be to changing the customer number. Was another rule violated? Such as always use meaningless numbers? For example, decades back we use to teach a class on wire nomenclature to new employees. This was used to help explain our item numbers. Each part of the item number helped to categorize the part. Of course, this is a glaring violation of the database rule and would require you to change the part number if it got recategoried.


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Justin Taylor <JUSTIN@xxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 08/28/2017 12:40 PM
Subject: RE: Database design question
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



The arbitrary identify column protects you in the case the business data
key needs to change. In your example, if the customer numbers needs to
change, it would be a non-issue if you have an identify column. If the
customer number is the primary key, things get sticky.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.