• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Object In Application Scope or new Object every request?

Community Beginner ,
May 10, 2006 May 10, 2006

Copy link to clipboard

Copied

Hi,

I was wondering which is more efficient? I have an array of url's, maybe as many as 50,000 urls. This array will be frequently updated based on user activity. My question is would it be more efficient to put the array into application scope, or create a new array for each request and user and how big of an object is too big to store in application scope?

Thanks...
TOPICS
Advanced techniques

Views

318

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 10, 2006 May 10, 2006

Copy link to clipboard

Copied

madtux2 wrote:
> Hi,
>
> I was wondering which is more efficient? I have an array of url's, maybe as
> many as 50,000 urls. This array will be frequently updated based on user
> activity. My question is would it be more efficient to put the array into
> application scope, or create a new array for each request and user and how big
> of an object is too big to store in application scope?
>
> Thanks...
>

Are these URLs stored in a database? If so, why not just cache the
query and put the query object in the Application scope? "How big is
too big" is completely dependent upon the amount of RAM you have on your
server.

--
Matt Woodward
mpwoodward@gmail.com
Adobe Community Expert - ColdFusion

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 10, 2006 May 10, 2006

Copy link to clipboard

Copied

I would add, consider what you are using the data for. Is it for the particular page the user has loaded? Will it be useful for the entire time the user is on your site? Is it something that one instance of is sufficient to serve all your users simultaneously? These questions can also guide in what scope the data should be placed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 10, 2006 May 10, 2006

Copy link to clipboard

Copied

LATEST
Hi,

The data or URL's will be served to many users continuously. In response to users actions URL's will be removed or added. Those actions have to be in real time so I think that may rule out query caching. Basically, the entire set of URL's have to be available for any number of users. I was thinking that storing the array in the application scope and modifiying /add and delete url's when necessary might be a better alternative than creating a thousand arrays of 50,000 urls for a thousand requests for example. Not sure which is more efficient ? Creating a one array for each request or storing an array with that many rows in the application scope and serving all requests with the single data object? In general what is an acceptable size of an object in application scope? I do use some single threaded service cfc's in application scope, but am not sure if there are any recommended best practices when it comes to data objects. Thanks for the replies...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation