Hello,

     I'd like to get the community's opinion about a design pattern. I have 
about 35 tables at the moment. I'm not happy with the performance, yet. I 
plan to use memcache extensively. Right now, here's how things are set up:

1. Controllers create a "variables" dict to pass to views. 

Ex: stages.py (the controller)

2. The functions to populate the "variables" dict are in modules. 

Ex: stage_list(variables)

3. The stage_list(variables) function imports a "cache_get_stage_list" 
function (from a different module) that checks the memcache and either gets 
a cached list or asks the db for one.

My question is: since I plan to cache everything, would it be ok / good / 
bad performance wise to only import the database models inside the 
"cache_get_*" functions ? If I decide to do it this way, the "cache_get_*" 
types of functions would be the only places where the db is queried, so 
it's only there that the models are needed, and even then, only if the 
cache is missing.

P.S. I'm only talking about the "read" part in the CRUD model.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to