DIGG IT!
Published
Tuesday, May 24, 2005
at
12:15 PM
.
There are many ways to scale a Flex server but there is only one technique that is foolproof, scalable, and will not crash under load.&
Answer: Deploy Flex apps as static SWF files. :)
I am a big fan of MXML as a compiler technology but I have yet to embraced the big enterprise server model. In all my Flex apps, all my Web Service and Remoting calls use useProxy="false". I do not use the server services at all and actually avoid using them to allow for scalability. I am a fan of Flex but aspects of the model need improvement and are certainly not designed with me in mind, I am no Enterprise, yet. There are cases where the services add tremendous value to Flex but I do not fall within this realm, yet some of my clients do.
**NOTE - Flex licensing issues need to be discussed with Macromedia directly. I cannot answer these questions and frankly I do not want to. Also remember that uses of Flex are different and there are various licenses for OEM, ISV, and corporate use. This is a minefield that I do not want to enter.
Talk to Macromedia.**
This is how I scale and deploy Flex:
1. Use one server CPU for development/staging (Flex Server Installed).
2. Use one server CPU for deployment (Flex Server NOT Installed).
3. Use one server CPU for my laptop. :)
I have a build script in Python that loads the following URL:
http://{devserver}/{flexpath}/{mxmldocument}.mxml.swf
This returns a SWF file from the MXML compiler. This file is then tested locally and deployed to production. On the production server, I have custom HTML/JS that supports custom Object/Embed tags providing History management and player detection.
Flex is an excellent development model but I am not convinced that the server services are for everyone. Although, that said, I will probably find some amazingly cool feature that requires the services and take back what I have said here. Until that time it is pure Flex SWF for me.
Cheers,
Ted :)
You've always been a pure SWF man, Ted -- that's what I admire about you! ;)
Aral
Ted, would you consider writing a tutorial on your exact process moving from flex dev to production? That would be so helpful to the rest of us who are trying to wade through this new water.
Also, how much custom component development would you say you do on a given project? I'm trying to get a handle on how powerful the included components are.
Jon
Jon,
I will do a post about the production process and include my Python production build script too. It just freezes MXML logic into static HTML and SWF. Then you don't need the server present.
Flex is great for composition, you can easily create a new component that is a mix of several existing controls with a cooked in style. These become your own custom MXML tag to make it easy to reuse and process attributes or inner tags. Although you can simply author a new SWC or AS Class and have a new component quickly. There is only one way to make a component in Flash but there are at least 4 ways in Flex.
Cheers,
Ted :)
See http://www.darronschall.com/weblog/archives/000165.cfm for my ant build.xml file that does pretty much the same thing, except doesn't require the Flex server to be running at all.