<?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>Coffee on the Keyboard &#187; web development</title>
	<atom:link href="http://coffeeonthekeyboard.com/tag/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://coffeeonthekeyboard.com</link>
	<description>by James Socol</description>
	<lastBuildDate>Fri, 20 Apr 2012 22:17:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/>		<item>
		<title>The Evolution of SUMO</title>
		<link>http://coffeeonthekeyboard.com/the-evolution-of-sumo-339/</link>
		<comments>http://coffeeonthekeyboard.com/the-evolution-of-sumo-339/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 22:39:21 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[kitsune]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[sumo]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://coffeeonthekeyboard.com/?p=339</guid>
		<description><![CDATA[When I joined the SUMO team six months ago, the team was just starting a discussion of &#8220;where do we go from here?&#8221;  SUMO was built on a CMS called TikiWiki, and had diverged pretty significantly in two years. (David Tenser wrote a more detailed history if you&#8217;re interested.) After a few months of talking [...]]]></description>
			<content:encoded><![CDATA[<p>When I joined the <a title="SUpport dot MOzilla dot com" href="http://support.mozilla.com/" target="_blank">SUMO</a> team six months ago, the team was just starting a discussion of &#8220;where do we go from here?&#8221;  SUMO was built on a <abbr title="Content Management System">CMS</abbr> called <a href="http://tikiwiki.org/" target="_blank">TikiWiki</a>, and had diverged pretty significantly in two years. (David Tenser wrote <a href="http://blog.mozilla.com/sumo/2010/02/18/the-bright-future-of-the-sumo-platform/" target="_blank">a more detailed history</a> if you&#8217;re interested.)</p>
<p>After a few months of talking and testing—and a few changes of direction—we&#8217;ve decided that SUMO will follow our colleagues on <a title="Addons dot Mozilla dor Org" href="https://addons.mozilla.org/" target="_blank">AMO</a> and move to a custom web application, built on <a href="http://www.djangoproject.com/">Django</a>, a development framework in Python.</p>
<p>Why are we committing to such a dramatic new direction? Three major reasons. <span id="more-339"></span><em>Keep in mind that SUMO was built on TikiWiki 1.10, a little more than two years out of date.</em></p>
<h3>Performance</h3>
<p>TikiWiki is a very feature-rich application. An unfortunate trade-off for us is performance, especially on a site serving 16 million users every week. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=532498" target="_blank">As our European users</a> in particular know, SUMO can be unacceptably slow at times, especially when editing articles. Many of the changes we made to the platform—most of which were contributed back over the past few months—were to improve performance via tools like output caching, database replication, and just refactoring. When we evaluated the latest version of TikiWiki, we found that performance was around the same, on average.</p>
<p>In the new platform, we&#8217;ll be taking advantage of techniques now available, including query and template/fragment caching and expect to see dramatic performance improvements. We&#8217;ll also be avoiding some of the performance pitfalls that TikiWiki fell into over the years with improvements to the security, database, and templating layers, among others.</p>
<p>But the biggest performance impact—I expect—will be moving from a general-purpose CMS to a dedicated web application, focused on providing the SUMO experience.</p>
<h3>Hackability</h3>
<p>To work on SUMO, you have to overcome a steep learning curve. Components tend to be tightly-coupled, or grouped in unintuitive ways, and are not as extensible as we&#8217;d like. The lack of a comprehensive test suite leaves changes to important sections of code open to introducing regressions in otherwise unrelated, dependent areas. SUMO 1.x also fails to function without a relatively complete copy of its database, which makes it difficult for community members outside the company to contribute.</p>
<p>With the new platform, and some discipline from the team, our goal is to improve all of these and make it easier for someone to get started hacking on SUMO.</p>
<ul>
<li>We&#8217;ll be striving to keep code loosely-coupled and extensible—including using existing or external libraries whenever possible, and turning our own contributions into external libraries where possible.</li>
<li>We&#8217;re adopting a test-driven development workflow to ensure that our components are easier to safely hack, and lighten the load on our <abbr title="Quality Assurance">QA</abbr> team by reducing regressions.</li>
<li><abbr title="Test-Driven Development">TDD</abbr> and Django will make it easier to work without a copy of the database, using fixtures and migrations to minimize the dependence on real data.</li>
</ul>
<p>The net effect of these decisions will be to lower the barrier to entry to SUMO development, and hopefully make useful code available to other projects. Wil Clouser <a href="http://micropipes.com/blog/2009/11/17/amo-development-changes-in-2010/" target="_blank">listed more strengths</a> of Django as a platform when the AMO team decided to switch.</p>
<h3>Strength in Numbers</h3>
<p>By using the same platform as AMO, both teams will benefit from sharing code and resources. We&#8217;re already using the same template adapter, database router, caching layer, and HTML sanitizer. As open source developers often say: &#8220;with enough eyes, all bugs are shallow,&#8221; and by sharing code we get more eyes on it. We&#8217;ll benefit from insights the AMO team has gleaned by starting the process of moving from a PHP framework to Python just ahead of us. We&#8217;ll even be able to send code reviews across teams and benefit from deeper knowledge of the various problem domains we share: have a question about localization? Both teams can share expertise and best-practices.</p>
<p>Solving problems once and sharing the solution directly reduces the amount of work both teams have to do. And when SUMO writes code in such a way that AMO can use it, we can also release it separately so others can benefit from our solutions—and point out flaws and contribute improvements.</p>
<h3>Other Changes</h3>
<p>Also among the changes coming in the next year:</p>
<ul>
<li><strong>Version Control System. </strong>Though we don&#8217;t have a specific plan in place, it seems likely that SUMO will be moving from SVN to Git for source control. Because Git is distributed, it allows us to use a more <a href="http://nvie.com/archives/323" target="_blank">collaborative workflow</a>, and it&#8217;s easier for us to push our code to public repositories like <a href="http://github.com/">Github</a>.</li>
<li><strong>Continuous Integration.</strong> We&#8217;ll be using <a href="https://hudson.dev.java.net/">Hudson</a> for continuous integration, which will automate our tests and alert us to potential issues and regressions. The web QA team has also been working to make sure our <a href="http://seleniumhq.org/">Selenium</a> tests can run through Hudson, greatly increasing test coverage for a web application like SUMO.</li>
<li><strong>Interface Localization</strong>. One of the ways we plan to improve the SUMO experience this year is by moving our interface localization to <a href="http://www.gnu.org/software/gettext/">gettext</a>, which is an industry-standard tool for localization. As we move parts of the site from TikiWiki to Django, those new sections will be localized via gettext, which helps us take advantage of our great community with tools like <a href="http://localize.mozilla.org/">Verbatim</a>.</li>
</ul>
<h3>A Foundation for the Future</h3>
<p>The goal of all of this work—and it will be a lot of work—is to put SUMO on a solid foundation for future growth and, at the same time, improve the experience for everyone—from developers to contributors to localizers to visitors. We have a daunting and aggressive road ahead of us, but I&#8217;m confident that we&#8217;ll emerge in a better place.</p>
<p>SUMO 2 is codenamed <a href="https://wiki.mozilla.org/Support/Kitsune">Kitsune</a>, and is already <a href="http://github.com/jsocol/kitsune">up on Github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeeonthekeyboard.com/the-evolution-of-sumo-339/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Local Web Development</title>
		<link>http://coffeeonthekeyboard.com/local-web-development-323/</link>
		<comments>http://coffeeonthekeyboard.com/local-web-development-323/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 23:14:30 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[vm]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://coffeeonthekeyboard.com/?p=323</guid>
		<description><![CDATA[I&#8217;m not ashamed of it: I like Windows. I think the user experience is light-years ahead of Gnome and KDE. There&#8217;s nothing ostensibly wrong with OS X, but there are little usability differences and frankly switching isn&#8217;t worth the annoyance to me. That&#8217;s why I run Windows 7 on all three computers I use daily. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not ashamed of it: I like Windows. I think the user experience is light-years ahead of Gnome and KDE. There&#8217;s nothing ostensibly <em>wrong</em> with OS X, but there are little usability differences and frankly switching isn&#8217;t worth the annoyance to me. That&#8217;s why I run Windows 7 on all three computers I use daily.</p>
<p>This is only a problem when I try to work on LAMP web applications. Sure, I could install <a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a>, but running Apache/PHP on Windows is really not close enough to a production environment. So I have two choices: I can dual-boot Linux and work in an OS—well, a window manager—I don&#8217;t like, or I can turn to virtual machines.<span id="more-323"></span></p>
<p><a href="http://www.vmware.com/">VMWare</a> is a pretty heavyweight solution. <a href="http://www.vmware.com/products/fusion/">Fusion</a>, for OS X, is a great product. But in Windows, I opt for Sun&#8217;s <a href="http://www.virtualbox.org/">VirtualBox</a>.</p>
<div id="attachment_324" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-324" title="virtualbox-new" src="http://coffeeonthekeyboard.com/wp-content/uploads/2009/12/virtualbox-new-300x206.png" alt="VirtualBox New Virtual Machine Wizard" width="300" height="206" /><p class="wp-caption-text">VirtualBox New Virtual Machine Wizard</p></div>
<p>VirtualBox lets me run Linux (I opt for <a href="http://fedoraproject.org/get-fedora">Fedora</a> as it&#8217;s close to our production environment and I like it) in just another window, right next to Firefox.</p>
<p>To create a new <abbr title="Virtual Machine">VM</abbr>, you&#8217;ll only need VirtualBox and a Linux ISO. (Or, you could use a pre-existing VM, or an &#8220;appliance,&#8221; copied from somewhere else. I&#8217;m not going to cover that.) Step through the wizard. Some of my recommended settings:</p>
<div id="attachment_325" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-325" title="virtualbox-disk" src="http://coffeeonthekeyboard.com/wp-content/uploads/2009/12/virtualbox-disk-300x268.png" alt="VirtualBox New Disk Settings" width="300" height="268" /><p class="wp-caption-text">VirtualBox New Disk Settings</p></div>
<ul>
<li>At least 512 MB of RAM for running Gnome+Apache+MySQL+VIm(+Firef0x?) in the VM.</li>
<li>At least 30 GB of hard disk. Yes, you can add more later, but expanding an existing disk is difficult, and if you use a &#8220;Dynamically expanding storage&#8221;-type of disk (see above) it won&#8217;t take the full 30 GB right off the bat.</li>
<li>There are two ways to go about doing Network settings—I do both.
<ul>
<li>Use Bridged networking. This gives your VM an IP address accessible to the rest of your network.</li>
<li>Use NAT. This gives your VM an IP address on a virtual network that only exists in your computer, but with a virtual gateway giving your VM access to the internet.</li>
<li>(You can also use Host-only networking, but that would prevent your VM from accessing the internet at all, and that&#8217;s no good.)</li>
</ul>
</li>
<li>Mount your installation media ISO as a CD/DVD drive via VirtualBox. You&#8217;ll be able to boot off the ISO and install Linux. You may run into issues if you leave the ISO mounted after installation.</li>
</ul>
<div id="attachment_326" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-326" title="virtualbox-network" src="http://coffeeonthekeyboard.com/wp-content/uploads/2009/12/virtualbox-network-300x260.png" alt="VirtualBox Network Settings" width="300" height="260" /><p class="wp-caption-text">VirtualBox Network Settings</p></div>
<p>Once you&#8217;re in Linux, set up your web server environment (use yum, apt-get, or whatever other package manager you choose). The key software I use:</p>
<ul>
<li>Apache</li>
<li>PHP</li>
<li>MySQL</li>
<li>Memcached</li>
<li>Sphinx</li>
<li>Squid</li>
</ul>
<p>With the software above, I can very nearly replicate the production environment for our web applications, while still spending most of my time in Windows. (When I do switch to the VM, I&#8217;m usually in VIm, my favorite text editor, anyway.)</p>
<p>Apache/PHP/MySQL is the typical PHP app stack. We use memcached for output caching (on <a href="http://support.mozilla.com/">SUMO</a>, anyway). We use Sphinx to power our search engine. Squid is useful from time to time for approximating an application behind a reverse-proxy cache and load-balancing server. (You could also use nginx or Varnish.)</p>
<p>If you use NAT or Bridged networking, you&#8217;ll be able to navigate to your VM&#8217;s IP address from a browser on the host computer (in my case, in Windows). By using Bridged, I can access my local Apache instance from browsers on Windows, Linux, or a nearby Mac, which is immensely valuable when doing browser support work and testing. I can even send my VM&#8217;s IP address to other people in the office and have them look at my local work.</p>
<p>There is a performance cost with a VM. HTTP requests would come back faster in a real Linux environment, and sometimes I do boot into Linux, but the convenience is worth it to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeeonthekeyboard.com/local-web-development-323/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

