Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6546867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:45:39+00:00 2026-05-25T11:45:39+00:00

I have an app that uses standard id integer autoincrement values. I also have

  • 0

I have an app that uses standard id integer autoincrement values. I also have another table that manages a global_id which is currently set as an integer. I’m thinking it would be preferable to use a non-integer for this global value so that it would be clear whether the item id or global id is being used based upon existence of a non-integer:
for example:

site.com/item/id/123 - item id
site.com/item/id/12j45 - global id

Internally the global identification table will still keep it’s id value (not sure about this). But I’d like to have a non-integer global_identifier_id. Is there a MySQL datatype that could handle this? Like get the id value and postpend a single (potentially) random character (1 to 1b, 2 to 2d).

Is there a better scheme for handling this? For example, was also thinking id of object in question with objects registered to a phrase – hence location is id 123 but becomes 123loc as a global value. Perhaps, there is a rails component that already does this?

thx

@Doug
yes regarding uniqueness across tables; basically, a version of the object relational impedence mismatch issue (lists of objects). There is currently two sets of ids and I manage it manually similar to what you propose as two namespaces.

The namespaces are not needed though because if one is set up as int only and the other is set up as anything else, you know you are looking at a global_id.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:45:40+00:00Added an answer on May 25, 2026 at 11:45 am

    It would be preferable to have two namespaces, such as:

    site.com/item/id/123
    site.com/item/gid/12j45
    

    Otherwise, you would be requiring the global_id to have a character to differentiate it from the integer field, and create unnecessary cycles to determine how to query the data, based on the content of the data.

    What are you trying to accomplish with having a global_id? Is it a level of uniqueness across multiple tables? If so, simply appending a letter to the id field won’t suffice. Probably setting up a few triggers would do the trick, but I’d think through the process a little more first.

    UPDATE: For uniqueness across multiple tables, there are a bunch of answers, but one simple one is:

    CREATE TABLE global_references (
        id int NOT NULL auto_increment PRIMARY KEY,
        reference_type varchar(50) NOT NULL,
        reference_id int NOT NULL,
        UNIQUE KEY akGlobalReferences (reference_type, reference_id);
    

    When you add a new record, insert a corresponding row in this table with the tablename and new id, and use the resulting id as your globally unique ID.

    You may already have this in place and are looking for an alternative method of storage to add a character. If you truly want the same URL for both types of IDs, I’d recommend just having an ‘inferred’ prefix to the ID field. For instance, if the two URLs:

    sites.com/item/id/123
    sites.com/item/id/g123
    

    You would check the first character. If it’s g, strip it off and check the global table. Otherwise, check the table in question. However, I still recommend separate URLs for this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a standard php app that uses SQL Server as the back-end database.
I am distributing an app that uses the Python/C API. I have all standard
I have a C++ app that uses standard socket calls and I want to
I have a standard Rails app that uses a database, sqlite3 and the webrick
I have an iPhone app (in XCode 4) that uses the standard Tab Bar
We have an app that uses simple one way binding with a GridView to
I have an app that uses EF. To test my stuff I generally wrap
I have an app that uses the python/c api and I was wondering what
I have an app that uses a tableview, along with a UIButton that I
I have a App that uses the In App feature. -(void) completeTransaction: (skPaymenttransaction *)transaction{

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.