1

Should every table have a Serial id? When would you need one, when wouldnt you? (associations, performance, etc?)

YouTube identifies videos with a key like "ttpYdIodMWc". I want something similar, but can't decide between id and identifier, or just a string key:

property :id, Serial, key: true
property :identifier, String, unique: true

# or

property :id, String, key: true

What is the suggested way for a SQL database, what about for NoSQL?


Some background - making a web app with Sinatra and DataMapper to support a Backbone client app.

AJcodez
  • 31,780
  • 20
  • 84
  • 118

0 Answers0