Best practice about Table Name & Document ID in NoSQL

In the first question you should put in an addition field called “_entity”:“person” or “_entity”:“warehouse” that way you can put additional filter in your map/reduce

function(doc,meta){
 if(doc.name && doc._entity && doc._entity == "Warehouse"){
   emit(doc.name,1);
   }
}

or you can possible pre-pend you key to have that data old key : abc123 new key : wh_abc123 or per_abc123

For your second question it just depends.
You want it to be unique to prevent overriding a key & you don’t want it to big either as keys in Couchbase can only be 250 characters & every byte counts b/c memory is expensive.

To make a key super unique I do md5 or sha1 or sha2 (MAC Address of app server + time stamp + email address of user).