<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">This is a great question.<div class=""><br class=""></div><div class="">And the answer I have depends a bit on what you want to optimize.</div><div class=""><br class=""></div><div class="">Let’s assume you want to optimize load and scale the app (I’ve answered about Seaside and scale&nbsp;<a href="http://stackoverflow.com/questions/1451989/does-seaside-scale/4717214#4717214" class="">here</a>[1]).</div><div class=""><br class=""></div><div class="">Regardless of the “vendor’s" VM, when is about load, you need to think way beyond the load capacity of one image (horizontal scaling). And that influences your app design a bit.&nbsp;</div><div class=""><br class=""></div><div class="">RESTful architectures tend to profit from this.</div><div class=""><br class=""></div><div class="">There is a benefit on load and parallelisation in doing things more state-less and perhaps preserving state only in some backend like a database or some cache system like Redis or memcached. It even makes you more fault tolerant since you might have not 1 database server or 1 cache server but clusters of them.</div><div class=""><br class=""></div><div class="">I always remember Werner Vogels saying that they learnt this lesson the hard way and that you should design things in a way that when it crashes, a quick respawn would make issues to not-disrupt the user. If you kept state in your image and it crashes (and it will) then, if that state was only in the image then is gone and your user will be disrupted. That’s why I keep as less state as I could (mostly UI/session related).</div><div class=""><br class=""></div><div class="">[1]&nbsp;<a href="http://stackoverflow.com/questions/1451989/does-seaside-scale/4717214#4717214" class="">http://stackoverflow.com/questions/1451989/does-seaside-scale/4717214#4717214</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 20, 2015, at 4:20 AM, Craig &lt;<a href="mailto:craig@hivemind.net" class="">craig@hivemind.net</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">Hi All,<br class=""><br class="">A pretty-much universal pattern of coding of Web Apps in non-image based<br class="">languages (C#, PHP, Java) is:<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* The incoming web request starts a process <br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* some objects are instantiated, usually from a SQL datastore,<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* some interactions occur with these objects<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* optionally, some database modifications are made<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* a response is sent to the web browser<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* all the temporary variables that point to the objects go<br class="">out-of-scope<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* all the objects are garbage collected<br class=""><br class="">I caught myself coding a Seaside app using the same pattern and wondered if<br class="">it's sub-optimal in an image based language.<br class=""><br class="">So, is this an acceptable way to code a Seaside app? &nbsp;Should I rather be<br class="">using long-lived image based objects? Stored in a collection hung off a<br class="">class variable. <br class=""><br class="">Comments would be appreciated.<br class=""><br class="">Craig<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">seaside mailing list<br class=""><a href="mailto:seaside@lists.squeakfoundation.org" class="">seaside@lists.squeakfoundation.org</a><br class="">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br class=""></div></blockquote></div><br class=""></div></body></html>