{"title":"Andrew Z Allen","link":[{"@attributes":{"href":"http:\/\/andrewzallen.com\/","rel":"alternate"}},{"@attributes":{"href":"http:\/\/andrewzallen.com\/feeds\/programming.atom.xml","rel":"self"}}],"id":"http:\/\/andrewzallen.com\/","updated":"2013-03-10T10:39:00-06:00","entry":[{"title":"The Frontend","link":{"@attributes":{"href":"http:\/\/andrewzallen.com\/programming\/the-frontend.html","rel":"alternate"}},"updated":"2013-03-10T10:39:00-06:00","author":{"name":"Andrew Z Allen"},"id":"tag:andrewzallen.com,2013-03-10:programming\/the-frontend.html","summary":"<p>The frontend worked so perfectly into <a class=\"reference external\" href=\"http:\/\/andrewzallen.com\/programming\/the-backend.html\">the backend<\/a>, I wrote about this last time,<\/p>\n<p>The great thing about this set up is the decoupling it provided.\nA lot of web apps rerender the whole page from scratch and therefore transmit their markup over and over again to the user.\nInstead we transmitted our entire package of logic and templates in a single js file.\nThis file, which clocked in at <span class=\"math\">\\(\\lt 200\\,\\textrm{kb}\\)<\/span>\n thanks to Google Clousre Compiler's advanced mode, is hosted on <a class=\"reference external\" href=\"http:\/\/aws.amazon.com\/cloudfront\">cloudfront<\/a> which made it super fast.<\/p>\n<p>On top of using a CDN, every deployment of the application got a new url at the CDN.\nThis means that every time you loaded the page after the first time, the only request that was made was the single request to load the HTML that referenced our assets.\nWith this, and a few more tricks, we were able to get our page load time down even on junky connections to just a few tens of milliseconds.\nAccording to our internal metrics, <span class=\"math\">\\(95%\\)<\/span>\n of content arrived from our server in <span class=\"math\">\\(\\lt 100\\,\\textrm{ms.}\\)<\/span>\n\n<span class=\"math\">\\(100\\,\\textrm{ms}\\)<\/span>\n was about the worst lag anyone could possibly have experienced but we didn't stop there.\nWhen we fetched data for every page, we preemptively loaded data for the next next screen so that it would already be available when the user clicked that link making the delay <span class=\"math\">\\(\\textrm{sub-}10\\,\\textrm{ms}\\)<\/span>\n on good browsers.<\/p>\n<p>Deliverability aside, we wrote the application in Google's Closure Framework which provided us with the aforementioned compilation statistic.\nThis is an old framework that not only has <a class=\"reference external\" href=\"http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/demos\/index.html\">everything you could possible wish for<\/a>, it also has <a class=\"reference external\" href=\"http:\/\/docs.closure-library.googlecode.com\/git\/index.html\">extremely thorough documentation<\/a>.\nThey provide a framework which helps you through the creation of your <cite>:abbr: RIA (Rich Internet Application)<\/cite>.<\/p>\n","category":[{"@attributes":{"term":"programming"}},{"@attributes":{"term":"GoSpotCheck"}}]},{"title":"The Backend","link":{"@attributes":{"href":"http:\/\/andrewzallen.com\/programming\/the-backend.html","rel":"alternate"}},"updated":"2013-02-17T10:39:00-07:00","author":{"name":"Andrew Z Allen"},"id":"tag:andrewzallen.com,2013-02-17:programming\/the-backend.html","summary":"<p>Writing any kind of mobile application for <abbr title=\"Busines To Business\">B2B<\/abbr>\nrequires some central command and control server. For GoSpotCheck, that is the\nbeaver, the hub and spoke of the SpotChecking system.<\/p>\n<p>Beaver operates as a <a class=\"reference external\" href=\"http:\/\/grails.org\">grails<\/a> application that is constantly running, managed by\n<a class=\"reference external\" href=\"http:\/\/aws.amazon.com\">Amazon EC2<\/a>. The service accesses the database and\nessentially provides a very simple interface for client interaction. All\nAPI requests came through in a JSON format and all responses were in kind.\nThe same beaver server also serves the GoSpotCheck homepage\/admin panel which\nprevented the pain that is\n<a class=\"reference external\" href=\"http:\/\/en.wikipedia.org\/wiki\/Cross-origin_resource_sharing\">CORS<\/a> from\nentering our lives.<\/p>\n<p>All requests were atomic, no <a class=\"reference external\" href=\"http:\/\/tools.ietf.org\/html\/rfc5789\">PATCH<\/a>, which allowed us an interesting opportunity to treat the backend not as a webserver but instead as a GoSpotCheck specific database.\nIt implemented methods and stored data that only we would find useful.\nThe fact that it was really persisted to a database deeper in the stack was inconsequential to us.\nAll we cared about was that the database was atomic, consistent, isolate, and durable.\nA model that should be easy any newcomer from any CS program in the world to reason about.<\/p>\n<p>This system was extremely decoupled which meant that when we experienced problems in any one system (less the core), the others continued to operate as if everything were normal.<\/p>\n<p>Next time I will talk about the development of <a class=\"reference external\" href=\"http:\/\/andrewzallen.com\/programming\/the-frontend.html\">the frontend<\/a> and some of the more interesting things we did with it.<\/p>\n","category":[{"@attributes":{"term":"programming"}},{"@attributes":{"term":"GoSpotCheck"}}]},{"title":"Hello World","link":{"@attributes":{"href":"http:\/\/andrewzallen.com\/programming\/hello-world.html","rel":"alternate"}},"updated":"2013-02-02T10:39:00-07:00","author":{"name":"Andrew Z Allen"},"id":"tag:andrewzallen.com,2013-02-02:programming\/hello-world.html","summary":"<p>I just quit my job, 1 week ago in fact.\nI've had a lot of time to think about it, and there were some things that didn't go well, but there were some things that really did.\nI worked for a company called <a class=\"reference external\" href=\"http:\/\/www.gospotcheck.com\">GoSpotCheck<\/a> and helped them build one of the best systems I have ever had the pleasure to be involved with.<\/p>\n<p>When I started doing web development, website design was static pages with all content fully loaded.\nEverything was loaded through a portal, a phrase that I still don't fully understand.\nAfter a few years, the world started to buzz about <a class=\"reference external\" href=\"http:\/\/wikipedia.org\/wiki\/Progressive_Enhancement\">progressive enhancement<\/a> for the web.\nMajor page navigation was still handled by making a full HTTP request.\nThis meant that most of a pages conten't didn't change during this process, making much of the &quot;over the wire&quot; unnecessary.\nTo combat this, many modern apps are written as <a class=\"reference external\" href=\"http:\/\/wikipedia.org\/wiki\/Single_Page_Application\">single page apps<\/a>.\nAll assets are delivered upfront and the only governor on the speed of your application is the speed of the JS VM and your code.<\/p>\n<p>This may sound familiar to many, many people.\nIt is even more familiar to people if I put it this way, &quot;native application&quot;.\nThis application consumes a remote API and displays the content to the user.\nJavascript is the native development language of the web.\nHow is that different from a mobile app?\nWe built a fantastic native application for the web.<\/p>\n<p>I intend this blog to be a continued endeavor documenting projects I'm working on or have previously worked on. Next, I'm going to talk about <a class=\"reference external\" href=\"http:\/\/andrewzallen.com\/programming\/the-backend.html\">the backend<\/a>, the core of our architecture.<\/p>\n","category":[{"@attributes":{"term":"programming"}},{"@attributes":{"term":"GoSpotCheck"}}]}]}