Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I noticed wordpress/rails etc do not use foreign keys constraint or cascade deletes features from database. Instead they handle this in PHP/Ruby/scripting level!

I have read thisthis and thisthis. Most arguments against foreign keys constraint talks about performance, multithreading, locking, scalability, etc.

Assuming arguments against foreign keys are valid, my question are:

  1. If foreign keys are bad, why WordPress/Rails/etc uses a sql-server which supports foreign keys? Will they benefit going away from MySQL to a NoSQL kind of server?
  2. On other hand, can applications coded in a way to make use of foreign keys feature without running into issues?
  3. Is noSQL/redis better if we are using database only for storage and managing "relations" at application/script layer?

I noticed wordpress/rails etc do not use foreign keys constraint or cascade deletes features from database. Instead they handle this in PHP/Ruby/scripting level!

I have read this and this. Most arguments against foreign keys constraint talks about performance, multithreading, locking, scalability, etc.

Assuming arguments against foreign keys are valid, my question are:

  1. If foreign keys are bad, why WordPress/Rails/etc uses a sql-server which supports foreign keys? Will they benefit going away from MySQL to a NoSQL kind of server?
  2. On other hand, can applications coded in a way to make use of foreign keys feature without running into issues?
  3. Is noSQL/redis better if we are using database only for storage and managing "relations" at application/script layer?

I noticed wordpress/rails etc do not use foreign keys constraint or cascade deletes features from database. Instead they handle this in PHP/Ruby/scripting level!

I have read this and this. Most arguments against foreign keys constraint talks about performance, multithreading, locking, scalability, etc.

Assuming arguments against foreign keys are valid, my question are:

  1. If foreign keys are bad, why WordPress/Rails/etc uses a sql-server which supports foreign keys? Will they benefit going away from MySQL to a NoSQL kind of server?
  2. On other hand, can applications coded in a way to make use of foreign keys feature without running into issues?
  3. Is noSQL/redis better if we are using database only for storage and managing "relations" at application/script layer?
Tweeted twitter.com/#!/StackDBAs/status/346403934295973888
Source Link
rahul286
  • 215
  • 2
  • 3
  • 10

If foreign keys/cascade deletes are bad, why use a database-server with that feature?

I noticed wordpress/rails etc do not use foreign keys constraint or cascade deletes features from database. Instead they handle this in PHP/Ruby/scripting level!

I have read this and this. Most arguments against foreign keys constraint talks about performance, multithreading, locking, scalability, etc.

Assuming arguments against foreign keys are valid, my question are:

  1. If foreign keys are bad, why WordPress/Rails/etc uses a sql-server which supports foreign keys? Will they benefit going away from MySQL to a NoSQL kind of server?
  2. On other hand, can applications coded in a way to make use of foreign keys feature without running into issues?
  3. Is noSQL/redis better if we are using database only for storage and managing "relations" at application/script layer?