I´m already doing an app just like your, and I decided to use just one "User" table due to the Auth Component. But yesterday I found a cool piece of code in Bakery, it´s Extendable Behavior, that allows me to have models for Student and Teacher, that extends User model. Now it´s down in Bakery due to some changes in the code, but you can find the source code here:
https://anon.svn.ariworks.co.kr/projects/extendable/trunk/app/models/behaviors/extendable.php Hope it helps. Cheers, mbavio On Jun 12, 12:23 pm, Cheeze <[EMAIL PROTECTED]> wrote: > Cool. Thanks to everyone who replied! > > On Jun 12, 10:37 pm, villas <[EMAIL PROTECTED]> wrote: > > > If there are lots of differences then maybe the_woodsman's idea may > > help. Or, if the info is completely different then two tables is > > probably right. > > > However, if the information required for both is somewhat similar (eg > > name, address, tel no, email etc), then I would definitely suggest > > one single table. Even if you have to make a couple of extra fields > > specific to students or teachers, it's still better in one table. > > It's so much more flexible and easier to integrate into the rest of > > your application. With of course the added bonus that once a student > > becomes a teacher, you can just change the flag :-) > > > Say, for example, you want to send newletters: one to teachers, > > another to students and then a third one to everyone. You can > > essentially use the same code. > > > With regards performance, don't even think about that being a > > problem. MySQL for example would handle tens of thousands of records > > without even blinking, especially if all the data was indexed in one > > single table. > > > HTH > > > On Jun 12, 2:20 am, Cheeze <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I'm planning for a project for schools. As you might imagine there are > > > mainly two groups of users - Students and Teachers. > > > > I'm at the stage of designing the database tables and was wondering if > > > having separate tables for students and teachers might yield better > > > performance than having a single table with a column indicating the > > > user as a student/teacher. > > > > I'm thinking that having separate tables might improve concurrency > > > when many students and teachers are using the site at once (think read/ > > > write locks) since they are using different tables. > > > > Granted, I'm not writing the app for millions of users, but if it > > > helps to improve the performance, it'll translate to better user > > > experience. And I guess there are others out there who are curious > > > about it as well. > > > > Thanks. > > > > P.S. Kudos to the Cake team for coming up with RC1 of 1.2. Yet another > > > great release. Thanks to all who made this possible! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
