2 posts tagged “stateless architecture”
We advocate stateless architecture as an architecture for its numerous benefits. When combined with cloud computing from Amazon and failover/load balancing features built into the client it offers a very efficient way to handle sporadic heavy loads. Take cricket sites such as cricinfo, cricketnext or stock information sites such as moneycontrol which experience heavy loads during certain times on certain days. In all these cases a server has to push information constantly to the client.
Amazon gives the ability to start additional server instances on the fly. These can be started / shutdown as the load increases. Essentially an an infinite data center at a cost of Rs4 per hour per server for a 2Gig, 2CPU instance. As clients don't have affinity to the server any server can service any client. Who will handle the load balancing? Normally it is a reverse proxy sitting at the server end, sort of a gatekeeper. This can get overwhelmed if a million connections come in. We propose to do load balancing on the client. A client is given a bunch of server urls to connect to on its first request. Client tries out alternate servers till it finds an available server. A server can decide to service a request based on its load.
There is one more aspect in this scenario. A browser client has to make requests to the server to get up-to-date information. This creates a significant overhead in connection management on the server. Persistent connections can be used to solve this issue - details in a later post.
Is Flex yet another MVC framework like Struts and 100 other java based frameworks? One such framework thinks so and has built complete set of support for actions and controllers for Flex - Gausax at http://www.guasax.com. Force fitting RIA frameworks especially Flex into an MVC misses the whole point and reduces it to UI eye candy.
Ajax world is slowly but steadily picking up in rich controls and effects so it is fast closing the gap with Flash on rich animations. Flex on it's side is solving the problems of a 300K initial download, browser friendly features like forward & back buttons, boomarks so it can compete with Ajax better.
Flex is really good at alleviating server load and thus provides better scalability and failover than a regular MVC framework. In theory most web frameworks support building stateless applications (like Google) but that is not the norm. The server continues to drive the client thus limiting its own scalability. Flex provides a way to push the entire responsibility of UI to the browser so the server becomes a service processing business transactions. It takes no part in the UI handling thus removing the need for an http session. That removes the browser to server affinity and makes servers a lot more scalable. Give a bunch of failover/clustered server urls to the client and client can take care of failover as well load balancing without a single point of failure on the server.
To summarize Flex when used in a stateless architecture will realize good gains on the server not to mention eyecandy for the user.