As I had previously mentioned, yesterday I attended the ArcReady event titled: Architecting for Scalable and Usable Web Applications. Here is my summary notes, and brief opinion in a format as condensed as I could possibly make it and still do it justice to include all the goodies.
The morning was split in 2 sessions, the fist of which was presented by Larry Clarkin and the second by Technology Evangelist John Weise.
Session 1 - Architecting for Scalable Web Applications: Overall outstanding for many reasons but more importantly because it did not carry a [heavy] Microsoft Agenda. It was participative, well focused, well presented and what I would consider appropriately "architectural" in content. With a few practical tips, approaches and case studies presented it had enough of a take-away to raise it above a purely academic level typical of most presentations.
Premise: Scalability <> Performance. Strive for stable Cost Per Transaction. Don't expect Economies of Scale to apply to scalable web applications.
Doing some follow up research I came across this very interesting and relevant white paper by Kanwardeep Singh Ahluwaliaon Scalability Design Patters (PDF Download).
The Patterns for Scalability presented were:
- Be aware of the environment both physical (infrastructure/backbone), as well as configuration related: Look at configuration settings to make sure Debug is turned off (yeah, it happens). Use the deployment element retail="true" setting.
- Scale UP Hardware: Look at upgrading RAM, Disk I/O and even CPU.
- Scale UP Software: The concept of scaling up applies to Software as well. Consider upgrading to IIS7 on Windows Server 2008. Look to eliminate single points of failure by implementing solutions like Active/Passive and Failover Support. Look at configuration settings to make sure Debug is turned off (yeah, it happens). Use the deployment element retail="true" setting. Manage your sessions! Consider turn them off for the application and on as needed per page. Evaluate your needs for InProc vs. Database sessions. Set them accordingly.
- Scale Out: Solutions include DNS round robin, Microsoft's Network Load Balancing, Microsoft's ISA and hardware load balancing solutions by vendors like Cisco. As with anything else the right solution will depend on your needs, environment, budget etc. Pay special attention when using load balancing solutions and SSL, remember to set affinity.
- Specialize: Use a node/server/group per role/responsibility: Web (UI), Application (Web Services, etc), Resources. This last one was a good eye opener. Static in nature, resources make up most of the payload in a typical request. A good case for implementing IIS7 configured with just the modules required for static content. This would yield a significant performance gain. You will also gain from "decoupling" the hosting implementation and can make adjustments where needed without affecting the rest of the solution. Consider using 3rd party services to offload static content.
- Split the Application: Consider using subdomains if you can logically and functionally split your application.
- Split the DB: From a "logical" unit(?) point of view. First approach under this pattern tells us to consider using a separate database for Reference & Transaction data. A quick downside effect of this approach is that we violate many-a-rule of normalization and risk breaking our otherwise good relationship with our DBAs because of that! <grin>. A second approach under this bullet points us to a solution that calls for Read & Write versions of the data. One write, many (as needed) write versions. Use appropriate synchronization/replication between them.
- Database Sharding: I knew of this approach referenced by the term Partitioning rather than Sharding, but the concept is to split your DATA across databases based on a given criteria inherently part of the data, like users with last names from A-D on one database, E-H in another one and so on... or split it by department or like apparent MySpace does it, one database by X amount of users which in their case appears to be 1,000,000. To overcome the challenges inherently part of trying to manage data spread according to this approach, you can leverage technology like Distributed Partitioned Views available in SQL Server.
- GEO distribution: With more specialized uses and needs, typically used to increase availability by proximity and to provide some redundancy and failover. Requires you to have or leverage Hardware and infrastructure knowledge skill and expertise.
- Offload the Work: Examples include services like Flickr picture hosting (applicable only to personal use), and Silverlight Streaming services.
Anti-Patterns:
- Spending all your time looking at your code (as your bottleneck)
- Caching everything <-- Do cache, but do so judiciously. Caching chews up resources which hurts scalability.
- Services calling Services.
I truly enjoyed the presentation, the format, the tone and the content. It wasn't better only because sadly it was cut short. The last 20% of the content was pretty much delivered in 20 minutes which was a pity because the conversation was flowing and the attendees were engaged.
Session 2 - Architecting for Usable Web Applications: John Weise breezed through some slides with too much of the content being "more of the same". There were some interesting points brought up and the Demos where simple and short "show and tell" for a couple on "cute" applications. Nothing breathtaking or groundbreaking there. He talked about (showed) the UI Archetypes and went into some detail over the UX Continuum as part of which Larry stepped in to talk about and show the UX IQ application. This cool little application is provided as a tool to provide guidance on application platform selection.
Best Practices:
- Form Follows Function
- Create a set of design tenets
- Use the appropriate level of fidelity
- Build with the customer and user's input <-- From agile?
- Build for ease of use, but don't forget the Power User.
- Plan for concurrency
- Balance security with usability
- Build for supportability and maintenance
- Be aware of standards <-- Compliance
Anti-Patterns:
- Golden Hammer
- Breaking UI conventions
- Overuse of animations
My personal opinion and take-away out of this second session, was not as positive as for the first part, but I still got some good pointers, and overall the time spent was well worth it.
Three good demos worth mentioning:
- ProtoXAML : Prototyping UI, with napkin skin... awesome!
- UX IQ <-- Couldn't find source at fist pass, will look further and update when and if I do.
- Woodgrove Financial WPF application. Source code here.
As part of the now common and to a certain degree expected give-away, books and copy of Office 2007 Ultimate where handed out.
Two of those books are available online and as PDFs for free: