Architectural Consideration for Building Cloud Application

Though it is generally believed that biggest challenge of architecting a cloud application is security and reliability, there is another major dimension which is generally overlooked which is cost optimization. In response to the pool “What is the main risk with cloud computing?” by Tech Republic – 59% identified data security to be the main concern and 20% thought it was reliability. The fact that the applications need to be designed differently to take advantage of cloud and thus reduce cost did not even enter into the consideration.

Traditionally, actual cost of deployment has never directly been considered as a parameter of architectural tradeoffs – performance: yes, response time: yes, application-partitioning: yes, load-balancing: yes, choice-of-platform: yes, choice-of-software: yes, open-vs.-proprietary: yes – but actual-cost-of deployment: no. You are likely to do hardware sizing based on the projected load and arrive at the machine configuration. You may also tune parts of the application post deployment if the response time is not acceptable. But in how many instance will you design your application to bring down the hardware requirement by 10%? What about tuning the application post deployment to reduce hardware requirement by 10% even though the response time is adequate?

Traditionally, your hardware and software is a capital expenditure. So, once the initial investment is made you are unlikely to save any money by optimizing the application to utilize less resource. But when the application is deployed in the cloud it is no longer true. What is driving a CIO to take a serious look as cloud computing is primarily the promise of cost reduction. Pay for what you use implies don’t pay for unutilized resources and if you consume less resource you pay less.

However, in cloud, you pay for:

  • actual CPU utilization
  • actual size of data storage
  • actual data read-write
  • actual input-output bandwidth used

You can always do an architectural tradeoff and increase/reduce the usage of these 4 parameters. How it will impact the overall cost will depend on the cost structure. So your architectural decision will have a direct impact on cost but the optimality of the decision will change as soon as any adjustment is made in the cost structure by the cloud provider.

Pay as you use implies many more options for cost reduction

  • You need to minimize unutilized resources
  • Design and code efficiency becomes critical
  • Cost effective design will depend on the relative cost of processing charge, storage charge, data read-write charge & bandwidth charge
  • Restructuring of cost by cloud provider may affect the optimality of design
  • Whenever there is an IT budget cut, you may be asked to optimize the code
  • Any outside consultant can come and claim that there is opportunity to save money

Lack of availability of data to base the decision on – it has to be found out through experimentation.

Different interpretation of application and machine boundary implies packaging has direct impact on cost

The cloud market place has many players with different strategies but I have not considered SaaS players like Salesforce.com. Though every organization from IBM to Oracle to HP wants to make their presence felt in the cloud – the following are the major players and here a summary of the pricing structure of EC2, Azure & GAE for your quick reference.

Amazon EC2:

  • Pay for the duration a machine has been instantiated
  • Not dependant on what you run on the machine
  • Load variability needs to be managed through instantiation and de-instantiation of one or more machines

Implication: Given a choice of one machine of larger capacity and multiple machines of smaller capacity – later is preferable.

Microsoft Azure:

  • Pay for the duration an application has been instantiated
  • Not dependant on how much the application is used or how complex it is

Implication: Bundling of multiple unrelated applications into one may turn out to be more cost effective.

Google GAE:

  • pay for actual usage of the deployed application
  • not dependant on how long it is deployed
  • CPU usage of individual transaction is aggregated for cost calculation

Implication: Optimization needs to be performed at individual transaction level and not at machine or application level

Experience with one platform cannot be directly translated to another platform.

Availability of storage options other than RDBMS which is expected to be optimized for cloud

  • Though EC2 support RDBMS, they also provide other options
  • Azure only supports a version of MS-SQL
  • GAE only supports persistence of objects
  • EC2 has multiple non RDBMS options
  • In EC2, you can use their instance on MySQL instance or use your own mounted storage

Non-relational databases can be highly efficient in specific application scenario. For example, if you have a complex domain object, it may be advantageous to store it as a single object significantly reducing the number of disk I/O thereby impacting the cost. The challenge, however, is to stop thinking in terms of relational tables and SQL. This requires lot of unlearning.

Many of the traditional design principle may have to be revisited and new ones need to be arrived at.

Advertisements

LinkedIn and Crowd Sourcing

Does crowd sourcing work? Here is a small but cute example which I came across. It is a discussion thread on LinkedIn group on Web 2.0.

Jeanine Willoughby started the thread by posting the question “How do I convince my company to relax a little on content ‘moderation’?” about 15 days back on 18th February, 2010.

The organization she works for supports businesses in the Yorkshire and Humber region in the UK to prosper a low carbon economy. Part of the vision is to establish online communities where any stakeholder in the region (staff, customers, suppliers, buyers, consultants) can discuss and debate issues relating to their interests. People who do wish to participate must register their details and be approved to join the community. Her problem was that all content contributions are moderated before they appear and the system has not helped foster an online community. She was having a difficult time convincing the managers to move to a reactive moderation model as they are too afraid of defamatory remarks.

