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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:22:00+00:00 2026-06-05T12:22:00+00:00

I am developing a web application in clustered environment. The issue is that we

  • 0

I am developing a web application in clustered environment. The issue is that we need to generate an ID for each entity that gets created. We are in an environment with a number of database nodes that are all streaming with each other. The idea that I had was a sequence with an offset. So one site would have IDs ending with 1, the next 2, and so on. This seems an unwieldy solution because you are limited to a number of environments. What is the “best” way to guarantee a unique generated primary key when you are in a disturbed database environment?

  • 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-06-05T12:22:02+00:00Added an answer on June 5, 2026 at 12:22 pm

    Personally, I’d prefer the sequence with an offset. Yes, you are limited to a certain number of environments but, realistically, you can generally set things up from the outset so that the number of available environments is much greater than what you’d really need. If you do something like

    At site 1

    CREATE SEQUENCE sequence_name
      START WITH 1
      INCREMENT BY 1000;
    

    At site 2

    CREATE SEQUENCE sequence_name
      START WITH 2
      INCREMENT BY 1000;
    

    and down the line, you can have up to 999 sites before you have to rework your sequences. That’s generally more than enough. If you think you might realistically have 1000 sites, you can simply set the increment to 10,000 or 100,000. Given the number of values a sequence can generate, you still won’t run out even if you set the increment in the millions. Realistically, you’ll encounter problems with Streams dealing with too many sites long before you’ll run into problems with sequences.

    If you don’t want to go down that path, the other option would be to use SYS_GUID to generate a globally unique ID and use that for your primary keys. That’s not as efficient as using a sequence and it will require more space but it does allow you to have an arbitrary number of machines.

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

Sidebar

Related Questions

I'm currently developing a web application using MYSQL database InnoDB format and need some
I'm developing a web application that will interact with google APIs. Since the only
I am developing a Java web application that bases it behavior through large XML
I am developing web application where users have collection of tags. I need to
I'm developing web-application (and also native iOS app) that uses images from different websites.
I am developing a web application using NetBeans and MySQL as the database. I
I am developing Web Application. In that i am using so many Div to
I'm interested in developing web application and networking application. For that what is the
I'm developing web application on python. But the client wants a tool that exports
What is the best windows environment to use while developing web application with heavy

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.