<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Singing Horse Studio LLP &#187; Scalability</title>
	<atom:link href="http://singinghorsestudio.com/category/scalability/feed/" rel="self" type="application/rss+xml" />
	<link>http://singinghorsestudio.com</link>
	<description>Scalable Software.  Reliably Engineered.</description>
	<lastBuildDate>Thu, 20 Sep 2012 07:20:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Horizontal vs Vertical Scaling</title>
		<link>http://singinghorsestudio.com/horizontal-vs-vertical-scaling/</link>
		<comments>http://singinghorsestudio.com/horizontal-vs-vertical-scaling/#comments</comments>
		<pubDate>Tue, 01 May 2012 20:48:46 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Scalability]]></category>

		<guid isPermaLink="false">http://singinghorsestudio.com/?p=433</guid>
		<description><![CDATA[What are horizontal and vertical scaling? And when do you use them? Vertical scaling is adding oomph to the machine that an application is running on. Perhaps your e-commerce site is getting more traffic as your business grows, and it&#8217;s starting to creak at the seams. A common way to give the application a boost,<a class="moretag" href="http://singinghorsestudio.com/horizontal-vs-vertical-scaling/">... [Continued]</a>]]></description>
			<content:encoded><![CDATA[<p>What are horizontal and vertical scaling? And when do you use them?</p>
<p><strong>Vertical scaling</strong> is adding oomph to the machine that an application is running on. Perhaps your e-commerce site is getting more traffic as your business grows, and it&#8217;s starting to creak at the seams. A common way to give the application a boost, is to add more RAM, more processors, more bandwidth, or more storage to your machine. Maybe you simply move your application to a new, more powerful machine.</p>
<p>Using vertical scaling is great for applications that can only run on a single machine. Perhaps you are using an off the shelf web shop that is fully integrated and can&#8217;t run on more than one machine at a time. Or perhaps the server you are using is underpowered for the latest version of the software you have installed.</p>
<p>Vertical scaling can be a quick and easy way to get your application&#8217;s level of service back up to standard. On the negative side, vertical scaling will only get you so far. Upgrading a single server beyond a certain level can become very expensive. If you already have a quad processor, moving up to eight processors can add cost quickly. And if you already have eight processors, you may start to wonder if there is an easier way. Especially if your disaster recovery strategy is to have a mirror machine at the ready at all times!</p>
<p><strong>Horizontal scaling</strong>, on the other hand, is adding more servers to your application to spread the load. The simplest case of horizontal scaling may be to move your database onto a separate machine from your web server. Now your web server can simply satisfy requests, and your database server can simply crunch data.</p>
<p>If your application can be broken down into more modules, perhaps it has a three tier architecture &#8211; a database layer, a business logic layer and a presentation layer &#8211; then it can be spread across more servers. If your application is running on three machines and you find your database is holding you back, you can add a second machine to your database layer. Your data crunching capacity is virtually doubled. If your presentation layer is the next to slow you down, you can simply add a second machine serving web requests and split the traffic with a load balancer.</p>
<p>Horizontal scaling can only be applied to applications built in layers that can run on separate machines. Horizontal scaling applies really well to on-demand cloud server architectures, such as Amazon&#8217;s EC2 hosting platform. Horizontal scaling can also facilitate redundancy &#8211; having each layer running on multiple servers means that if any single machine fails, your application keeps running.</p>
<p>An application that has been designed from the ground up to be scaled horizontally tends to be really easy to scale down too. If you have a seasonal demand pattern, it is very easy to bring your application layers back down to run on a single server when demand is low. And you can add the servers back when demand is high again. And best of all? A horizontally scalable application tends to run on low end hardware. You tend to add low power servers into your cluster to reduce load, rather than needing powerful (and more expensive) machines to run your application.</p>
<p>So which scaling strategy should you use? Both are useful. There are many applications that can only scale vertically. They can only be run on a single server. You have a clear strategy choice with these applications! But, a well written application should scale horizontally very easily. An application that is designed to scale horizontally can <em>also</em> be scaled vertically. So you still have a choice. You can weigh up the cost of vertically scaling with an extra 4Gb of RAM vs horizontally by adding a new server in your cluster.</p>
<p>At Singing Horse Studio LLP, we always write our web applications with horizontal scaling in mind. It&#8217;s easy to do, it gives you the maximum choice in the future, and it tends to drive flexibility and modularity into your web application. And those things are almost never bad <img src='http://singinghorsestudio.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>If you&#8217;d like to know more about scaling issues in general, why not listen to our <a href="http://podcast.singinghorsestudio.com/scalability-for-managers" target="_none">podcast</a> on the subject? Or better still; <a href="http://singinghorsestudio.com/contact-us/">get in touch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://singinghorsestudio.com/horizontal-vs-vertical-scaling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simon&#8217;s Top Three Picks from the AWS Cloud for Start-Ups &amp; Developers Event</title>
		<link>http://singinghorsestudio.com/simons-top-three-picks-from-the-aws-cloud-for-start-ups-developers-event/</link>
		<comments>http://singinghorsestudio.com/simons-top-three-picks-from-the-aws-cloud-for-start-ups-developers-event/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 16:38:30 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Cloud computing]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[Software Tools]]></category>

		<guid isPermaLink="false">http://singinghorsestudio.com/?p=410</guid>
		<description><![CDATA[I attended the Amazon Web Services Cloud for Start-Ups &#038; Developers Event in London today, there were several really useful talks and a nice run through of some of the newer AWS technologies. Here are my top three picks from the day: #1 EC2 Autoscaling We got some demos of some very solid and practical<a class="moretag" href="http://singinghorsestudio.com/simons-top-three-picks-from-the-aws-cloud-for-start-ups-developers-event/">... [Continued]</a>]]></description>
			<content:encoded><![CDATA[<p>I attended the Amazon Web Services Cloud for Start-Ups &#038; Developers Event in London today, there were several really useful talks and a nice run through of some of the newer AWS technologies. Here are my top three picks from the day:</p>
<p><strong><a href="http://aws.amazon.com/autoscaling/" target="_blank">#1 EC2 Autoscaling</a></strong></p>
<p>We got some demos of some very solid and practical auto scaling tools. Set some maximum and minimum system sizes, add some CloudWatch monitoring and you can easily create policies for when to have extra resources spun up or dropped out of your cluster. Very useful, very practical, and all bounded by hard limits (just in case your app becomes sentient I guess! #skynet).</p>
<p><strong><a href="http://aws.amazon.com/ec2/spot-instances/" target="_blank">#2 EC2 Spot Market</a></strong></p>
<p>Did you know you can bid for time on unused EC2 instances? I didn&#8217;t! Set some instance criteria (small / large, high memory / high cpu, etc), nominate a price you are willing to pay per hour, and when an unused instance is available at that price, AWS will spin it up and run your app. Perfect for apps that chug their way through a queue of jobs. Of course, the instance will spin down as soon as it is required by AWS (for a customer paying full price, for example), so it&#8217;s not the right way to run your database layer. However, spot instances are perfect for batch processing that is not time critical &#8211; like a payroll run, or image stitching. Can&#8217;t wait for the right customer app to come along that could use it &#8211; it sounds like fun, and has the potential to save the right sort of app a lot of the cost of its processing.</p>
<p><strong><a href="http://zeebox.com/" target="_blank">#3 ZeeBox</a></strong></p>
<p>Great talk by Anthony Rose, the CTO of ZeeBox. Not a lot of detail on how they use AWS, but a great app that adds &#8216;second screen&#8217; functionality and interaction to your tv viewing. I really loved the concept.</p>
<p>All in all, the afternoon was well worth attending. We use a lot of Amazon Web Services technology here at SHS and Amazon&#8217;s armoury is constantly expanding. Today was a great way to stay aware of what is coming from the Cloud.</p>
]]></content:encoded>
			<wfw:commentRss>http://singinghorsestudio.com/simons-top-three-picks-from-the-aws-cloud-for-start-ups-developers-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Measure Twice, Cut Once &#8211; How To Take Care Of Your Online Application</title>
		<link>http://singinghorsestudio.com/measure-twice-cut-once-how-to-take-care-of-your-online-application/</link>
		<comments>http://singinghorsestudio.com/measure-twice-cut-once-how-to-take-care-of-your-online-application/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 23:55:35 +0000</pubDate>
		<dc:creator>H</dc:creator>
				<category><![CDATA[Best Practice]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[The Art Of Software]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[ganglia]]></category>
		<category><![CDATA[graphite]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[New Relic]]></category>
		<category><![CDATA[statsd]]></category>

		<guid isPermaLink="false">http://singinghorsestudio.com/?p=378</guid>
		<description><![CDATA[My mother always told me about the carpenter who would measure twice and cut once. It didn&#8217;t make any sense to me as a kid, but I soon understood exactly what she meant the day I built my first set of shelves. Hrm. If only I had listened to her sooner &#8230; It seems that<a class="moretag" href="http://singinghorsestudio.com/measure-twice-cut-once-how-to-take-care-of-your-online-application/">... [Continued]</a>]]></description>
			<content:encoded><![CDATA[<p>My mother always told me about the carpenter who would measure twice and cut once.  It didn&#8217;t make any sense to me as a kid, but I soon understood exactly what she meant the day I built my first set of shelves. </p>
<p>Hrm. If only I had listened to her sooner &#8230; <img src='http://singinghorsestudio.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>It seems that this advice can be applied to software engineering too, as one of the most important aspects of building a scalable online application (or any software architecture for that matter) is the ability to measure what&#8217;s going on.  After all, if you can&#8217;t tell what your application is up to, then how on earth are you going to be able to tune it, or fix it when it goes wrong (or even notice when it&#8217;s broken!), if you&#8217;re not monitoring it?</p>
<p>Makes total sense, eh?</p>
<p>Of course it makes sense!</p>
<p>Which is why we recommend it to all our clients &#8212; monitor what your application is doing, otherwise you won&#8217;t be able to know when you have to put your scalability plan into place. (You do have a scalability plan, don&#8217;t you?!)</p>
<p>So recently we&#8217;ve been investigating different solutions for monitoring hosts and applications that we install for clients. Traditionally we&#8217;ve used plain old Ganglia for host performance characteristics e.g. CPU, RAM, disk, network i/o etc. and Nagios to warn us when certain things aren&#8217;t working how we expect e.g is that host up and running, are there 23 newsletter sign ups happening every hour, does that web page say what we expect, is that database responding to queries etc.</p>
<p>If something isn&#8217;t working how we expect to be working, then we get told about it.  Depending on the  system, the responsible engineer(s) receive an email, SMS text, or ping via their <a href="http://damien.degois.info/android/aNag/">aNag</a> app on their Android device. Sweet.</p>
<p>But we never really get much of an insight into how our software is performing once it goes live; we rarely get to see how our apps perform once they&#8217;re up and running.</p>
<p>Don&#8217;t get me wrong, we have logging throughout development/deployment/production life cycle, we run performance testing and load testing before go live, we collect stats. But nothing that&#8217;s easily harnessed and displayed via a simple dashboard.</p>
<p>We&#8217;ve been looking into different technologies to solve this. From one end of the scale there&#8217;s the roll your own a la <a href="http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/">Etsy</a> and the <a href="https://github.com/etsy/statsd">statsd</a> plus <a href="http://graphite.wikidot.com/">graphite</a> solution, all the way to the SaaS (software as a service) solution from <a href="http://newrelic.com/">New Relic</a>.</p>
<p>Most reporting mechanisms implement some kind of UDP fire and forget network ping which is perfect for the kind of web based applications we all love to develop; hey, it seriously doesn&#8217;t matter if our reporting metric doesn&#8217;t get through, because remember we still have logs on the actual host in case of emergency, but it&#8217;s great to see performance stats being charted on a cool dashboard in (nigh on) real time.</p>
<p>New Relic gives us that in-depth x-ray look into how our apps are performing &#8212; was it that pymongo query affecting throughput, or was it the network causing excessive latency? We can even drill down to the Python method/function layer in our RESTful services if that&#8217;s what it takes.</p>
<p>The statsd approach requires a little more forethought into what we need to do to implement measurement recording, but at the same time it gives us a higher level of flexibility in what we want to measure exactly.</p>
<p>In the meantime, Johnny is working on an internal Erlang product that, as part of its plugin module nature, will be able to measure, report, and take necessary action on significant events that occur within an application or that occur based on the server&#8217;s performance characteristics. I can&#8217;t wait to get this into production!</p>
<p>Either way, measuring performance is the ultimate goal, because without measurements, you can&#8217;t take any informed action, and without informed action, you&#8217;re effectively running your online business in the dark.</p>
<p>And you wouldn&#8217;t want that, in the same way you wouldn&#8217;t want a set of shelves that didn&#8217;t fit.  Now where did I put that tape measure and saw &#8230;?</p>
]]></content:encoded>
			<wfw:commentRss>http://singinghorsestudio.com/measure-twice-cut-once-how-to-take-care-of-your-online-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scalability: What To Do When Disaster Strikes</title>
		<link>http://singinghorsestudio.com/scalability-what-to-do-when-disaster-strikes/</link>
		<comments>http://singinghorsestudio.com/scalability-what-to-do-when-disaster-strikes/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 10:47:30 +0000</pubDate>
		<dc:creator>H</dc:creator>
				<category><![CDATA[Best Practice]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[downtime]]></category>
		<category><![CDATA[scalabilty]]></category>

		<guid isPermaLink="false">http://singinghorsestudio.com/?p=264</guid>
		<description><![CDATA[It&#8217;s happened to the best of us; no matter what scalability plans we put into place, no matter how many horizontally scaled virtual hosts we spin up, no matter how we shard our carefully crafted data, no matter how many greens we show in our automated tests, there&#8217;s always one element that might just catch<a class="moretag" href="http://singinghorsestudio.com/scalability-what-to-do-when-disaster-strikes/">... [Continued]</a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s happened to the best of us; no matter what scalability plans we put into place, no matter how many horizontally scaled virtual hosts we spin up, no matter how we shard our carefully crafted data, no matter how many greens we show in our automated tests, there&#8217;s always one element that might just catch us out.</p>
<p>Human error.</p>
<p>It&#8217;s easy to overlook a misplaced comma in a config file, or heaven forbid coding a quick patch on a live running service. The human error is bound to creep in one day, and so you should be prepared.</p>
<p>And I don&#8217;t mean be prepared <em>just</em> for the human error. The advice I&#8217;m going to give applies just as equally to hardware or software failures. You see, it&#8217;s all about how you communicate with your customers when disaster strikes.</p>
<p>Whilst writing this, I&#8217;m reminded of a recent incident involving a DNS outage at MyDomain.com, an example of how <em>not</em> to handle a disaster. In fact, had they handled the incident better, we would probably still be hosting our DNS with them. I&#8217;ll be taking this as an example, and compare it with how Singing Horse Studio currently handle outages, some of which we&#8217;ve inherited from our time at Linden Lab, the makers of Second Life.</p>
<h2>Don&#8217;t Panic</h2>
<p>The main thing is don&#8217;t panic! No matter how bad it seems to be, taking a breath and stepping back from the problem is the best first step. You won&#8217;t be making it any worse by taking your time, whereas I&#8217;ve witnessed more small errors turn into bigger problems by stupid mistakes made under stress.</p>
<h2>Assign One Person As Point</h2>
<p>If you&#8217;re not a one-man-band then you&#8217;ll have the luxury of appointing a single person as point. It&#8217;s this person&#8217;s job to co-ordinate events, taking the lead in organising who deals with what, and facilitating communication with others.</p>
<p>Here at Singing Horse Studio, the person on point would be responsible for documenting events for the post-mortem (more on that later), and communicating with customers directly, but for organisations that have their own dedicated customer services department, point will simply communicate events to the customer service representatives for them to inform the customers.</p>
<p>The advantage of assigning someone as point means that you can allow the engineers to fix the problem without giving them any additional pressure and stress of &#8220;get it fixed now!&#8221;; they can focus on what they need to do whilst one person can handle the co-ordintation. This gives them the freedom, instead, to regularly inform management, customer services, affected departments etc on the progress of the fix. Which leads to &#8230;</p>
<h2>Keep Your Customers Informed. Regularly.</h2>
<p>If there&#8217;s anything more frustrating for a customer or manager, it&#8217;s the lack of information. Put yourself in the customer&#8217;s shoes:</p>
<div class="testimonial mb20"><em>Hey, if you&#8217;ve broken something, and my business relies on it working, then I want to know when it&#8217;s going to be fixed</em></div>
<p>Damn right. And being kept in the dark about progress (or lack thereof) is going to make your customer worry even more than necessary.  Even communication saying &#8220;we&#8217;re still looking into it&#8221; is better than silence.</p>
<p>With the MyDomain DNS outage, we first became aware because of our own internal <a href="http://www.nagios.org/" title="Nagios" target="_blank">Nagios</a> checks.  A disappearing host isn&#8217;t a good sign, and it was quickly diagnosed as a DNS failure.  I first checked to see if MyDomain had a maintenance window or a service status page, but unfortunately it just pointed to their knowledge base.  Not a good sign.</p>
<p>So what&#8217;s the best way of keeping up with news as it happens? Twitter of course! And checking their Twitter stream showed that they did indeed have problems.</p>
<p>Now, at least they did something right by monitoring their Twitter messages and responding to them, but there was never a series of planned communication to the customers.  Instead, the only communication they exposed was a reply to any question about their service being down with &#8220;I&#8217;m sorry, yes we&#8217;re working on it&#8221;.  No explanation as to what the problem might be, no estimation time for a fix, no setting of expectations of future updates.</p>
<p>When customers are given content such as <em>&#8220;At 7:57 UTC the main East Coast server suffered an, as yet, undiagnosed problem, causing software connectivity issues.  Engineers are currently diagnosing the problem.  An update will be provided within 30 minutes&#8221;</em> they know what to expect; there&#8217;s a serious problem, it&#8217;s being looked at, and I&#8217;ll find out more in half-an-hour. Cool.</p>
<p>Tell your customers what&#8217;s going on, even if it&#8217;s your own fault.  Saying &#8220;we messed up, but we&#8217;re fixing it&#8221; is going to give you respect, and you&#8217;ll be surprised at how easily customers will forgive you if you&#8217;re open and honest, and taking responsibility.</p>
<h2>Learn From The Experience With A Five-Whys Analysis</h2>
<p>As part of our Agile process, we&#8217;re always looking at ways to improve what we do, whether that&#8217;s looking at our coding practice, our project management style, or even how we make sure faults don&#8217;t re-occur.  I guess that&#8217;s why we love test driven development because writing a failing test before fixing a bug should mean you&#8217;ll never have to worry about that bug showing its face in a later regression test.</p>
<p>One excellent method for gradually improving a process or methodology is something that we&#8217;ve learned from <a href="http://www.startuplessonslearned.com/2008/10/about-author.html" title="Eric Ries" target="_blank">Eric Ries</a> and IMVU (oddly enough, a competitor of Linden Lab), called <a href="http://www.startuplessonslearned.com/2008/11/five-whys.html" title="Five-Whys" target="_blank">Five-Whys</a> which originated in Toyota&#8217;s production system.</p>
<p>It involves asking the question why five times to drill down to the root cause of a problem.  The method then suggests you invest a small amount of time to address each of the five answers, effectively improving the process piece by piece without having to invest huge amounts of time, money or effort.  It&#8217;s a very effective method, and I strongly urge you to read all the details.</p>
<h2>Publish A Post-Mortem</h2>
<p>And finally the most important part when you&#8217;ve suffered a disaster is to let people know.  The guy on point would have recorded all the details in a timeline of events; you have your five-whys analysis and the actions you&#8217;re going to take to make sure this kind of disaster never happens again; so publish it.</p>
<p>If it&#8217;s an internal facing problem, then there&#8217;s obviously no need to publish outside of your own organisation, but it makes sense to distribute the post-mortem to at least those who had been effected by the disaster.  If it was a public facing problem where your customers (or a percentage of) suffered, then make it a public post-mortem.  Release it to the customer services department to distribute, put it on the upcoming maintenance/service status page (assuming you have one that works!), or publish it as a blog post.</p>
<p>Show people the results of the five-whys, even if it displays some of that human error &#8212; that&#8217;s ok, we&#8217;re all human, remember.  Show people the steps you&#8217;re going to take to make sure that this never happens again &#8212; your customers will appreciate it.</p>
<p>But one thing, don&#8217;t put it on your Facebook wall and then expect non-logged-in users to be able to view it.  Yes, MyDomain, I&#8217;m looking at your &#8220;you need to log into Facebook to see this page&#8221; post-mortem.  Ho hum.</p>
<div class="mb30"></div>
<p>So, there you have it.  What to do when disaster strikes at your scalable service.  Now let&#8217;s hope you never have to put this plan into action, eh &#8230;?</p>
]]></content:encoded>
			<wfw:commentRss>http://singinghorsestudio.com/scalability-what-to-do-when-disaster-strikes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Four Features of a Scalable Web Application</title>
		<link>http://singinghorsestudio.com/four-features-of-a-scalable-web-application/</link>
		<comments>http://singinghorsestudio.com/four-features-of-a-scalable-web-application/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 11:29:11 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[capacity planning]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[multitier applications]]></category>
		<category><![CDATA[packaging]]></category>

		<guid isPermaLink="false">http://w0.singinghorsestudio.com/?p=121</guid>
		<description><![CDATA[I&#8217;m often asked how we write scalable web applications. I&#8217;ve boiled down the long list of factors we consider to the following four key features. It isn&#8217;t an exhaustive list, but any web app missing any of these is at best an unknown, and at worst heading for trouble! #1 Multitiered Application Architecture Writing your<a class="moretag" href="http://singinghorsestudio.com/four-features-of-a-scalable-web-application/">... [Continued]</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m often asked how we write scalable web applications. I&#8217;ve boiled down the long list of factors we consider to the following four key features. It isn&#8217;t an exhaustive list, but any web app missing any of these is at best an unknown, and at worst heading for trouble!</p>
<p><strong>#1 Multitiered Application Architecture</strong></p>
<p>Writing your application in <a href="http://en.wikipedia.org/wiki/Multitier_architecture" target="_blank">multiple tiers</a> allows for horizontal scaling. For example, a three tier application will typically have a backend data store layer, a business logic / application layer, and a front end layer serving the data out to your web page, application, or mobile app &#8211; or all three! These tiers should be independent of each other, so that when the database tier starts creaking, you can add a couple of hosts to that tier, replicate your database horizontally onto those hosts, and triple the capacity of the data layer. If it was the application layer, add the boxes there and run a few more instances of the application. If your application is evenly utilised, add a box to each tier to increase your capacity.</p>
<p>The gold standard here is to achieve <em>linear horizontal scaling</em>. Add one new hardware box to any of your application layers, and increase the capacity of that layer by one unit. This approach makes sure you can scale from a two box cluster, right up to a three thousand box server farm. Factor in the increasing power of hardware over time for a given cost, and you can achieve greater than linear scaling.</p>
<p><strong>#2 A Capacity Plan</strong></p>
<p>Your beautifully architected app won&#8217;t scale at all unless you have hardware (or cloud capacity) to scale it onto. Ideally, you&#8217;re ready for increasing capacity. You know where the budget&#8217;s coming from, you know where the capacity will be introduced, you know your cloud host can bring it online, or your data-centre can rack and cable it within two days. When you have your capacity plan, you&#8217;re ready to satisfy the increased needs of your application. Feature <strong>#4</strong> will help you predict this need, and feature <strong>#3</strong> will help you get it up to speed once it&#8217;s online.</p>
<p><strong>#3 Architected for Easy Deployment</strong></p>
<p>The easier it is to bring up an element in your system, the quicker and cheaper it is to add those new boxes. If, for instance, you&#8217;re running <a href="http://www.ubuntu.com/" target="_blank">Ubuntu</a> and you&#8217;ve packaged your application up into  a private <a href="http://en.wikipedia.org/wiki/Advanced_Packaging_Tool" target="_blank">apt-get</a> repository, then installation is as easy as &#8220;sudo apt-get install my-web-app&#8221; or &#8220;sudo apt-get install my-database-schema&#8221;. The installation process will initiate and launch the service, and you have a one step install, that any competent Linux user can perform.</p>
<p><strong>#4 Monitoring</strong></p>
<p>How do you know when your application needs to scale up or down? Because analysis of your historical monitoring data and identification of the trends it shows tells you! Basic monitoring tells you how loaded each piece of hardware in your infrastructure is. So you can see that your database host is holding your application back. Better monitoring shows you how each tier in your application is performing. So you can see that your application tier is only using 10% of the capacity of the <a href="http://en.wikipedia.org/wiki/Blade_server" target="_blank">blades</a> it&#8217;s running on, while your front end web servers are maxed out. Migrate some of those blades to your web severs, and you&#8217;ve just increased the capacity of your application without buying any new hardware.</p>
<p><strong>Conclusion</strong></p>
<p>There are a tonne of other factors to writing a scalable web application. For example, graceful degradation, knowing when to make an API idempotent, knowing when to vertically scale, knowing whether to <a href="http://en.wikipedia.org/wiki/Shard_(database_architecture)" target="_blank">shard</a> your database, or use a <a href="http://en.wikipedia.org/wiki/Master/slave_(technology)" target="_blank">master / slave</a> pattern, and a lot of other things. However, if you&#8217;ve got the four points above covered, you&#8217;re off to a great start.</p>
<p>We also have further information in our podcast &#8211; &#8216;<a title="How To Scale Your Online Application" href="http://podcast.singinghorsestudio.com" target="_blank">How To Scale Your Online Application</a>&#8216;.</p>
]]></content:encoded>
			<wfw:commentRss>http://singinghorsestudio.com/four-features-of-a-scalable-web-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>High Jump and Limbo</title>
		<link>http://singinghorsestudio.com/high-jump-and-limbo-2/</link>
		<comments>http://singinghorsestudio.com/high-jump-and-limbo-2/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 13:50:10 +0000</pubDate>
		<dc:creator>Johnny</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[scalable system]]></category>
		<category><![CDATA[workload]]></category>

		<guid isPermaLink="false">http://w0.singinghorsestudio.com/?p=118</guid>
		<description><![CDATA[High Jump In scalable systems development it&#8217;s all too easy to focus on the highs. The plaudits are there for people who can claim &#8216;My system can scale to 200 thousand bazillion customers! Simultaneously!&#8217;. Yet not all businesses function like Facebook, Amazon or Twitter. Regular businesses suffer peaks and troughs of activity. Limbo Efficient handling<a class="moretag" href="http://singinghorsestudio.com/high-jump-and-limbo-2/">... [Continued]</a>]]></description>
			<content:encoded><![CDATA[<p><strong>High Jump</strong></p>
<p>In scalable systems development it&#8217;s all too easy to focus on the highs. The plaudits are there for people who can claim &#8216;My system can scale to 200 thousand bazillion customers! Simultaneously!&#8217;. Yet not all businesses function like Facebook, Amazon or Twitter. Regular businesses suffer peaks and troughs of activity.</p>
<p><strong>Limbo</strong></p>
<p>Efficient handling of low activity should be of equal import to that of high activity, otherwise the overheads imposed by your ability to handle peak are going to kill your efficiency during non-peak times. The lean times are exactly when being efficient is the most meaningful. Sure, nobody likes to think about shrinkage and lean times, but that&#8217;s the reality of business &#8211; you take the lows with the highs. Taking those lows is a lot easier when your systems work with you, rather than against.</p>
<p><strong>Everybody loves parfait^H^H^H^H^H^H examples</strong></p>
<p>So your business is ticking along nicely. You release a product now and then and they&#8217;re as successful as you predict. Go you! Out of nowhere you have a monster success on your hands, totally out of proportion with what you expect. Party time, right?</p>
<p>Well, that depends if you can you clear the High Jump. If your systems were organically grown with a specific workload in mind then that unanticipated spike could cause your systems to react badly. You&#8217;re busy patching up your systems, apologising to your customers for slowness and errors, basically working your arms off when you should be kicking back celebrating. &#8216;Victim of your own success&#8217; suddenly has new meaning to you.</p>
<p>So let&#8217;s assume that your business has a kick ass scalable system and can totally cope with that spike. Go you! But wait. What happens when that spike tails off? If your systems don&#8217;t efficiently scale back in line with the workload then you&#8217;re costing yourself money. The leaner the lean times, the more those costs are going to hurt. &#8216;Victim of your own success&#8217; now has a subtle new twist.</p>
<p>For your systems to be able to Limbo when the time comes, they need a good sense of self. I don&#8217;t mean Terminator style machine based violence, not that you can fault their sense of ruthless efficiency, but your system needs to know when it&#8217;s time to scale things back and save some overhead.</p>
<p>Scalability isn&#8217;t all about scaling up, it&#8217;s about efficiently handling the workload, high or low. Now you can party <img src='http://singinghorsestudio.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>In a later post I&#8217;ll go into some of the &#8216;hows&#8217; and &#8216;whens&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://singinghorsestudio.com/high-jump-and-limbo-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
