How To Build Highly Scalable Web Applications For The Cloud

Scalability in the cloud depends a lot on application design.  Keep these important points in mind when you are designing your web application and you will scale much more naturally and easily in the cloud.

** Original article — Intro to EC2 Cloud Deployments **

1. Think twice before sharding

  • It increases your infrastructure and application complexity
  • it reduces availability – more servers mean more outages
  • have to worry about globally unique primary keys

2. Bake read/write database access into the application

  • allows you to check for stale data, fallback to write master
  • creates higher availability for read-only data
  • gracefully degrade to read-only website functionality if master goes down
  • horizontal scalability melds nicely with cloud infrastructure and IAAS

3. Save application state in the database

  • avoid in-memory locking structures that won’t scale with multiple web application servers
  • consider a database field for managing application locks
  • consider stored procedures for isolating and insulating developers from db particulars
  • a last updated timestamp field can be your friend

4. Consider Dynamic or Auto-scaling

  • great feature of cloud, spinup new servers to handle load on-demand
  • lean towards being proactive rather than reactive and measure growth and trends
  • watch the procurement process closely lest it come back to bite you

5. Setup Monitoring and Metrics

  • see trends over time
  • spot application trouble and bottlenecks
  • determine if your tuning efforts are paying off
  • review a traffic spike after the fact

The cloud is not a silver bullet that can automatically scale any web application.  Software design is still a crucial factor.  Baking in these features with the right flexibility and foresight, and you’ll manage your websites growth patterns with ease.

Have questions or need help with scalability?  Call us:  +1-212-533-6828

Metrics Bridge Gap Between IT & Business Units

On the business side we’ve all seen requests for hardware purchases that seem astronomical, or somehow out of proportion to the project at hand.  And on the IT side we’ve been faced with the challenge of selling capital expenditures on technology, as demands grow.

Collecting statistics on real usage of server systems, and then connecting the dots to business metrics is an excellent way to bridge the gap.  This allows IT to draw concrete connection between technology investment, and reaching business goals.

Metrics and drawing the dotted line in this way also educates folks on both sides of the tracks.  It educates technologists on exactly how technology purchases can be justified, by their direct return to the business.  And it educates finance and business executives on how those hardware purchases directly contribute to business growth.

Review: Cloud Application Architectures

George Reese’s book doesn’t have the catchiest title, but the book is superb.  One thing to keep in mind, it is not a nuts and bolts or howto type of book.  Although there is a quick intro to EC2 APIs etc, you’re better off looking at the AWS docs, or Jeff Barr’s book on the subject.  Reese’s book is really all about answering difficult questions involving cloud deployments. Continue reading Review: Cloud Application Architectures

iHeavy Insights 75 – Recognizing Quality

Finding good vendors who provide professional services may have a lot in common with finding good restaurants.  There may be an abundance of them, while the best ones remain difficult to find.

A long line does not mean quality food

Some restaurants have a long line because they have slow service.  If that’s because you’re getting quality personalized service, great.  But if it’s because of incompetence and general disorganization or because they can’t keep quality help, that’s another story.

Hype and marketing can bring a lot of customers to a new restaurant.  Sometimes it’s a celebrity chef or architect.  If that’s what you’re after then you may be at the right place.  If you’re looking for the best home cooked meal, you may have to keep looking.

Convenience and location can also bring long lines.  Finding a restaurant on the main street or square is usually not the one with the best food.

A better way to find quality

Take a look at how long the restaurant has been around.  A service provider who has been in business for a long time has obviously been successful at acquiring customers, solving their problems, and charging a fee that matches both their needs and those of their customers.

Check the testimonials of your provider.  If their website doesn’t list some, ask for one or two customers that they’ve worked with recently.

Pay attention to service.  If you are a small fish for your vendor, it’s likely that service will be affected.  If you on the other hand are one of your vendors bigger clients, they’ll likely give much more attention to you.  Notice how regular customers at a restaurant or lounge tend to get the best service.

Book Review:  The Power of Pull by Hagel, Brown & Davison

A lot of really influential people like this book.  Joichi Ito, Richard Florida and Eric Schmidt to name a few.  Enterprises are faced with a bewildering array of challenges from finding good people, to retaining them, and putting them to work in the most creative ways.  This book brings another new and welcome perspective on the future of building and growing successful organizations.

Review: Host Your Web Site In The Cloud, Amazon Web Services Made Easy

Jeff Barr’s book on AWS is a very readable howto and a quick way to get started with EC2, S3, CloudFront, CloudWatch and SimpleDB.  It is short on theory, but long on all the details of really getting your hands dirty.  Learn how to:

  • get started using the APIs to spinup servers
  • create a load balancer
  • add and remove application servers
  • build custom AMIs
  • create EBS volumes, attach them to your instances & format them
  • snapshot EBS volumes
  • use RAID with EBS
  • setup CloudWatch to monitor your instances
  • setup triggers with CloudWatch to enable AutoScaling

I would have liked to see examples in Chef rather than PHP, but hey you can’t have everything!

Review: Host Your Web Site In The Cloud by Jeff Barr

Introduction to EC2 Cloud Deployments

Cloud Computing holds a lot of promise, but there are also a lot of speed bumps in the road along the way.

In this six part series we’re going to cover a lot of ground.  We don’t intend this series to be an overly technical nuts and bolts howto.  Rather we will discuss high level issues and answer questions that come up for CTOs, business managers, and startup CEOs.

Some of the tantalizing issues we’ll address include:

  • How do I make sure my application is built for the cloud with scalability baked into the architecture?
  • I know disk performance is crucial for my database tier.  How do I get the best disk performance with Amazon Web Services & EC2?
  • How do I keep my AWS passwords, keys & certificates secure?
  • Should I be doing offsite backups as well, or are snapshots enough?
  • Cloud providers such as Amazon seem to have poor SLAs (service level agreements).  How do I mitigate this using availability zones & regions?
  • Cloud hosting environments like Amazons provide no perimeter security.  How do I use security groups to ensure my setup is robust and bulletproof?
  • Cloud deployments change the entire procurement process, handing a lot of control over to the web operations team.  How do I ensure that finance and ops are working together, and a ceiling budget is set and implemented?
  • Reliability of Amazon EC2 servers is much lower than traditional hosted servers.  Failure is inevitable.  How do we use this fact to our advantage, forcing discipline in the deployment and disaster recovery processes?  How do I make sure my processes are scripted & firedrill tested?
  • Snapshot backups and other data stored in S3 are somewhat less secure than I’d like.  Should I use encryption to protect this data?  When and where should I use encrypted filesystems to protect my more sensitive data?
  • How can I best use availability zones and regions to geographically disperse my data and increase availability?

As we publish each of the individual articles in this series we’ll link them to the titles below.  So check back soon!

  • Building Highly Scalable Web Applications for the Cloud
  • Managing Security in Amazon Web Services
  • MySQL Databases in the Cloud – Best Practices
  • Backup and Recovery in the Cloud – A Checklist
  • Cloud Deployments – Disciplined Infrastructure
  • Cloud Computing Use Cases