<?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>trevoro.ca &#124; blog &#187; ssjs javascript hosting economics cloud computing scali</title>
	<atom:link href="http://trevoro.ca/blog/tag/ssjs-javascript-hosting-economics-cloud-computing-scali/feed/" rel="self" type="application/rss+xml" />
	<link>http://trevoro.ca/blog</link>
	<description>Elegant Solutions to Complex Problems</description>
	<lastBuildDate>Tue, 12 Jul 2011 21:30:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Why Serverside Javascript Matters</title>
		<link>http://trevoro.ca/blog/2009/02/05/why-serverside-javascript-matters/</link>
		<comments>http://trevoro.ca/blog/2009/02/05/why-serverside-javascript-matters/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 19:27:01 +0000</pubDate>
		<dc:creator>Trevor Orsztynowicz</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ssjs javascript hosting economics cloud computing scali]]></category>

		<guid isPermaLink="false">http://trevoro.ca/blog/?p=307</guid>
		<description><![CDATA[Javascript is a popular scripting language that comes embedded in most browsers. It&#8217;s usually what&#8217;s responsible for making your browsing experience as rich as it is, and for this reason we tend to categorize it in the realm of client-side development. In fact, running javascript on the server is odd enough for the phrase &#8216;Server-side [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">Javascript</a> is a popular scripting language that comes embedded in most browsers. It&#8217;s usually what&#8217;s responsible for making your browsing experience as rich as it is, and for this reason we tend to categorize it in the realm of client-side development. In fact, running javascript on the server is odd enough for the phrase &#8216;Server-side Javascript&#8217; to have been coined in the first place, but it isn&#8217;t exactly a new idea. Livewire, Netscape&#8217;s <a href="http://blogs.sun.com/jyrivirkki/date/20090113">Enterprise Server</a> product included server-side javascript functionality in 1996. But it hasn&#8217;t really caught on. Writing server-side code in PHP, Ruby, Python and Perl, ASP.Net and Java has been the &#8220;way we do things&#8221; and javascript remained something you messed around with once you wanted to spoil your users with a  richer experience. Before I explain server-side Javascript adoption, we need one important piece of background information.</p>
<p><strong>There are economic concepts that dictate how you use services and hosting on the internet.</strong></p>
<p>Do tell.</p>
<p>Computing is really cheap. Think about all the email that Gmail handles in a day. It&#8217;s so cheap that advertising can pay for it. But the &#8220;Network is the computer&#8221; after all, so we have to think about what it takes to get that information in and our of these clusters of cheap computing, and that&#8217;s the rub. Amazon charges $0.17/gig to get your data out of EC2, which is equivalent to almost two hours of their cheapest computing instance. This is a good scenario if the task you send to your cheap compute cluster can be defined in a very small package, and yields a relatively small result but typical web services and applications don&#8217;t work this way. The point is: <strong>Its cheaper to move the computing than it is to move the data.</strong></p>
<p>So what?</p>
<p>This all clicked for me when I messed around with Freebases <a href="http://dev.freebaseapps.com/">development environment</a>, &#8220;Acre&#8221;. Acre is great. It lets you create, edit, and host your applications through a browser. Not only had I been messing around with Acre, but I&#8217;d also been toying with the idea of using Freebase as a mechanism for validating and normalizing data. The problem is asking Freebase for a bunch of information on say, &#8220;every city on the planet&#8221; is pretty expensive. Not only do you incurr a network transfer cost, but you then have to process the information. Not exactly ideal. But what if I could pose a question to an application running at Freebase? What if, instead of pulling out all the information about every movie and creating your own Freebase-based IMDB, you could host it right next to the data source. You get all the benefits of transferring the &#8216;heavy stuff&#8217; over the WAN, and the browser gets the good stuff, but only when it asks for it.</p>
<p><strong>This is why server-side javascript is perfect</strong></p>
<p>Hosting Ruby, PHP, Python, etc is kind of a pain in the ass. Well its easier than it used to be but it could be a lot better. If I had to choose something relatively lightweight to interface to my data-source and create that rich browsing experience, you&#8217;d probably pick Javascript. My initial impression is that depending on your data-source, scaling it would be easy, too. Running computing close (as in LAN close) to the data-set means a few things</p>
<p>1. You can create cheaper mashups</p>
<p>2. You can eliminate all the cruft from your data before it gets sent over the wire</p>
<p>3. You can create nifty applications and ask them short questions that yield short answers but require huge amounts of data to determine</p>
<p><strong>ZOMG How do I start?</strong></p>
<p>You&#8217;ll have to learn javascript, and as a hosting or service operator you&#8217;ll have to choose an application for running it server-side. There are a few options. Trusty Wikipedia has a <a href="http://en.wikipedia.org/wiki/Server-side_JavaScript">lengthy list</a> of Server-side Javascript implementations. I&#8217;d recommend checking out the following:</p>
<p><a href="http://www.mozilla.org/rhino/">Rhino </a></p>
<p><a href="http://www.mozilla.org/js/spidermonkey/">Spidermonkey</a></p>
<p><a href="http://code.google.com/p/v8/">V8</a></p>
<p><a href="http://appjet.com/">AppJet</a></p>
<p><a href="http://www.aptana.com/jaxer/">Jaxer</a></p>
<p>-Trevor</p>
]]></content:encoded>
			<wfw:commentRss>http://trevoro.ca/blog/2009/02/05/why-serverside-javascript-matters/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