In 15 days she received suggestions from 18 people:

  1. Dan Mason: provide guidelines – dos & don’ts
  2. Kevin Shea: create a vision of the changed state that works for everyone
  3. Jeff Heine: customers are going to communicate anyway – it is better to know what they are saying and take those as opportunities to correct any issues and/or misunderstandings and build a better relationship
  4. Karin Wills: use IBM’s “Social Media Policy” as a guideline
  5. John Ferrari: reasonable entry barriers to a group and reasonable post-moderation
  6. Jeff Cole: refer to U.S. Air Force’s policy on content- “if you are old enough to die for your country, you are old enough to blog.” (more detail)
  7. Tina Gleisner: refer to examples of top competitors who are building stronger communities by not only allowing, but encouraging more community dialog – remove moderation after an initial period
  8. Jeremy Lundberg: read Groundswell – it has lots of great case studies
  9. Robby White: use profanity filter
  10. Jay Friedman: find a few references where your company is already being talked about online – in areas outside of your control
  11. John Whaling: promote self regulation – even Disney’s Club Penguin (for kids) works this way
  12. Tim Licence: users will not risk harming their own reputation by posting defamatory or libel comments, therefore the forums would be self moderated
  13. Emer Mc Ginley: based on 2 years experience – it’s the cheapest form of customer/employee insight you can get – many of your online contributors WILL become your advocates if you listen and respond with speed
  14. Susan Crawford: separate social media policy for each platform (Twitter, Facebook, YouTube etc.)
  15. Courtney Hunt: monitoring and moderation (post only) are critical responsibilities of community founders and managers
  16. T.S. Elliott: focus on strengthening the understanding of all stakeholders – they will become more relaxed and less moderated (more detail here and here)
  17. Bruce Galinsky: develop some common sense social computing etiquette
  18. Vincent Berthelot: you have to explain the rules and the role of the community manager and it will be OK in 99%

Yesterday, she successfully presented the case to management. This is what she wrote:

“To everyone who contributed to this discussion and provided insight and guidance into my query – thank you all. 

I presented the case for a more relaxed approach to moderation to our community managers about an hour ago and I’m pleased to share with you that my colleagues agreed to adopt a self-regulating approach to moderation, i.e. give the community users the responsibility and ownership of content. 
We’ll back this up with robust guidelines, code of conduct for users and also adopt an internal protocol for community managers to ‘keep their eye’ on things. 

Once again, thanks to all. Without wanting to sound like Kate Winslet at an awards ceremony, your advice and support really have on this occasion made the difference. 

Best regards, Jeanine”

 

Why I switched to Chrome

This January, Chrome crossed 5% market share mark. Neither Safari nor Opera could ever manage it. What is even more interesting is that in February the market share of all other major browsers slipped and in last one year, Chrome has picked up 4% market share! (If you want detailed stats on browser market share, you do not have to look any further than Wikipedia.)

Couple of month back I received an email from Deepesh stating “You guys need to install this….Its’ way way faster“. The “It” referred to Chrome 4.0. Since not all sites open properly on non-IE browser, I am very reluctant to switch to anything else. So, all these years, I have lived with my IE. Though I had tried Firefox but did not find it attractive enough to go through the complication of using 2 browsers. On an impulse I tried Chrome and never looked back. Here is why:

  • The viewing canvas is larger
  • I do not need Google toolbar
  • Single search box – for URL as well as for search – is elegant
  • Built in spell checker is very convenient – as I am very bad at spelling
  • All the input text area are automatically resizable – very convenient for quick blog post and blog comments
  • I like the way download is handled
  • The history is searchable

And, yes it is FAST (here is a comparison) and overall – I find it clean, elegant and simple.

However, this is not the whole story. If you look at the bigger cloud computing picture – it will be obvious that Chrome is very central to Google strategy. So, you can hope to see much tighter integration between many of Google cloud offering and Chrome. I won’t be surprised if Google Apps work significantly better with Chrome than any other browser.

Then there is also HTML 5 and its game changing potential. It is in Google’s interest to have more powerful browser with more functionality. IE has steadily been losing market share for last 6 years – about 5% per year. Till 2 quarters back Firefox had been picking up 80% of that share. Now it appears that the trend has shifted towards Chrome adoption.

I think this growth will continue and we can hope to see Chrome cornering close to 10% by the end of this year.

Will iPad Succeed

Will iPad succeed? We will know the answer to this question in few months time but I would like to put my neck out and apply one of my theories about why such devices succeed example – iPhone, iPod, Blackberry, Palm, Walkman etc.

For any new device to become very popular – it needs to satisfy at least one and possibly both the following criteria (elegant design is not one of them):

  • Does it have a new and very responsive user interaction mechanism suitable for the form factor on the device?
  • Does it allow user to perform one important task very effectively which was not easy to do with any of existing devices?

Here is list of successful devices:

Now let us evaluate iPad on these dimensions:

Does it have a new and very responsive user interaction mechanism suitable for the given form factor on the device?

  • Yes, it will have the same responsive figure touch as iPhone & iTouch
  • Yes, even after 3 years, no other device has been able to replicate the same experience (see an interesting discussion)
  • No, it is not new – it is 3 years old
  • No, finger touch zooming and panning is not as critical for a device with larger screen
  • No, it does not have any innovative user interface mechanism – nothing new in handwriting recognition – nothing new in voice input

Does it allow user to perform one important task very which was not easy to do with any of existing devices

  • No, nothing comes to mind immediately
  • May be, as an eBook reader – if users find reading in color vastly superior – better experience than current eBook readers like Amazon Kindle (see 2 comparisons – here and here)
  • May be, as an internet surfing device on the move – much larger screen than Smart Phone – faster booting than Netbook
  • May be, as a device to access applications in the cloud – can work in conjunction with Google Apps – bypassing Microsoft Office
  • May be, as gaming device – but will the size, the interface, the processing power be right for gaming
  • May be, for watching video – but connectivity may be an issue – no USB or DVD – no Flash
  • May be, in the hospital as many CIO’s have suggested – but it will be a niche not mass market (see CIOs say iPad and other slates have a place in business)
  • May be, in other specific enterprise situation like for airlines crew – but lack of multitasking can be a limiting factor

I searched Google with iPad will succeed (1,320,000 results) and iPad will fail (2,240,000 results) – wisdom of the crowd?