Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Auto-increment ids
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
craiggwilson  
View profile  
 More options Aug 31 2012, 11:35 pm
From: craiggwilson <craiggwil...@gmail.com>
Date: Fri, 31 Aug 2012 20:35:47 -0700 (PDT)
Local: Fri, Aug 31 2012 11:35 pm
Subject: Re: Auto-increment ids

Do you have a natural key you can use?

On Friday, August 31, 2012 7:26:28 PM UTC-5, Mase wrote:

> Yea tried this, but you only gain a bit, they're still long and ugly. It
> also produces characters that are not valid in a URL.

> Not preferable. Other ideas?

> On Friday, August 31, 2012 4:02:13 PM UTC-7, Kevin English wrote:

>> Base 64 is a little better:
>> http://sebastian.formzoo.com/2012/04/12/mongodb-shorten-the-objectid/

>> On Friday, August 31, 2012 5:48:28 PM UTC-5, Mase wrote:

>>> I understand that auto-incrementing Ids in MongoDB are not a great idea
>>> for multiple reasons. I've been reading up on this in multiple places, but
>>> I still have some need for it.

>>> Mainly it's about URLs for me. I don't generally have an issue with
>>> ObjectId's, but when they end up in the URL of a web app, they're very ugly
>>> and bad for SEO. It would be better if I could have a much smaller ID to
>>> place in the URL. These auto-incrementing IDs in my case would not be the
>>> single identifier, and in fact I would still use the ObjectId to be the
>>> primary key on the collection.

>>> But if I'm really not willing to keep ObjectId's in the URL, and the
>>> auto-increment IDs still need to be unique as well as scale - is there a
>>> better alternative given my needs?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.