Jump to content

CakePHP Views to display network? Putting too much stress on server?


inVINCEable

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.