1. from the book <Developing with Couchbase Server> on page 34 from oreilly 
which ISBN is 978-1-449-33116-0 by MC Brown.
2. If I use REST api to create doc, what is the best practice to generate 
UUID as ID?
As long as possible or The shorter, the better?

On Tuesday, June 16, 2015 at 2:03:22 AM UTC+8, Jens Alfke wrote:
>
>
> > On Jun 15, 2015, at 9:25 AM, atom992 <[email protected] <javascript:>> 
> wrote: 
> > 
> > I am thinking about how long should I design the length of document IDs. 
> As we know,All document meta‐ data, including the document ID, is stored in 
> memory at all times 
>
> That’s not true; where did you read that? 
>
> > but too short IDs might not be sure unique. so for the best practice, 
> how long should I design the length of doc IDs. 
>
> It depends on your needs. If you don’t care what the docID looks like but 
> it has to be unique, just use Database.createDocument, which will generate 
> a random UUID. 
>
> If you do care about the docID, you can come up with unique ones that are 
> a lot shorter. For example, if you need a unique ID for a user’s profile 
> document, just use “profile:”+username. If you need a document for a 
> particular product in your inventory, just use its SKU or UPC number. 
>
> —Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/83656c57-09ce-48ea-93f2-fe1d86465cba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to