On Wed, Oct 7, 2009 at 2:23 PM, Mitch Pirtle <mitch.pir...@gmail.com> wrote:
>
> OTOH most object/document databases generate an internal identifier
> for scale, sharding and whatnot (like MongoDB). So there are valid
> reasons for going the auto increment route, but I do believe too many
> people just automatically design every table to rely upon it.

These databases can't do arbitrary joins, and so would never have a
many-to-many connector table.  In performant object stores, you would
store all the student ids with the class, and also store the class ids
with the student object.  To have a many-to-many relationship, you
must duplicate the data.

Adding auto_increments to connector tables is always bad form, IMO.
The auto increment can lead to duplication, provides no additional
information, breaks certain types of queries, bloats your sql code,
and slows down query performance.  I know of no good reason to add the
extraneous information to the table.

-John Campbell
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/Show-Participation

Reply via email to