"read performance is very important" in this case i would go for both
a) group them via group_id (to modify or find by group) b) use a word as key (mysql index key) c use my jsonable behavior to store all synonyms to this word in the same row (0..infinite) http://www.dereuromark.de/2011/07/05/introducing-two-cakephp-behaviors/ so the result would be id | name | group_id | synonyms -------------------------------------- 1 | auto | 1 | [car, vehicle] 2 | car | 1 | [auto, vehicle] the jsonable behavior will store the array as json and return the json as array this approach uses redundancy to avoid joins remember: if you edit one the others in that group need to be updates as well just my ideas :) On 20 Okt., 14:42, Kanten <[email protected]> wrote: > Dear all, > > I have been trying to find the best and most cake-like solution for > storing data on synonyms in my app. The synonyms come in groups of > maximal four and read performance is very important but write > performance not so. > > One of the solutions I have been thinking is just to store to them in > table like this: > synonym1 | synonym2 | synonym3 | synonym4 > > This is of cause very cake-unlike but should perform well. > > Another solution is this table design: > word | synonym_group_id > > Synonym_group_id should just be a a unique group ID and no other > information need to stored about the group, so a dedicated > synonym_groups table would just be a ID-counter and could/should maybe > be omitted. > > Any thoughts on this > > Kind regards > Anders -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
