Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #61  
Old 08-17-2005, 11:27 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
How does the Datastore Class (on subsequent Pageloads) know that there are no Entries that need to be cached, and thus does not execute the Query?
How does it know which entries need to be made available as $vbulletin->name?
Looking at the code, there is no precaching features in the other data methods. (The query i posted above predicts what is needed via the new table, and the datasore item does not need to be added to $specialtemplates because of the conditions).

It will indeed make another call to the other datastore storage, but as i understand it (and i could be wrong), for memcached it will query the storage each time it needs an item regardless of if it is stored in the proper storage method and if it isnt, it will query the datastore table and add it to cache.

For file based, as far as i understand, the entire datastore is loaded into memory. I could be very wrong in this assumption and there may need to be file changes to both datastore classes to make it work properly. It may turn out that for other datastore methods (if we go with the table solution) there needs to be an additional query to the NEWTABLE table.

Im not 100% sure that it will work for them, because I dont really know the mechanics. Ill look into it furthur if I have time today.
  #62  
Old 08-17-2005, 11:35 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, all Data (that was once put and TTL isn't over) will be in memory.
But it won't be available to vBulletin Code, as the Class doesn't recognize the Items if they are not default Items or in $specialtemplates.

So, without knowing how they are stored exactly - how should (Plugin) Code get access?
  #63  
Old 08-17-2005, 11:39 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now i see what you're asking!

-- automerge sux!!! --


Looking through the code, init.php simply calls
PHP Code:
$vbulletin->datastore->fetch($specialtemplates); 
The fetch() function of the 3 different datastore classes:
  • DB: The fetch function builds a comma delimited list of titles to fetch from the database - the query modification I posted will deal with additional datastore retrieval needs, they will all be automatically registered, but not unserialized.
  • MEMCACHED: Memcached stores all datastore items in its storage method once it has seen that item at least once - First time it gets seen, it has to be queried, I believe this is fair. $specialtemplates dictates what is automatically registered and unserialized. There should be no extra noticable overhead to call the fetch method for this class type. It will check memcached's store to see if it exists, and if it doesnt query the db, put it in memcached, and register it. An extra function call is necessary for this class type with the current code.
  • FILE: It appears that only certain items determined by the $cachableitems array inside this class are able to be stored efficiently for this method. Any datastore items not mentioned in this array are pulled from the database regardless of it they exist in the datastore_cache.php file. This method seems to be a hybrid of the DB and complete filesystem based methods. Maybe this is an oversight, or by design. Changes need to be made to fetch() to allow function calls in products to fetch datastore items that are actually stored in the filesystem, instead of querying the database.
There is also a stress point using fetch, because this function is not necessary and will cause an extra query when using the default datastore method. Maybe another function is necessary to determin if we really need to call fetch() (user using default method? its already registered!!)

One small almost irrelevant point, it would be nice to be able to specify if the datastore item should be unserialized. In my opinion the best way to deal with that would be to have another parameter for fetch() or register() that the caller tells the function to unserialize, instead of relying on an internal $unserialize array.

Hope I made sense

I should also note that I do not write this as an intention to hack vBulletin - Im discussing this as an addition to vBulletin. Maybe not the best forum for it, but Im sure the devs are looking at this thread.
  #64  
Old 08-18-2005, 05:46 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

By the time we started this thread RC1 was not yet (or just the day before) released. Jelsoft Dev's have been watching this thread before, and we had the slight hope (very long shot) that something could be done into the production release. But i think Jelsoft is way to far into the release process, to make a change to the system like at now.

In my opinion, worsed case scenario would be a standard solution that all coders could use, so files would only have to be edited once to implement custom datastore items.

Edit: You are encouraged to post a proof of concept here so it will be easier to discuss.
  #65  
Old 08-18-2005, 08:44 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Im sorry, I dont have the time to work on a proof of concept test base for code.

I do not believe that the idea needs to be tested, as whatever solution is presented will appear in vBulletin in a form that the developers believe is the most efficient and secure eventually.

I dont understand your statement "Based on what condition you want to remove this?" and where it fits with what im saying?
  #66  
Old 08-18-2005, 11:42 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by merk
I dont understand your statement "Based on what condition you want to remove this?" and where it fits with what im saying?
Looks like that was somehow copied from a reply to another thread. Don't know how that happened. Removed that part.
  #67  
Old 08-18-2005, 12:18 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What I have been doing for my forums and my private hacks is call the extra datastore items from fetch() and not worry about the extra query at this time.

In my opinion people are too query-mad. 1 or 2 extra very light weight queries are no fuss in the shortterm for most boards.

Once a solution appears, the queries go away.

--

On that note, i dont believe there necessarily needs to be any kind of single method of doing it if this functionality is eventually going to get added to vBulletin - the way we do it wont match the way they do it, so why have hacks that create incompatibilities like that?

Maybe we could at least get an official word on their stance, then we would at least know what our position is.
  #68  
Old 08-18-2005, 03:58 PM
bigcurt's Avatar
bigcurt bigcurt is offline
 
Join Date: Nov 2004
Location: KierDarby.php
Posts: 1,009
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am sure they havent decided yet..cause it sure is taking much longer than before to come out with RC3 or Gold.

~Curt
  #69  
Old 08-19-2005, 12:55 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bigcurt
I am sure they havent decided yet..cause it sure is taking much longer than before to come out with RC3 or Gold.



~Curt
To be perfectly honest, I believe they already know what they are going to do. A company like this doesnt just make decisions as things happen, they make them as problems become known.

An official word on where datastore caching for products is at will help this discussion of the need to set a standard way to do it until such time as they do their thing.

If it wont be added until 3.5.0+1 then there is every chance hackers will want to agree on a standard way to do things as Marco suggests. If it will be available before 3.5.0 becomes gold, I see no issue with waiting for the feature to be added instead of working our own solution out.
  #70  
Old 08-21-2005, 11:38 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been thinking about a way around the problem in the meantime until Jelsoft do something to solve it, but how about using a plugin to store the extra "datastore" items a product needs to add?

Add a global_start plugin holding the array or variables you need.

Let your product update that global_start plugin and rebuild the plugin datastore items.

Could very well be an acceptable solution in the meantime?
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:50 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04100 seconds
  • Memory Usage 2,268KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete