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 6155535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:27:09+00:00 2026-05-23T20:27:09+00:00

a while ago, i asked about how to implement a REST api. i have

  • 0

a while ago, i asked about how to implement a REST api. i have since made headway with that, but am trying to fit my brain around another idea.

in my api, i will have multiple types of data, such as people, events, news, etc.

now, with REST, everything should have a unique id. this id, i take it, should be unique to the whole system, and not just each type of data.

for instance, there should not be a person with id #1 and a news item with id of #1. ultimately, these two things would be given different ids altogether: person #1 with unique id of #1 and news item #1 with unique id #2, since #1 was taken by a person.

in a database, i know that you can create primary keys that automatically increment. the problem is, usually you have a table for each data “type”, and if you set the auto increment for each table individually, you will get “duplicate” ids (yes, the ids are still unique in their own table, but not the whole DB).

is there an easy way to do this? for instance, can all of these tables be set to work off of one incrementer (the only way i could think of how to put it), or would it require creating a table that holds these global ids, and ties them to a table and the unique id in that table?

  • 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-23T20:27:10+00:00Added an answer on May 23, 2026 at 8:27 pm

    You could use a GUID, they will be unique everywhere (for all intents and purposes anyway).

    http://en.wikipedia.org/wiki/Globally_unique_identifier

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

Sidebar

Related Questions

I asked a little while ago a question about rollback, I have a new
A while ago, I asked a question about $ , and got useful answers
I asked a question while ago about accessing the underlying container of STL adapters
I asked a question a while ago about which local DB was right for
I'm just rephrasing the question I asked a little while ago. I have a
I raised a question about this a while ago but I'm still having an
A while ago I asked about std::string constants correct idiom for std::string constants? .
I asked here a while ago about matching text inside of two wrapped <code>..</code>
I have question quite much related to this one I asked a while ago
A while ago I asked a question about hierarchy/version number sorting in SQL Server.

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.