iFeghali,

Your decision will need to be based on your specific application. Take
a look at the following tradeoffs and determine what's best for you.

1) Will a telephone EVER POSSIBLY have both a supplier AND a
customer?  If so, you def. want to go with option a; otherwise, you'll
need to have two different records for one phone in your table, which
is bad.  If you can have both, you should stop reading this and just
choose option a -- not duplicating data in your system is that
important.
2) If you use option b), you will still need to have a foreign_model
entry so that you can tell *just by looking at the data* where models
connect.  This will be helpful.  Sure, you can code that logic into
your web app, but IMO it's going to be better in the long run to have
it in the db schema.

The UUIDS will be more of an issue, as they are pretty bad performance-
wise for primary keys on large tables (compared to INT).  I don't
think that you need this -- who cares if one telephone has a
customer_id = 3 && supplier_id = 3?  The related data will be in
separate data.  It doesn't look to me like you need UUIDs, which tells
me that you should probably change it back for performance sake.
Normally I don't suggest premature optimization, but I've found that
primary keys based on non-INT data types can be really slow.

HTH,
Travis

On Jun 8, 9:39 am, iFeghali <igor.fegh...@gmail.com> wrote:
> ok this is similar to that question:
>
> http://groups.google.com/group/cake-php/browse_thread/thread/1d24a16f...
>
> but the suggested solution is to add a forth model in the top which i
> prefer not to do for now. any other feedback on this ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to