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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:42:03+00:00 2026-05-13T07:42:03+00:00

We all know that for relational databases it is best practice to use numerical

  • 0

We all know that for relational databases it is best practice to use numerical IDs for the primary key.

In couchdb the default ID that is generated is a UUID. Is it best to stick with the default, or use an easily memorable identifier that will be used in the application by the user?

For example, if you were designing the stackoverflow.com database in couchdb, would you use the question slug (eg. what-is-best-practice-when-creating-document-ids-in-couchdb) or a UUID for each document?

  • 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-13T07:42:04+00:00Added an answer on May 13, 2026 at 7:42 am

    I’m no couchdb expert, but after having done a little research this is what I’ve found.

    The simple answer is, use UUIDs unless you have a good reason not to.

    The longer answer is, it depends on:

    Cost of changing ID Vs How likely the ID is to change

    Low cost of changing and likely to change ID

    An example of this might be a blog with a denormalized design such as jchris’ blog (sofa code available on git hub).

    Every time another website links to a blog post, this is another reference to the id, so the cost of changing the id increases.

    High cost of changing ID and an ID that will never change

    An example of this is any DB design that is highly normalized that uses auto-increment IDs. Stackoverflow.com is a good example with its auto-incrementing question IDs that you see in every URL. The cost of changing the ID is extremely high since every foreign key would need to be updated.

    How many references, or “foreign keys” (in relational DB language) will there be to the id?

    Any “foreign keys” will greatly increase the cost of changing the ID. Having to update other documents is a slow operation and definitely should be avoided.

    How likely is the ID to change?

    If you are not wanting to use UUIDs you probably already have an idea of what ID you want to use.

    If it is likely to change, the cost of changing the ID should be low. If it is not, pick a different ID.

    What is your motivation for wanting to use an easily memorable ID?

    Don’t say performance.

    Benchmarks show that “CouchDB’s view key lookups are almost, but not quite, as fast as direct document lookups”. This means that having to do a search to find a record is no big deal. Don’t choose friendly ids just because you can do a direct lookup on a document.

    Will you be doing many bulk inserts?

    If so, it is better to use incremental UUIDs for better performance.

    See this post about bulk inserts. Damien Katz comments and says:

    “If you want to have the fastest
    possible insert times, you should give
    the _id’s ascending values, so get a
    UUID and increment it by 1, that way
    it’s always inserting in the same
    place in the index, and being cache
    friendly once you are dealing with
    files larger than RAM. For an easier
    way to do the same thing, just
    sequentially number the documents but
    make it fixed length with padding so
    that they sort correctly, “0000001”
    instead of “1” for example.”

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

Sidebar

Ask A Question

Stats

  • Questions 300k
  • Answers 300k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer For people that absolutely need performance, boxing and unboxing and… May 13, 2026 at 8:01 pm
  • Editorial Team
    Editorial Team added an answer I don't think there is a limit to the number… May 13, 2026 at 8:01 pm
  • Editorial Team
    Editorial Team added an answer You can get the width and height of the image… May 13, 2026 at 8:01 pm

Related Questions

I'm working on a simple project to create tables and insert data into them,
I was just think that now it is common to have enough RAM on
My primary question is which approach is faster. Some briefing I'm developing an application
How would you implement a system with the following objectives: Manage authentication, authorization for
By edict, we're using stored procedures for all interactions with our database. By organizational

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.