I think I brought this up once before a while back in '09 (http:// groups.google.com/group/model-glue/browse_thread/thread/ 321a795ed77ad721/e3cf316e99d83118?lnk=gst&q=gladnicj#e3cf316e99d83118) but i thought i'd table it again to see if any new ideas had come up.
THE PROBLEM: You have multiple domains running the EXACT same code base, same exact views, etc. The only thing different is the data on each site. MY CURRENT ARCHITECTURE: In the init() function of the controller, load each CFC in the model and save it to the variables scope. Instantiate each CFC by passing in the unique siteID for the current domain you are on to the init() function in the CFC. Store THAT in the variables scope for that CFC. I believe this is essentially storing a copy of the entire application in the memory for EACH domain. Every single query in the entire app has a filter in it that says "AND siteID = variables.siteID", which keeps thins nice and silo'd for each site. It works fine, but his approach seems like it would best on a low number of sites that had high traffic. Unfortunately, my application instead is a large number of domains with relatively low traffic to each (average of 100-200 visits/month). I do not think this is memory efficient. ALTERNATIVE ARCHITECTURE #1 Don't save any CFC's to the variables scope, instead use createobject() to create them on the fly as needed. Seems wasteful. ALTERNATIVE ARCHITECTURE #2A Save the CFCs to the server scope and pass in the unique siteID on every function call, instead of on instantiation. Bit of a PITA to pass in the unique siteID for EVERY function call in the application. This would save the common code base and all the functions ONCE to memory so it could be accessed by all the sites, which seems very memory efficient. ALTERNATIVE ARCHITECTURE #2B Save the CFCs to the server scope, but save the unique sideID to the application scope. Then save the unique siteID for the domain you are on into the application scope, and in each CFC reference the unique siteID from the application scope. This seems like a winner because we're only saving the CFCs once to memory, very efficient, and we're not having to do PITA things like pass the unique siteID into every freaking function. Any other ideas? -- Model-Glue Sites: Home Page: http://www.model-glue.com Documentation: http://docs.model-glue.com Bug Tracker: http://bugs.model-glue.com Blog: http://www.model-glue.com/blog You received this message because you are subscribed to the Google Groups "model-glue" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/model-glue?hl=en
