views:

21

answers:

1

Given the following two tables, what are some of the most efficient ways to track updates to a given entity (Entity table) and its data (EntityData).

Entity {
EntityID: Num
EntityData: Blob
}

EntityData {
ID: Num
EntityID: Num
Prop: String
Value: String
Type: Num
}

A: 

You can use triggers.

http://dev.mysql.com/doc/refman/5.1/en/create-trigger.html

knagode
Do you think trigger's is the way to go if the read/write (80/20) load is very high on the database with millions of records?
nethood
It would of course slow down your application but I think it will still be faster than do the tracking in for example PHP.
knagode