title: Base-camp Style Subdomains and IDs of Models
body: <p>I have an app that has Basecamp-style subdomains, that is, I have Projects, Users, Apples and Oranges.  The Users, Apples and Oranges are all keyed to a Project and only exist in the <a href="http://project.myapp.com" rel="nofollow noreferrer">http://project.myapp.com</a>.  I added a project_id to Users, Apples and Oranges and everything works, except of course that the ids of those three objects increment globally, and throughout my app I lookup objects by that id.</p>
  
  <p>This doesn't seem like best practice.  Should I instead do lookups by a secondary key?  How does that affect efficiency?  If there's a good blog post that covers this, would be wesome.</p>