inVINCEable Posted June 23, 2007 Share Posted June 23, 2007 Well, over the past few days I have been familiarizing myself with CakePHP since it is my first project with it. I have the MVC concept down pretty well. I also know how to use the ACL and the two scripts, bake and the acl script. I understand how everything works, although I am a little confused about how I should go about doing something. In my database I have 100 cities each with a city_id. When I user signs up, his username is linked to the city_id to which he city he selected when he signed up. The users will submit their stories, which will be linked to a city_id, so each story can exist in one city alone. Users will be voting upon each story and will be given a score based up the algorithm I have designed. The question here is... do I create one default view called something like 'Home' and just fill in the parts with queries like "SELECT STORY WITH HIGHEST SCORE FROM STORIES WHERE CITY_id=USER_CITY". Will this kind of default home page create too much stress on my server. It is an average dedicated server nothing special, single core. If you want to what my goal is, please take a look at topix.com The site idea is different but I want to know how I should design the view for that homepage that has information pertaining to your city. Thank you VERY much for any advice on this. All comments/suggestions are welcome. Quote Link to comment https://forums.phpfreaks.com/topic/56896-cakephp-views-to-display-network-putting-too-much-stress-on-server/ Share on other sites More sharing options...
redbullmarky Posted June 24, 2007 Share Posted June 24, 2007 i'm not really sure where your worries are, here - i cant see anything too intensive unless i'm missing something. read up about Models in Cake's documentation as you'd be able to read the user details (and hence the city details) automatically just by reading in the articles using the hasMany, belongsTo, etc. However, in your articles table, I'd suggest you store the city_id as well as the user_id. If a user moves house and updates their details, then this way the article will still be attached to the user but still relevent to the city it was initially written from. So nothing really about the view, but just thought i'd point out all that anyway Cheers Quote Link to comment https://forums.phpfreaks.com/topic/56896-cakephp-views-to-display-network-putting-too-much-stress-on-server/#findComment-281189 Share on other sites More sharing options...
inVINCEable Posted June 25, 2007 Author Share Posted June 25, 2007 i'm not really sure where your worries are, here - i cant see anything too intensive unless i'm missing something. read up about Models in Cake's documentation as you'd be able to read the user details (and hence the city details) automatically just by reading in the articles using the hasMany, belongsTo, etc. However, in your articles table, I'd suggest you store the city_id as well as the user_id. If a user moves house and updates their details, then this way the article will still be attached to the user but still relevent to the city it was initially written from. So nothing really about the view, but just thought i'd point out all that anyway Cheers Thanks again, always quick on the reply redbullmarky I guess I was just wondering if the constant loading of multiple stories on different pages would somehow overload my server. Guess not though, thanks again! I have just started the design process on this today and it seems fine, I am just wondering at what point will my server start to die on me. Quote Link to comment https://forums.phpfreaks.com/topic/56896-cakephp-views-to-display-network-putting-too-much-stress-on-server/#findComment-281686 Share on other sites More sharing options...
redbullmarky Posted June 25, 2007 Share Posted June 25, 2007 cake does have plenty of caching options (though how good they are i dont know, as i've never set them up and tried them yet) - might be worth having a look at the ones available - that'll help a little bit. Quote Link to comment https://forums.phpfreaks.com/topic/56896-cakephp-views-to-display-network-putting-too-much-stress-on-server/#findComment-282209 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.