<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kevin J. Dolan on Medium]]></title>
        <description><![CDATA[Stories by Kevin J. Dolan on Medium]]></description>
        <link>https://medium.com/@chief_technical_officer?source=rss-eb8ddc567d83------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8qmjWLQH2jv8LWvumBLqnQ.jpeg</url>
            <title>Stories by Kevin J. Dolan on Medium</title>
            <link>https://medium.com/@chief_technical_officer?source=rss-eb8ddc567d83------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 02:23:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chief_technical_officer/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Obligatory AppEngine Post-Mortem]]></title>
            <link>https://medium.com/metric-tech/the-obligatory-appengine-post-mortem-c34cdb4a4b21?source=rss-eb8ddc567d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/c34cdb4a4b21</guid>
            <category><![CDATA[rant]]></category>
            <category><![CDATA[postmortem]]></category>
            <category><![CDATA[google-app-engine]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Kevin J. Dolan]]></dc:creator>
            <pubDate>Fri, 09 Jun 2017 20:26:02 GMT</pubDate>
            <atom:updated>2017-06-09T20:31:59.112Z</atom:updated>
            <content:encoded><![CDATA[<p><em>When we speak to candidates in interviews, one of the first questions is always about our server stack. The answers to this question has changed pretty dramatically over time. This is part of a series on the evolution of our server stack at Metric Collective.</em></p><p>After spending <a href="https://medium.com/metric-tech/the-aws-days-5055908ea4c4">a particularly painful hangover debugging a catastrophic failure</a> of our servers, I vowed to find a way to reduce our dev ops burden. I had used AppEngine in the past in College, but never on a major project.</p><p>This was in late 2013, and despite reading several cautionary blog articles (which I can’t seem to locate right now on Google…suspicious!), the promise of zero-ops-burden was highly appealing.</p><p>Consistent with my core programming philosophy, <strong>Build it Twice, Build it Nice</strong>, we signed ourselves up for a full rewrite to run the server on AppEngine.</p><h4>He Promised Me The World</h4><p>The selling point of AppEngine is that it offers autoscaling web apps with zero ops burden. You simply upload code (in our case, a Python WSGI app), and Google decides how many servers you need based on the current load, using proprietary algorithms that look at a variety of factors, including CPU load, request latencies, and traffic history.</p><p>In addition to that, there is an entire ecosystem of tools to use for creating web apps, including a background task queue, scheduled cron jobs, and a magical database with infinite scale!</p><p>Since our website was already written in Python, porting it to AppEngine was not insanely difficult. There were some hacks required in the early days (this should have been a red flag…more on this later), but it all seemed worth it given the fact that we’d have zero down-time.</p><p>And in fact, when we finally ported the code, migrated the data, and pulled the cord on AWS, we experienced a new era. Our server costs went down due to the more efficient use of CPU, and our downtime went to near-zero (excluding of course when we pushed broken code).</p><h4>The Hacks Begin</h4><p>Very early on, we found ourselves needing to depend on hacks to get things working correctly. AppEngine for Python only has a handful of important libraries built in, and for additional libraries, you need to embed the library code directly in the artifacts you send to Google.</p><p>While some people use virtualenv hacks to accomplish this, at first, we found ourselves using github submodules with completely manual dependency management. Google still provides insufficient advice on how to handle this. Not fun!</p><p>Further, the Python that runs on AppEngine is not quite the Python that runs on your machine. Further, the production AppEngine server is not quite the development server.</p><p>Subtle differences make it really difficult to make http requests and use sockets. Libraries that require C bindings (other than the built-ins) cannot be installed at all. This makes it really difficult to do things like use off-the-shelf databases like Mongo or Postgresql.</p><p>When you work on an AppEngine project for a long time, you get used to these hacks. You will often find yourself working on a problem that has a ready-made community solution available, but instead of learning the API for a new lib, you spend most of your time forcing AppEngine to run it.</p><p>You need to get really clever when it comes to things like distributing third-party credentials like API keys safely to AppEngine, without exposing production credentials to your team or the world at large.</p><p>The fact that we ran into these issues very early on, and the fact that the community at large offered very little guidance for how to solve them should have been fairly massive and obvious red flags. Unfortunately, we ignored them.</p><h4>The Database Nightmare</h4><p>AppEngine works best when you buy into its philosophies. They have made a number of unusual decisions, which are designed to enforce best practices. The more you fight these decisions to align better with what you know, the more trouble you will have, and the more hacks you require.</p><p>Thanks to the socket api, which was released at one point a few months after we started using AppEngine, you could use third-party databases like Mongo or Postgres. Unfortunately, since you can’t install C libraries, and since the socket wrapper is not perfect, it’s a real exercise in futility.</p><p>The NDB database is quite powerful, once you get the hang of it, and understand its quirks. It is primarily a key-value store, with some limited querying capabilities. It is eventually consistent, but by using key groups, you can get some consistency guarantees.</p><p>Queries that are more sophisticated than single-attribute queries require you to build indexes, or else they fail loudly in production, but not development. That particular pathology leads to no end of problems.</p><p>You cannot really interact with NDB outside of AppEngine (though you can access the same data using the cloud datastore apis, which don’t seem to work inside AppEngine). That’s a big problem if you want to do any sort of batch processing that can’t reasonably fit into an HTTP request.</p><h4>Support is Non-Existent</h4><p>It is clear that Google has dropped the ball on supporting AppEngine. Further, because it is not very widely used, and so non-standard, the community isn’t there either to support it.</p><p>Support questions can theoretically be answered by upgrading your support package for at least $500 per month, at which point you can use an email ticketing support that managed to solve my problem in about 1 out of 10 cases, with average response times on the order of 24 hours.</p><p>I say this is a Google priority problem, rather than a lack of capability, in comparison to their stellar support for Google Apps, where I had one rep spend about two hours on the phone with me happily helping me solve a particularly unique problem, despite the fact our company spent a small fraction on that service vs AppEngine.</p><h4>Recruiting and Onboarding is Not Ideal</h4><p>Finding knowledgable AppEngine recruits is rare. Occasionally, you will find a candidate who has used it on pet project, but never an expert. At Metric, we are fairly technology-agnostic, so we hire all kinds, but for some, it’s a turn-off.</p><p>Once you do manage to hire somebody, the onboarding process involves teaching the pathologies of AppEngine in addition to the ins-and-outs of your business.</p><p>This is a real barrier for a functioning technology business.</p><h4>It is Expensive, and It is Slow</h4><p>The philosophy behind auto-scaling on AppEngine is to use many tiny servers. That’s fine, but if you compare the specs of those servers to the ones offered by Google Compute Engine, they are on the order of ~5–10 times more expensive.</p><p>We did see a reduction in cost when compared to our over-provisioned AWS installation, but compared to an intelligently auto-scaled GCE deployment, it was massively over-priced.</p><p>There are hidden costs beyond mere CPU, in counting the individual database operations, which can get fairly massive fairly quickly.</p><p>Because the CPU specs on the servers themselves or so poor, the actual rendering costs of things can be fairly high in certain situations, but more importantly, the NDB database is fairly high latency when compared to most SQL solutions.</p><p>I believe the latency is an intentionally trade-off to accomplish consistent, predictable response times at any scale, but given that the majority of companies do not actually need that scale, it seems unwise in retrospect.</p><p>The key to writing fast AppEngine code is to leverage the asynchronous APIs and memcache, but that can be pretty difficult for the average engineer. It’s an unnecessary burden, in my opinion.</p><h4>Conclusions and Where We Went After That</h4><p>This has been a particularly scathing review of Google AppEngine, but the fact remains that it served us well until March of 2017, about 4 years in total.</p><p>The problems with AppEngine ultimately come down, in my opinion, to the problem of portability. AppEngine made some pretty substantially unusual decisions in their design of the platform, and while that may have had justification, it did not catch on in a meaningful way.</p><p>Slightly less managed services like Heroku and Elastic Beanstalk have accomplished a lot of the same goals as AppEngine, without sacrificing standards. Additionally, <a href="https://tech.metriccollective.com/how-metric-manages-the-infrastructure-for-twelve-distinct-server-stacks-with-one-single-deployment-c146261f44d1">the management primitives available in Kubernetes also satisfy a lot of the same goals</a>.</p><p>At this time, the non-standard aspects of AppEngine are simply not made up for by the benefits. There are alternatives, and I think Google understands this. I think that’s why they are now pushing Spanner and Google Container Engine (which is really just Kubernetes).</p><p>So if you are thinking about starting a new project in AppEngine, I’d advise against it. You might get away with it for a while (as we did), but in the end, you’ll wish you paid attention to one of the many post-mortems (as we did).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_jy0TXK1Ktgq5zZFW0Nxlw.jpeg" /><figcaption>The new SZA album is cool.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c34cdb4a4b21" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metric-tech/the-obligatory-appengine-post-mortem-c34cdb4a4b21">The Obligatory AppEngine Post-Mortem</a> was originally published in <a href="https://medium.com/metric-tech">Metric Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The AWS Hangover]]></title>
            <link>https://medium.com/metric-tech/the-aws-days-5055908ea4c4?source=rss-eb8ddc567d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/5055908ea4c4</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Kevin J. Dolan]]></dc:creator>
            <pubDate>Fri, 09 Jun 2017 19:24:38 GMT</pubDate>
            <atom:updated>2017-06-09T20:31:34.468Z</atom:updated>
            <content:encoded><![CDATA[<p><em>When we speak to candidates in interviews, one of the first questions is always about our server stack. The answers to this question has changed pretty dramatically over time. This is part of a series on the evolution of our server stack at Metric Collective.</em></p><p>Shortly after joining Metric, <a href="https://tech.metriccollective.com/wptsd-wordpress-traumatic-stress-disorder-48672c191069">I made it my personal mission to migrate off of Wordpress</a>. Unfortunately, as a newbie, I understood very little about the entire operation of our business. I had the support of the rest of the team, but there was a great deal of risk inherent to the process given that the business was currently functioning and profitable.</p><p>This led to an extended transition plan we called <em>The Ferry Server</em>. The essential premise was to peel off functionality from the WordPress site piecemeal onto a specialized server on AWS that would ferry data between different services.</p><h4>A Naive AWS Deployment</h4><p>By 2012, there were already plenty of people using Chef and Puppet to automate AWS deployments. AWS offered a full-featured API for provisioning and managing servers and the dream of cloud-computing was really starting to take form.</p><p>However, true best-practices had yet to be formed and agreed upon, and most small teams elected to do simple static deployments on AWS (to this day, this still seems like a common choice for the bulk of lean startup teams). We were no different.</p><p>We started using git for version control, we set up a few static AWS EC2 instances for staging and production (manually, using the web console). For development, we installed and ran server software directly on our development machines and had a long readme to describe that process.</p><p>We would SSH into our deployment servers and run bash scripts to fetch new code, install requirements, and restart the application servers. We continued to use MySQL for continuity with the old database, but shortly afterwards transitioned to PostgreSQL.</p><p>Both the application server and database lived on the same node. We had no concept of background tasks.</p><h4><strong>The Ferry Server</strong></h4><p>We called this AWS server the Ferry Server because it ferried data between different services. This smooth transition onto a totally different tech stack for a running business that I was completely new to is one of my proudest accomplishments at Metric.</p><p>For context, we were running a lead-generation website that was content heavy, and we were using a third party service for lead processing.</p><p>Since WordPress is mildly capable of handling content management, and we were particularly unhappy with the feature-set of the lead-management system, we decided to focus on the lead-gen element at first.</p><p>We started by simply intercepting leads that WordPress generated, recording them in our database, and passing them to the lead processor. Next, we did the actual lead verification and delivery on that server itself.</p><p>Piece-by-piece we continued in this fashion, stripping features one-at-a-time until everything was being powered by The Ferry Server. The name stuck, and we still call our admin Ferry (despite it now being a misnomer, to my chagrin).</p><h4>The DevOps Burden</h4><p>At this time, we were still a very small development team. It was just me and a freelancer, and I was doing both application development and dev ops. While the nice folks at Amazon were taking care of all the more difficult ops tasks, running static server deployments still led to its fair share of headaches.</p><p>Because we did not do any auto-scaling of our application servers, it meant that we had a difficult time keeping up with spikes in load. Our solution, given that compute resources were relatively cheap compared to dev resources was to over-provision. This meant that our servers tended to be wildly underutilized most of the time, an unnecessary cost.</p><p>Similarly, when we took our servers down to launch new code, there was an actual moment of downtime. Depending on if we were running complex migrations, that could be a process that lasted minutes, which was embarrassing. This meant that as much as possible, we tried to launch new code late at night.</p><h4>The Hangover</h4><p>Because the system wasn’t particularly auto-healing when the server went down (typically on weekends), it would not start itself back up and somebody would be calling me in a panic to restart it.</p><p><strong>The frequency and diversity of catastrophic failures was fairly high at this time.</strong></p><p>As a perfect example, we had a runaway process that was logging to a file excessively, which managed to take down the server at around 7:30 AM on New Years Day due to an empty disk.</p><p>I had to wade through a pile of empty beer cans and brave a massive hangover to clear up space.</p><p><a href="https://tech.metriccollective.com/the-obligatory-appengine-post-mortem-c34cdb4a4b21">That was the moment I decided that I had had enough.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvENeCW1Q96B58QqNQ95Ng.jpeg" /><figcaption>Looks dumb.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5055908ea4c4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metric-tech/the-aws-days-5055908ea4c4">The AWS Hangover</a> was originally published in <a href="https://medium.com/metric-tech">Metric Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WPTSD: WordPress Traumatic Stress Disorder]]></title>
            <link>https://medium.com/metric-tech/wptsd-wordpress-traumatic-stress-disorder-48672c191069?source=rss-eb8ddc567d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/48672c191069</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[rant]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Kevin J. Dolan]]></dc:creator>
            <pubDate>Fri, 09 Jun 2017 18:47:19 GMT</pubDate>
            <atom:updated>2017-06-09T20:29:44.528Z</atom:updated>
            <content:encoded><![CDATA[<p><em>When we speak to candidates in interviews, one of the first questions is always about our server stack. The answers to this question has changed pretty dramatically over time. This is part of a series on the evolution of our server stack at Metric Collective.</em></p><p>I started working with the Metric team back in early 2012 (before we called it Metric). I was the only developer and I had inherited an application written in PHP. I suppose it would be more accurate to say <strong>it was a really complicated WordPress template.</strong></p><p>It ran on a shared virtual server with C-Panel. Careful use of FTP was our “deployment pipeline.” A lot of people can relate to that painful workflow. It’s pathologically unsustainable for anything but individual developers working on pet projects.</p><h4><strong>Why would somebody do this to themselves?</strong></h4><p>There was a time in history when WordPress-based websites were a very popular choice, even for websites that didn’t resemble blogs. The ability to use WordPress as a CMS was really appealing to freelance developers, who could build custom page templates and then hand off the small tasks of editing those pages’ content to their clients.</p><p>Installing Wordpress at this time was one of the simpler ways to get started with a fully-functional website, given the ubiquity of ready-made shared servers running PHP directly from the filesystem. You could just download the WordPress zip, edit a few settings, and upload it over FTP.</p><p>The vast array of plugins were also very appealing. Granted, they never worked quite right in that highly specialized custom page template. They also were written by morons and full of security holes. Oh, and their choice to build FTP plugin downloads into the admin ensured you could <em>never</em> use proper version control.</p><p>Still, there were (and still are) entire dev shops still dedicated to this type of development. I’ll admit that I paid for a good chunk of my college tuition doing freelance jobs from Craigslist described as “just one small thing” on people’s WordPress sites.</p><p>I can attest: It was never quite one small thing.</p><h4><strong>How was this whole mess architected?</strong></h4><p>The key to hacking WordPress to serve a purpose wildly different from what it was designed to do consists of a three-prong strategy:</p><ul><li><strong>Custom Post Types: </strong>The objects in your data model become custom post types. They typically have some meaningful body content, for which the WordPress WYSIWYG editor comes in handy.</li><li><strong>Post Metadata: </strong>Wordpress allows you to define arbitrary key-value pairs in what is essentially a naive Entity-Attribute Store. You need to specify <em>reasonable</em> key names to use on your custom post types, so that you can use them in your custom templates. Bear in mind: your non-technical users will need to memorize these names.</li><li><strong>Custom Templates: </strong>This is where the magic really happens. Since PHP templates are in fact executable PHP files, you can stuff a whole lot of logic into the top of them. You can use the post’s metadata and content to succeed at implementing a surprising amount of functionality.</li></ul><p>This leads to an absurd mess of spaghetti “code”, with substantial chunks of the business logic ultimately living in either php or directly in the database. As a result, it essentially prevents any type of local or staging deployments. You get a real stiff spine for “pushing” directly to production.</p><h4>Is WordPress to blame?</h4><p>Anybody who knows me knows that I have no love for WordPress. I think that they made some major mistakes in their architecture, but it’s important to remember that it was written in a different time and for a particular purpose.</p><p>The project began in 2003 and I cannot understate its significance. It is an incredibly successful and pervasive open-source project. It helped define a generation of Bloggers, and ensured true ownership over content published online (<em>unlike some publishing platforms that shall remain unnamed</em>).</p><p>The WordPress Foundation claims that WordPress powers 23% of the internet to this day. I don’t know how they measured that, but I wouldn’t doubt it. I also think that number was probably much higher in 2008.</p><p>Nearly every developer who came up during that time has at least a few (horror) stories about working on WordPress sites. I like to say <strong>these poor souls are suffering from WPTSD</strong>.</p><p>All this being said, I don’t think that WordPress is to blame for the way it was often abused. It was designed as a blogging platform, not a full-on CMS, and it accomplished that goal swimmingly.</p><p>But as they say, when all you have is a hammer, everything starts to look like a nail, and WordPress is the embodiment of that aphorism. The problem came from overuse of the platform to behave like a general-purpose CMS, and even more egregiously, <em>a general-purpose database</em>.</p><h4><strong>So where did we go from there?</strong></h4><p>As soon as I started working at Metric, my primary goal had been to migrate us off of WordPress (except for the actual blog part, that is). Additionally, I had some bad blood for PHP in general, and I preferred to work in Python, so <a href="https://tech.metriccollective.com/the-aws-days-5055908ea4c4">thus began our journey into the world of AWS</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o3ZErqknp0DTcAa-QgVUKw.jpeg" /><figcaption>Ugh so sick of purple.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48672c191069" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metric-tech/wptsd-wordpress-traumatic-stress-disorder-48672c191069">WPTSD: WordPress Traumatic Stress Disorder</a> was originally published in <a href="https://medium.com/metric-tech">Metric Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Ace Your Technical Interviews]]></title>
            <link>https://medium.com/metric-tech/how-to-ace-your-technical-interviews-60a677aca607?source=rss-eb8ddc567d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/60a677aca607</guid>
            <category><![CDATA[mutual-promotion]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[videos]]></category>
            <dc:creator><![CDATA[Kevin J. Dolan]]></dc:creator>
            <pubDate>Thu, 28 Jul 2016 13:39:21 GMT</pubDate>
            <atom:updated>2016-07-28T15:14:27.193Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I used to interview recreationally for Engineering Jobs from time-to-time, and at Metric, I’ve conducted plenty over the past few years. This is </em><a href="https://tech.metriccollective.com/the-tricks-work-in-technical-interviews-as-long-as-you-are-competent-73c501ea177b"><em>part</em></a><em> of a </em><a href="https://tech.metriccollective.com/take-home-tests-are-just-awful-c96efc15fd47"><em>series</em></a><em> about some of the </em><a href="https://tech.metriccollective.com/rote-memorization-is-only-kinda-required-in-technical-interviews-e3bc48526b43"><em>things I’ve learned</em></a><em> doing that.</em></p><p>The folks over at Devpost read <a href="https://tech.metriccollective.com/there-are-only-a-handful-of-technical-questions-for-interviews-43df7c63e427#.pypfttk3p">my article on Technical Interview Questions</a>, and asked me to say a few words on the subject as part of their podcast [SIC], <a href="http://commit.devpost.com/">Devpost Commit</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FGBp0yIdJtUk%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DGBp0yIdJtUk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FGBp0yIdJtUk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/58237158e3db2584a4c70b40e024e4a3/href">https://medium.com/media/58237158e3db2584a4c70b40e024e4a3/href</a></iframe><p>As is fitting with these types of arrangements, it’s now our responsibility to help proliferate views by <a href="https://twitter.com/hellometric">posting the video</a> to all of our <a href="http://instagram.com/metriccollective/">social media channels</a>, Medium being one of those.</p><p>So check out the video, click like, leave super positive comments, like this post, share it with your friends, tweet at us, do whatever you do on Pinterest, make fun of my shirt on Reddit, txt me cat facts, add the Metric team to your Christmas Card list — you know, the usual.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QxnW4KkstNhLp2G2yOiMEQ.jpeg" /><figcaption>Like interview questions, there are also only a handful of colors.</figcaption></figure><p><a href="https://www.metriccollective.com/"><em>Metric Collective</em></a><em> is a holding company based in NYC that both </em><a href="http://www.forbes.com/sites/alexkonrad/2016/06/06/metric-collective-the-startup-landing-spot/"><em>acquires existing companies and builds new ones from scratch</em></a><em>, mostly focusing on tools that support the SMB space. If you enjoyed our shamelessly self-promoting dev blog and want to talk about opportunities at Metric, </em><a href="/service/mailto:kevin@metriccollective.com"><em>email me</em></a><em>, or read more stuff by the business weenies at </em><a href="https://musings.metriccollective.com/"><em>Metric Musings</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60a677aca607" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metric-tech/how-to-ace-your-technical-interviews-60a677aca607">How to Ace Your Technical Interviews</a> was originally published in <a href="https://medium.com/metric-tech">Metric Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Take-Home Tests are Just Awful!]]></title>
            <link>https://medium.com/metric-tech/take-home-tests-are-just-awful-c96efc15fd47?source=rss-eb8ddc567d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/c96efc15fd47</guid>
            <category><![CDATA[recruiting]]></category>
            <category><![CDATA[hiring]]></category>
            <category><![CDATA[interviewing]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Kevin J. Dolan]]></dc:creator>
            <pubDate>Mon, 18 Jul 2016 03:07:29 GMT</pubDate>
            <atom:updated>2016-10-10T19:07:38.604Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I used to interview recreationally for Engineering Jobs from time-to-time, and at Metric, I’ve conducted plenty over the past few years. </em><a href="https://tech.metriccollective.com/tagged/interview"><em>This is part of a series about some of the things I’ve learned doing that</em></a><em>.</em></p><p>At any scale of hiring volume, you need to do whatever you can to make your process more efficient. If, like Metric, your top engineers are the ones running interviews, wasting as little of their time as possible on unqualified candidates means more time spent building great products.</p><p>At Metric Collective, we track a metric we call CCHPH, Core-Contributor-Hour per Hire, which helps us to analyze the overhead recruiting has on our day-to-day development. Essentially, it tracks the total amount of time spent by all core contributors (those whose primary job is not hiring) asked to be involved in the recruiting process for each role filled. For Junior Engineer positions, our CCHPH is around 45 hours, and for Senior Engineer positions, our CCHPH is nearly 60.</p><p>One tool companies often turn to is the hands-off take-home test. Sometimes it’s slotted in after a brief phone screen, sometimes it’s a prerequisite to applying, and sometimes it’s distributed to external recruiting agencies who are responsible for administration. Most commonly, the take-home test consists of some small set of hypothetical problems, ranging from procedural to application-level, for which code solutions should be provided.</p><p>In theory, take-home tests offer a myriad of benefits. If somebody is unable or too lazy to complete the test, why bother wasting precious engineer time on interviewing them? It also gives candidates the opportunity to program in a setting which is certainly more ecologically valid than in-person code tests, since they can sit at their own desk, use available online resources, listen to their own music, and work at their own most natural pace.</p><p>When we asked some of our peers that use take-home tests, the mere completion of the problem set is the biggest filter. They argue that the ones who cannot complete the task simply self-select out, but for whatever reason, most programmers who submit a solution are at least invited in for the next step. At that point, the best interviewers will have read through their solutions, and they will reference decisions made as part of the vetting process. Unfortunately, in my experience interviewing, most don’t even know what the problem set was about.</p><p>The basic theory is that by using a filter that doesn’t require substantial time investment on the part of your core contributors, their interviewing effort is focused on candidates who are likely to lead to employees, reducing CCHPH (whether or not you actually track that stat).</p><p>The problem, as we have found experimenting with Take-Home Tests at Metric, is that while they do indeed act as an effective filter, the qualities they are filtering for don’t seem to align with the qualities we’d like to hire for. While they do seem somewhat effective for entry-level roles, they have proven highly counter-productive for more senior roles.</p><p>Metric is a unique experiment in company-building that doesn’t fit neatly in any particular category. This is the primary reason why <a href="https://tech.metriccollective.com/">this tech blog</a> even exists: to increase awareness and help provide information to potential candidates. When I do phone screens, <a href="https://musings.metriccollective.com/so-youre-about-to-come-into-metric-collective-for-an-interview-27fc3bbd0f8e">not only do I have to explain what Metric is, but I have to explain the very concept of a Holding Company</a>. We don’t get a lot of cold in-bounds, so a lot of our hiring is done using highly-targeted out-bounds to candidates. Some of these assumptions might be different for larger companies with brand names that see a higher level of unfiltered in-bound volume.</p><p>There is high competition for the caliber of candidates recruit. On average, the candidates we talk to are weighing Metric against 8 other companies. Often one of those other companies is a role they currently occupy. We hire a very small percentage of applicants, so if we extend an offer, our assumption is that most of the other companies will also make an offer. We spend as much (or sometimes more) time in the recruiting process (mutually) evaluating whether Metric is the right place for a candidate to work as we do vetting their programming chops.</p><p>Since we mostly do out-bounds, the natural place for a take-home test would be after a brief phone screen. This would give us at most 15 minutes to convince somebody that the mere privilege of being considered for a position at Metric is worth a few hours of their time, spent on a hypothetical toy that nobody will ever use! You can imagine why many qualified candidates elect to decline that gracious proposal. For candidates who aren’t actively looking, who already spend 10–12 hours a day programming, the odds are even slimmer. For junior engineer roles, less than 25% of the candidates who were asked elected to complete take-home tests; for senior roles it was less than 10%.</p><p>So, by administering take-home work, we’ve filtered out a lot of top-tier talent — the ones that have the widest array of alternative options. But as Google ordained, we’d rather reject good engineers than let bad ones in, so what about the candidates that make it though? Surely they must be qualified.</p><p>Surprisingly, the idea that incompetent engineers self-select out of the pool is incorrect. When we tried take-home tests, the number of solutions that were submitted which were entirely non-functional, humorously incorrect, or otherwise unpalatable was appalling. Even when we provided explicit acceptance criteria and verification scripts, candidates still submitted highly incorrect work! The percentage of solutions we accepted as correct was less than 20%. It’s unclear whether this was due to true incompetence, or simply inadequate effort.</p><p>So it’s shocking to me that so many companies simply use completion of the problem set as their filter, and so few of our peers reference the solutions during the interviews. That being said, maybe we can still use correctness of the problem set to filter down to good candidates.</p><p>In the interest of science, we then had four groups of candidates to invite in for interviews:</p><ol><li>Those who were asked but did not complete the work</li><li>Those who completed the work, but whose solutions were not good</li><li>Those who completed the work, and whose solutions were good</li><li>Those not asked to complete take-home work</li></ol><p>Unsurprisingly, most candidates from group 1 did not choose to move to the next step. It was a bit of a weak-looking capitulation to ask somebody to complete take-home work, and then turn around and say, “Actually, on second thought, you don’t need to do that.” We had a really hard time crafting those emails, and most were either ignored or politely declined.</p><p>Between groups 2 and 3, we saw no significant differences in their interview performance on interactive in-person hypotheticals, our preferred technical interview tool.</p><p>There were people in group 2 who, when challenged about why they had failed to provide correct solutions, came back with meaningful explanations, interesting interpretations, and were able to come up with better alternatives on the spot.</p><p>We considered this to be a really strong quality, as it indicates humility in their work, and the ability to generate alternatives when faced with challenges. It’s still a red-flag they were willing to submit incorrect work in the first place, but we generally saw elegant handling of our criticism to be a positive thing.</p><p>There was also an alarming number of people in group 3 who, when asked about how they approached the take-home work, were unable to explain their solutions. We couldn’t tease out the real reason, since most candidates simply waffled on their explanations, but two admitted to asking for help.</p><p>This brings me to one of my biggest concerns with Take-Home Tests: that solutions aren’t necessarily being authored by the candidates themselves. On three distinct occasions at Metric, our engineers have been Nerd-Sniped by some friend who asked for help on a take-home test, which leads to our entire team competing for the best and most interesting solution. So whichever interviewers got the pleasure of reviewing those solutions, what they were really evaluating was the combined effort of Metric’s best and brightest (I sure hope they made the grade…) Additionally, with many companies sharing hypothetical problems, it’s all-too-easy to find a ready-made solution online.</p><p>The most important observations, however, was that we found we made offers to people who were not asked to do take-home tests at around a 50% higher rate than people who completed the take-home tests — based primarily on performance on our go-to hypotheticals.</p><p>I think these results stem primarily from the simple fact that the candidates we consider to be great candidates are desirable to other companies as well. It’s just too much to ask of these great candidates to toil away at take-home tests when they can just as easily line up interviews with other companies that don’t ask for them.</p><p>I believe that it’s possible that larger brand name companies may find some value in using take-home tests to do first-layer filter, but I have major doubts due primarily to the authorship problems I mention above.</p><p>Overall, the Metric stance is that we do not use take-home tests right now. As we grow and people become more aware of Metric, we may need to re-evaluate them as an interview tool, but we’ve got a pretty bad taste in our mouths about them as it stands.</p><h4>A Quick Note on Validity</h4><p>Metric is a small company, so we don’t have the capacity to perform statistically meaningful studies on the effectiveness of recruiting mechanisms, like those at Google or Facebook does. Even then, measuring actual outcomes in this field are notoriously difficult, typically relying on managerial feedback and career success, all of which can be politics-driven rather than truly performance-driven.</p><p>Further, the ecological validity of any conclusions large companies draw likely do not apply for small companies, since they operate in such a wildly different recruiting environment.</p><p>The best bet we have, as a community of non-behemoths, is unfortunately small-sample statistics, and anecdotal evidence collected from our peers (including blog posts, like this one and the thousands like it). This type of peer-driven evidence is necessarily colored by the reasons for sharing the evidence, so it all needs to be taken with a grain of salt.</p><p>We’d love to be able to tap into some of the stats that recruiting agencies and other startups have access to, so together we can learn more about what works and what doesn’t, so if anybody is interested in working together on data analysis, <a href="/service/mailto:kevin@metriccollective.com">email me</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zBf29d3bGzERC6SJRrN36Q.jpeg" /><figcaption>I just flew in from Chicago and boy are my arms limbs.</figcaption></figure><p><a href="https://www.metriccollective.com/"><em>Metric Collective</em></a><em> is a holding company based in NYC that both </em><a href="http://forbes.com/sites/alexkonrad/2016/06/06/metric-collective-the-startup-landing-spot/"><em>acquires existing companies and builds new ones from scratch, mostly focusing on tools that support the SMB space</em></a><em>. If you enjoyed our shamelessly self-promoting dev blog and want to talk about opportunities at Metric, </em><a href="/service/mailto:kevin@metriccollective.com"><em>email me</em></a><em>, or read more stuff by our business weenies at </em><a href="https://musings.metriccollective.com/"><em>Metric Musings</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c96efc15fd47" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metric-tech/take-home-tests-are-just-awful-c96efc15fd47">Take-Home Tests are Just Awful!</a> was originally published in <a href="https://medium.com/metric-tech">Metric Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Slash Your Google Cloud Pub/Sub Bill With This One Weird Trick!!!]]></title>
            <link>https://medium.com/metric-tech/slash-your-google-cloud-pub-sub-bill-with-this-one-weird-trick-495021996373?source=rss-eb8ddc567d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/495021996373</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[the-cost-of-things]]></category>
            <category><![CDATA[pub-sub]]></category>
            <category><![CDATA[messaging]]></category>
            <dc:creator><![CDATA[Kevin J. Dolan]]></dc:creator>
            <pubDate>Fri, 15 Jul 2016 15:36:25 GMT</pubDate>
            <atom:updated>2016-07-17T00:48:22.692Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*eKFZQAnnADEVbeRSFtKsnA.jpeg" /></figure><p><em>Clearly, I know how to write blogspam headlines and garbage content.</em></p><p>We’ve been using Google Cloud Pub/Sub at Metric to manage messages for our <a href="https://medium.com/metric-tech/what-we-learned-writing-expandable-sql-etls-from-all-of-our-schemaless-data-d53d34725bab#.f2iknpu8s">Data Warehouse ETLs</a>. The billing for it is pretty transparent, prices in the tens of cents per millions of messages. We didn’t think much of it in estimating our costs, and focused more on the computational and network resource costs we’d incur. <strong>Boy, were we wrong!</strong></p><p>Because we were sending hundreds of billions of teeny tiny messages for all of our pedantic logs, we found ourselves with an unexpected high rate of cost bloat. Because Pub/Sub doesn’t natively offer automated fan-in style routing, we had numerous worker layers that did nothing but route messages and incur cost.</p><p>As with many problems along our ETL pipeline, the solution to this problem came down to chunking inputs. If you are sending a high volume of very small messages, and each of those messages represent small amounts of idempotent work, combining messages into chunks can be a huge win in terms of cost.</p><p>Message payloads can be as large as 10MB in length, but unfortunately, Google explodes the cost of messages in 64KB increments, so if you have a message that’s 128KB in length, it counts as 2 messages for billing purposes. Still, since our mean message length was less than a KB in length, we were able to reduce our bill by a factor of about 64 through chunking.</p><p>An added bonus was that it also led to higher overall throughput, unexpectedly, reducing the overall number of requests required to pull and acknowledge messages substantially. It also slightly improved memory usage by some mechanism we are not currently clear on (likely relating to parsing internals).</p><p>I suspect similar techniques would also be valuable for Amazon SQS and other cloud messaging providers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jRZqX2OLC6nB30_dPz4MpA.jpeg" /><figcaption>Oh no, the first repeat.</figcaption></figure><p><em>Metric Collective is a holding company based in NYC that both acquires existing companies and builds new ones from scratch, mostly focusing on tools that support the SMB space. If you enjoyed our shamelessly self-promoting dev blog and want to talk about opportunities at Metric, </em><a href="/service/mailto:kevin@metriccollective.com"><em>email me</em></a><em>, or read more stuff by the business weenies at </em><a href="https://musings.metriccollective.com/"><em>Metric Musings</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=495021996373" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metric-tech/slash-your-google-cloud-pub-sub-bill-with-this-one-weird-trick-495021996373">Slash Your Google Cloud Pub/Sub Bill With This One Weird Trick!!!</a> was originally published in <a href="https://medium.com/metric-tech">Metric Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Number of External Javascripts on ProductHunt Websites Will Shock You!]]></title>
            <link>https://medium.com/metric-tech/the-number-of-external-javascripts-on-producthunt-websites-will-shock-you-974890a312c?source=rss-eb8ddc567d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/974890a312c</guid>
            <category><![CDATA[attack-vector]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Kevin J. Dolan]]></dc:creator>
            <pubDate>Fri, 15 Jul 2016 13:54:06 GMT</pubDate>
            <atom:updated>2016-09-06T17:01:12.300Z</atom:updated>
            <content:encoded><![CDATA[<p><em>These results shouldn’t be shocking to anybody; I’m just experimenting with click-bait headlines, which I hear are all the rage in </em><a href="https://www.metriccollective.com/"><em>corporate-sponsored</em></a><em> dev blogs.</em></p><p>Last time, we discussed <a href="https://medium.com/metric-tech/of-course-ill-let-you-execute-arbitrary-javascript-code-in-my-users-browsers-3032eca3480e#.z0nfsgdka">some of the potentials risks of injecting arbitrary third party resources onto your website</a>. To demonstrate the widespread acceptance of the vector, we ran an analysis of websites featured on ProductHunt going back a full year.</p><p>We ran a Python script that pulled links for each product featured on ProductHunt from the API, and then invoked a PhantomJS shell to record all of the resources loaded, along with their origin domain and mime-type.</p><p>Of course, there are plenty of secure use-cases for loading resources from external origins, in particular delivering assets via CDNs, leveraging internal and external APIs, and ad delivery / tracking. That being said, a large number of origins is a bit of a smell and the blind acceptance of the practice likely represents a real security risk.</p><p>We did our best to eliminate products that weren’t websites, and pruned domains that showed up more than 8 times, as most of these represented shared platforms of one type or another. Overall, we sampled 6,729 webpages.</p><p>Of these, slightly more than half were still sending information over the wire without HTTPS. This really isn’t the place to discuss why that’s a problem; I will point out that it’s a good opportunity for anybody along the network path (looking at you, skeevy coffee shops) to exercise full control over the page. At that point, they can instrument whatever scripts they want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ESjW8BXXvNqrYeAoB-MV_g.png" /><figcaption>Schemes used to load the landing page</figcaption></figure><p>When it comes to loading resources, ProductHunters seem to love doing it. <strong>The mean number of resources loaded was 101.4</strong> (including images, javascript, css, xhr, and so on), with a median of 81. This sheer number really just increases the number of round-trips. There’s plenty of justifiable reasons for high numbers here, but the general wisdom is that reducing these will improve performance. <em>See Appendix A for the top 10 offenders.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IHzptvoRw3BFnXPcskFTuw.png" /><figcaption>Histogram of total number of resources loaded on the page</figcaption></figure><p>As far as JavaScripts go, we found there were a wide variety of mime-types people used to indicate Javascript as the desired format, so we filtered down to just those. <strong>The mean number of Javascripts loaded was 24.6</strong>, with a median of 18. That’s a lot higher than I would have hoped, but makes sense in a world where using many Javascript files with fancy requirement management libs is fairly common. My preference is generally to reduce these round-trips by using monoliths, but I guess I’m just old-school. <em>See Appendix B for the worst offenders.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZTx0LRcOKhe_Hp0HLrRsg.png" /><figcaption>Histogram of total number of Javascripts loaded per page</figcaption></figure><p>Now for the juicy security risks, external resources. Shockingly, <strong>the mean number of origins from which resources were loaded per page was a whopping 11.75</strong>, with a median of 9.0. <em>See Appendix C for the worst offenders.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NzksZl8QIDcwfpZq8oVLdw.png" /><figcaption>Histogram of the distinct number of origins loaded per page</figcaption></figure><p>Appallingly, <strong>188 (2.7%)of them are serving mixed-security content</strong> (their webpage is served over HTTPS, but they load some HTTP content)!</p><p>These external origins will certainly leak information, but can’t necessarily subvert the page running them. The bigger concern I have is external JS, which essentially means you are trusting a third party with total control over your website.</p><p>The mean number of distinct javascript origins loaded was quite high at 5.9, with a median of 5. In other words, <strong>on average, websites featured on ProductHunt trust 6 distinct parties with full control over their websites!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PSxkFuoQb8Bzg21fOV500g.png" /><figcaption>Histogram of the distinct number of origins for Javascript content loaded per page</figcaption></figure><p><strong>Only 418 (6.2%) served JS from a single origin</strong>, and only 298 (4.4%) served no JS at all. The worst offender of the entire set was serving JS from 47 origins. More than half of the sites (52%) served JS from at least 5 origins, and <strong>18% of the websites tested served JS from at least 10</strong>!</p><p><em>A quick aside on methodology here: we measured resource loads using PhantomJS, which would consider JS loaded inside iframes in addition to the top-level page. If the iframe origin is different than the top-level origin, these Javascripts can’t control the page, so are less of a risk.</em></p><p>So where are all these JavaScripts coming from and what are they being used for? Unsurprisingly, <strong>Google Analytics is the king of reach, present on 84% of the websites tested</strong>. <em>For the top 25, see Appendix E.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ttAfM6bjIYSJHFPyuvwV8A.png" /><figcaption>Top 10 foreign JS origins by reach</figcaption></figure><p>I manually tagged the top 50 JS origins based on the type of function the origin was serving. This doesn’t really paint a full picture, as this covers only 17% of all Javascript origins analyzed, <em>but I do have a day job after all.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yJNp4OtUeDM4WpxEH8SJKQ.png" /><figcaption>Count of external JS resources by function</figcaption></figure><p>By far, the most common category was analytics. It’s also interesting to use these to rank the top analytics companies (Appendix F). I distinguished tracking from analytics for things that are designed to track users for specific advertising or affiliate purposes, rather than open-ended analysis.</p><p>For the <em>resource</em> category, I defined that as CDNs built to serve static resources for c<em>ommon libraries that you should really just be hosting yourself. </em>The code.jquery.com CDN was used on 6.5% of sites, and maxcdn.bootstrapcdn.com was used on 3.7%. The fact that people do this has always felt like a major risk to me. Sure, it helps working through a getting-started tutorial faster, but it’s just unnecessary risk for production purposes.</p><p>I’d like to call out two particularly pathological snippets, Google Tag Manager and AdRoll, because they have a tendency to lead to substantial bloat in the number of distinct origins loaded.</p><p>Google Tag Manager is a wonderful tool that helps to define specific rules by which various pixels and trackers can be invoked, triggered by page loads or other on-site events, filterable by numerous features, and managed via web admin. It takes a lot of those “drop this pixel when somebody adds this to their cart” type issues off of developers’ plates, so I’m a big fan. That being said, when it’s managed by non-developers, the risk for using it to inject malicious or wasteful resources increases substantially. It ultimately provides the ability to inject arbitrary resources (including JS), and those injections are often being managed by people who don’t even understand that there is a risk in doing so.</p><p><strong>AdRoll, in my totally accurate and infallible opinion, is utter garbage.</strong> As far as I can tell, all it does is inject as many retargeting pixels as possible from as many third party networks as it can cobble together, and then resells the real estate at a premium. We’ve experimented with it from time to time, and we saw nothing but lackluster results at the cost of substantial impact to our overall site performance.</p><p>We segmented the data by sites that contain either of these snippets to see the impact it had on the inclusion of distinct origins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wgOHe2kWkgi9f5Hd4Bk8lQ.png" /><figcaption>Distinct Origins for Sites with GTM and AdRoll</figcaption></figure><p><strong>Sites with AdRoll loaded, on average, 2.6 times the number of external Javascript resources as sites without it</strong>, and sites with Google Tag Manager loaded 2.2x sites without. Sites with both did not fare much worse than sites with just AdRoll. <em>Granted, this is correlational, and could also be a statement about the function of sites that would benefit from either GTM or AdRoll.</em></p><p>One of our readers was kind enough to point out that the Quantcast tracking script should also have a similar impact. We ran a quick test and though the sample size was low with only 2% coverage of the sites tested, sites with the Quantcast pixel loaded 2.7x the number of external JS as sites without.</p><p>I expected to see high numbers of external resources on these webpages, due to the global rise of Glue Developers, who see every problem as being most effectively solved by tacking on additional libraries. Admittedly, using ProductHunt as a data set probably biases towards those types, but I really was shocked at some of the more egregious cases I observed.</p><p>Loading external resources obviously isn’t a death sentence, and there are plenty of totally valid use-cases for doing so. The alarm I’m trying to sound relates to the rise in blind acceptance of the practice.</p><p>How many of these external resources are being managed by companies with no dedicated security teams? How can we trust that <em>even if</em> the companies intend to behave well (that’s a mighty if), that they‘re impervious to being compromised?</p><p>Serving web-pages and resources over HTTP introduces even greater risk to the problem, potentially leaking information as well as risking subversion. This practice was much more common that I had come to expect. These days, there is no excuse for serving content over HTTP with free services like <a href="https://letsencrypt.org/">Let’s Encrypt</a> and server software that offers HTTPS out of the box!</p><p><a href="https://www.metriccollective.com/">Metric</a> doesn’t get off scot-free here. Like most companies that aren’t Google, we don’t have infinite resources, and these all-to-easy snippets often <em>seem </em>to solve problems quickly. We do our best to vet the third parties we let in, and we only do it when it’s absolutely necessary. We also usually draw up a plan for decommissioning them at a later date when we can in-house the features they provide.</p><p>I hope things improve, but I doubt they will. Perhaps we should all just pivot to stealing credit cards and call it a day.</p><h4>Appendix A: Most resources loaded overall</h4><blockquote>1) <a href="http://everynoise.com/spotify_new_releases.html?ref=producthunt">http://everynoise.com/spotify_new_releases.html</a>: 4746<br>2) <a href="https://www.hamsterpad.com/slack-news-feed?ref=producthunt">https://www.hamsterpad.com/slack-news-feed</a>: 3141<br>3) <a href="https://soundcloud.com/bon-entendeur-music?ref=producthunt">https://soundcloud.com/bon-entendeur-music</a>: 2851<br>4) <a href="http://megamoji.muan.co/?ref=producthunt">http://megamoji.muan.co/</a>: 1786<br>5) <a href="https://zapier.com/zapbook/code/?ref=producthunt">https://zapier.com/zapbook/code/</a>: 1558<br>6) <a href="https://www.raspberrypi.org/blog/raspberry-pi-zero/">https://www.raspberrypi.org/blog/raspberry-pi-zero/</a>: 1404<br>7) <a href="https://www.autonomous.ai/smartdesk-business-class-standing-desk-height-adjustable">https://www.autonomous.ai/smartdesk-business-class-standing-desk-height-adjustable</a>: 1348<br>8) <a href="https://www.autonomous.ai/smartdesk-business-class-standing-desk-height-adjustable">https://www.autonomous.ai/smartdesk-business-class-standing-desk-height-adjustable</a>: 1324<br>9) <a href="http://slackmojis.com/?ref=producthunt">http://slackmojis.com/</a>: 1262<br>10) <a href="https://www.raspberrypi.org/blog/raspberry-pi-3-on-sale/?ref=producthunt">https://www.raspberrypi.org/blog/raspberry-pi-3-on-sale/</a>: 1102</blockquote><h4>Appendix B: Most javascript files loaded overall</h4><blockquote>1) <a href="https://codefights.com/bots/bot_uber?ref=producthunt">https://codefights.com/bots/bot_uber</a>: 226<br>2) <a href="https://code.nasa.gov/?ref=producthunt#/">https://code.nasa.gov/</a>: 204<br>3) <a href="https://www.sceelix.com/?ref=producthunt">https://www.sceelix.com/</a>: 192<br>4) <a href="http://www.proactiv.com/on/demandware.store/Sites-Proactiv-Site/default/Home-Show?cgid=shaveclub-campaign&amp;ref=producthunt">http://www.proactiv.com/on/demandware.store/Sites-Proactiv-Site/default/Home-Show?cgid=shaveclub-campaign</a>: 190<br>5) <a href="http://publishdrive.com/?ref=producthunt">http://publishdrive.com/</a>: 190<br>6) <a href="https://angel.co/2015?ref=producthunt">https://angel.co/2015</a>: 178<br>7) <a href="https://blogbeats.me/?ref=producthunt">https://blogbeats.me/</a>: 170<br>8) <a href="https://www.bbc.co.uk/weatherwatchers/?ref=producthunt">https://www.bbc.co.uk/weatherwatchers/</a>: 166<br>9) <a href="http://www.nativeunion.com/clic-360?ref=producthunt">http://www.nativeunion.com/clic-360</a>: 158<br>10) <a href="https://angel.co/track?ref=producthunt">https://angel.co/track</a>: 154</blockquote><h4>Appendix C: Most distinct origins overall</h4><blockquote>1) <a href="http://www.techinsider.io/">http://www.techinsider.io/</a>: 110<br>2) <a href="http://www.microsoft.com/surface/en-us/devices/surface-book">http://www.microsoft.com/surface/en-us/devices/surface-book</a>: 107<br>3) <a href="http://www.tvland.com/">http://www.tvland.com/</a>: 105<br>4) <a href="http://www.rightrelevance.com/ph">http://www.rightrelevance.com/ph</a>: 103<br>5) <a href="http://heidi.deviantart.com/journal/Introducing-Sketch-This-Daily-Drawing-Challenges-567929936">http://heidi.deviantart.com/journal/Introducing-Sketch-This-Daily-Drawing-Challenges-567929936</a>: 88<br>6) <a href="http://decider.com/">http://decider.com/</a>: 83<br>7) <a href="https://www.gramovox.com/products/floating-record">https://www.gramovox.com/products/floating-record</a>: 80<br>8) <a href="https://getbevel.com/trimmer">https://getbevel.com/trimmer</a>: 78<br>9) <a href="http://www.jansport.com/shop/en/jansport-us/digital-burrito-pouch-t69f">http://www.jansport.com/shop/en/jansport-us/digital-burrito-pouch-t69f</a>: 77<br>10) <a href="http://lvwrkpl.com/products/hyper-glass">http://lvwrkpl.com/products/hyper-glass</a>: 73</blockquote><h4>Appendix D: Most distinct Javascript origins</h4><blockquote>1) <a href="http://decider.com/">http://decider.com/</a>: 47<br>2) <a href="https://www.gramovox.com/products/floating-record">https://www.gramovox.com/products/floating-record</a>: 47<br>3) <a href="http://www.techinsider.io/">http://www.techinsider.io/</a>: 46<br>4) <a href="http://www.iconery.com/">http://www.iconery.com/</a>: 34<br>5) <a href="https://www.criquetshirts.com/">https://www.criquetshirts.com/</a>: 31<br>6) <a href="http://www.tvland.com/">http://www.tvland.com/</a>: 31<br>7) <a href="http://heidi.deviantart.com/journal/Introducing-Sketch-This-Daily-Drawing-Challenges-567929936">http://heidi.deviantart.com/journal/Introducing-Sketch-This-Daily-Drawing-Challenges-567929936</a>: 31<br>8) <a href="http://shopsoko.com/collections/soko-x-pop">http://shopsoko.com/collections/soko-x-pop</a>: 31<br>9) <a href="https://www.autonomous.ai/smartdesk-business-class-standing-desk-height-adjustable">https://www.autonomous.ai/smartdesk-business-class-standing-desk-height-adjustable</a>: 30<br>10) <a href="http://www.proactiv.com/on/demandware.store/Sites-Proactiv-Site/default/Home-Show?cgid=shaveclub-campaign&amp;ref=producthunt">http://www.proactiv.com/on/demandware.store/Sites-Proactiv-Site/default/Home-Show?cgid=shaveclub-campaign</a>: 30</blockquote><h4>Appendix E: Top JS origins by reach</h4><blockquote>1) <a href="http://www.google-analytics.com/">www.google-analytics.com</a>: 5133<br>2) connect.facebook.net: 2152<br>3) ajax.googleapis.com: 1592<br>4) platform.twitter.com: 1056<br>5) <a href="http://www.googletagmanager.com/">www.googletagmanager.com</a>: 733<br>6) use.typekit.net: 713<br>7) s.ytimg.com: 697<br>8) <a href="http://www.googleadservices.com/">www.googleadservices.com</a>: 682<br>9) <a href="http://www.google.com/">www.google.com</a>: 680<br>10) cdn.mxpnl.com: 669<br>11) cdnjs.cloudflare.com: 621<br>12) ssl.google-analytics.com: 577<br>13) static.doubleclick.net: 539<br>14) cdn.optimizely.com: 499<br>15) code.jquery.com: 437<br>16) js-agent.newrelic.com: 402<br>17) cdn.segment.com: 392<br>18) js.intercomcdn.com: 369<br>19) static.hotjar.com: 313<br>20) load.sumome.com: 307<br>21) analytics.twitter.com: 306<br>22) script.hotjar.com: 293<br>23) apis.google.com: 275<br>24) <a href="http://www.youtube.com/">www.youtube.com</a>: 268<br>25) static.xx.fbcdn.net: 263</blockquote><h4>Appendix F: Top analytics products based on reach</h4><blockquote>1) Google Analytics: 84%<br>2) Mixpanel: 9.9%<br>3) NewRelic: 5.9%<br>4) Segment.io: 5.8%<br>5) HotJar: 4.6%<br>6) SumoMe: 4.5%<br>7) Heap Analytics: 2.5%<br>8) HubSpot: 2.1% (Arguably…)<br>9) CrazyEgg: 1.9%</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oJIHY1eTcdAeuGa4_6Q-kw.jpeg" /><figcaption>Very ugly.</figcaption></figure><p><em>Metric Collective is a holding company based in NYC that both acquires existing companies and builds new ones from scratch, mostly focusing on tools that support the SMB space. If you enjoyed our shamelessly self-promoting dev blog and want to talk about opportunities at Metric, </em><a href="/service/mailto:kevin@metriccollective.com"><em>email me</em></a><em>, or read more stuff by the business weenies at </em><a href="https://musings.metriccollective.com/"><em>Metric Musings</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=974890a312c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metric-tech/the-number-of-external-javascripts-on-producthunt-websites-will-shock-you-974890a312c">The Number of External Javascripts on ProductHunt Websites Will Shock You!</a> was originally published in <a href="https://medium.com/metric-tech">Metric Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Of Course I’ll Let You Execute Arbitrary Javascript Code in My Users’ Browsers]]></title>
            <link>https://medium.com/metric-tech/of-course-ill-let-you-execute-arbitrary-javascript-code-in-my-users-browsers-3032eca3480e?source=rss-eb8ddc567d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/3032eca3480e</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Kevin J. Dolan]]></dc:creator>
            <pubDate>Thu, 14 Jul 2016 21:55:17 GMT</pubDate>
            <atom:updated>2016-09-04T01:07:28.705Z</atom:updated>
            <content:encoded><![CDATA[<p>I did my fair share of contract work before I was CTO of <a href="https://www.metriccollective.com/">Metric Collective</a>, and I can’t tell you how many times I got the request to add a new JS snippet that would change the world. Even when I moved out of the contract world and into full-time development, I continued to get these requests from management. At the time, I didn’t really think much of it; it seemed commonplace.</p><p>My first eye-opener on the subject was one of the first JIRAs I was assigned interning at NextJump. The JIRA was trivial: here’s an Optimize.ly snippet, paste it into the base template. It was easy to add the snippet, I was able to test it out, and it magically worked. I submitted a patch and sent it to QA for approval. I swiftly received this AIM message:</p><blockquote>“Hell no.” — Ominous QA man I never met.</blockquote><p>I was baffled, since I did exactly as I was told. He carefully explained the risks of my patch to me:</p><ul><li>You essentially give up full control over the content of your web page to some unvetted third party. Because Javascript can perform arbitrary manipulations (the thing Optimize.ly is literally designed to do), it’s not your webpage anymore.</li><li>You give full visibility over interactions with your web page to that third party, and possibly others they invite in. This might be as simple as logging that the page view occurred, or as malicious as copying down credit card numbers and sending them over the wire. This includes credential cookies.</li><li>Speaking of credential cookies, if you have an internal admin on the same domain as the snippet, you could leak admin-level credentials to third parties. If they were so inclined, this would be a good vector for hijacking your website. If you use a popular CMS like Wordpress, <em>guess what that means?</em></li><li>Even if you work hard to vet the contents of the injected code as it is written (which is near-impossible, since it is usually highly obfuscated), most of these snippets are served up from foreign origins, so they can simply swap out the Javascript contents from under you. They could even do that for a subset of users, or avoid hijacking traffic that comes from your own geographic region to avoid detection.</li><li>Even resources that don’t execute code (like images) will leak information about the page referrer, allowing for tracking of users across websites that may be undesirable.</li><li>A lot of times, these snippets are delivered over a CDN, but piling more and more requests up on the wire doesn’t do great things for your site’s performance.</li></ul><p>Despite all these problems, the situation today has become far, far worse. The rise of glue developers and out-of-the-box JS solutions has led to commonplace acceptance of the practice of injecting JS with very little forethought for security.</p><p>Do you really trust a one-year-old, four-person startup in Denver with full control over your website? Even if you do trust them, how sure are you that their infrastructure is impervious to subversion?</p><p>Protecting against malicious users from injecting Javascript onto our pages has come along way since the hey-day of XSS attacks in the late 2000’s, and yet we are sitting at our desks, intentionally allowing third parties full control of our webpages.</p><p>Why aren’t more people screaming about this gigantic hole?!</p><p>Thankfully, our resident security expert Adrien was only able to point to one major precedent for this being used as an attack vector: the case of <a href="http://arstechnica.com/security/2015/03/massive-denial-of-service-attack-on-github-tied-to-chinese-government/">Hackers from China hijacking a Baidu analytics tag to DDOS Github</a>. By subverting the insecure HTTP delivery of the script tag through a DNS flaw, they were able to conscript 1% of all users downloading the script into a massive DDOS army. Baidu likely had nothing to do with the attack, but some external party was able to leverage their massive distribution to their own nefarious ends.</p><p>I wonder how many cases of this were less severe and went unnoticed. If anybody knows of any other cases of this leading to an attack, I’d love to hear about it. Please <a href="/service/mailto:kevin@metriccollective.com">email me</a>.</p><p>I’ll admit it, I used this vector for some grey-hat purposes back in my college days. In college, I wrote a <a href="http://jsanim.com/">terrible Javascript animation library</a> that inexplicably became very popular among Spanish-speaking web developers. In order to facilitate onboarding, I offered the library over a public CDN that anybody could use.</p><p>At its peak, the script was being loaded from a few hundred websites and receiving about 100k loads per day. Some of my friends were in a band and they were participating in a local battle-of-the-bands competition for a radio station that featured weekly online votes to move to the next round. Their voting system did nothing to defend against XSRF attacks, but did limit votes to 1 per IP address.</p><p>So naturally, my friends won by a landslide of votes, most of which originated in Latin America.</p><p>It’s clear to see why this is the state we’re in. There are a handful of main categories of client-side JS injections popular these days, each providing a unique and compelling value prop:</p><h4>Ad-Tech</h4><p>The ROAS you can achieve using retargeting are compelling, and successfully running a retargeting campaign means you need to pipe information to some external third party about what people are doing on your site, not only at page-load time, but also as people use your website. Apart from retargeting, ad platforms that offer real-time bidding or intelligent optimizations can benefit from conversion data to learn about which audiences convert best.</p><p>As a publisher, delivering ads and tracking their performance can be a surprisingly sophisticated job. There are so many ad-tech tools that do something cool and integrate with other ad-tech tools in a myriad of (generally hacky) ways. By boiling the implementation task down to just “paste this snippet” during the sales pitch, it’s easy to move the process along.</p><p>Further, project management in the ad-tech space can be at times overwhelmingly dominated by <em>business weenies, </em>who don’t sufficiently understand the risks of the underlying technical decisions being made. Since it’s so easy to make a business case for these tools, and it’s relatively natural to package them as injectable JS, the sales process driving their adoption has been a home-run. Once it’s sold to the higher-ups, there’s not much a developer can do to kill the deal and everybody just hopes the economic arrangement is enough to incentivize the JS-injector to be well-behaved.</p><p>When we experimented with AdRoll on <a href="https://www.franchisehelp.com/">FranchiseHelp</a>, we found that the inclusion of it alone contributed to the injection of resources from 12 distinct origins!!</p><h4>Tracking tags</h4><p>When building analytics tools, that data needs to get piped somewhere else so you can ask questions of it. Google Analytics has been massively successful at achieving reach. We found in <a href="https://tech.metriccollective.com/the-number-of-external-javascripts-on-producthunt-websites-will-shock-you-974890a312c#.ac7lzxms7">an analysis of ProductHunt websites</a>, GA was included on 84% of websites, giving Google an unparalleled view over the entire internet. Allegedly, Google doesn’t use this data for their own purposes, <em>but come on…</em></p><p>At least I trust Google with my life already. Other, newer tools like Kissmetrics and Mixpanel have also been really successful; they offer a really compelling set of features, they’re fast and slick, but I know very little about who is behind these companies.</p><p>At Metric, we’re migrating away from turnkey solutions like these and running more of our own analytics software through the <a href="https://tech.metriccollective.com/what-we-learned-writing-expandable-sql-etls-from-all-of-our-schemaless-data-d53d34725bab">Metric Collector</a> project.</p><h4>Rich APIS</h4><p>Sometimes the features an external JS library provides are rather sophisticated, involving rich sets of components and asynchronous data requests to external services. A great example of these are maps APIs, which have complex mechanisms in place for efficiently loading and rendering tiles.</p><p>Due to the amount of sophistication that would be required to get all of the different pieces in place, leveraging something more full-featured like a JS snippet, which can do essentially whatever it wants, is pretty useful.</p><p>JSON-P APIs also fall into this category, as they allow the injection of arbitrary JS as a means to bypass CORS policies. While the intended purpose is to deliver data, they can be as dangerous as any other type of JS injection.</p><h4>External Embeds</h4><p>The open web has been pretty great at finding ways to syndicate content. You can’t go far without finding an embedded YouTube video inline on your favorite websites. Embeds are used for all sorts of things, like data widgets, content promotion, and so on. Sometimes, these live in iframes and are safely isolated from the parent page, but so many people just use Javascript to do it.</p><p>We elected to use Javascript back when we were working on <a href="https://www.addressreport.com/">AddressReport</a> to power our embeddable data widgets which were designed to enhance home listings across the internet using our data. We ultimately chose to do so for the purpose of flexibility, which I think is compelling to a lot of companies building embeds.</p><p>I expected to receive a lot of pushback about that decision, but not a single partner raised any objections whatsoever about security. When speaking with the team over at <a href="https://breezometer.com/">Breezometer</a>, who offer a similarly packaged embed, they told me I was the first person to ever even mention the concern to them. I’m convinced most people are totally unaware of this risk!</p><h4>Reusable Components</h4><p>There are plenty of not-for-profit open-source projects out there with fully inspectable codebases you can <em>dive into*</em> and deliver safely from your own CDN. But there’s a growing trend in building out reusable components that are monetized by charging a licensing fee. An appealing way to monitor and enforce those licensing contracts is to deliver the components using JS snippets.</p><p><em>*But you probably won’t; hopefully somebody else will, right?</em></p><p>These have the advantage of simplicity (so easy for a manager to simply write, “paste this snippet” and call it a day). When I get these requests, I usually go into this whole spiel, but I’ll admit I occasionally acquiesce if I’m feeling particularly tired, only to regret it later when our webpages are slow.</p><p>What frustrates me about these is that the features they offer rarely justify hosting the Javascript externally. Though they may be bound to a licensing agreement, there’s no real benefit on our end in keeping them separate from our typical asset pipelines! Sometimes, the situation is so bad (calling you out HelloBar), that the main thing they offer can be reproduced with a few lines of HTML and CSS!</p><p>To find out just how prevalent the practice is, <a href="https://tech.metriccollective.com/the-number-of-external-javascripts-on-producthunt-websites-will-shock-you-974890a312c#.ajxz86lc5">we analyzed nearly 7,000 websites featured on ProductHunt</a>, and the results were terrifying.</p><p>With all this in mind, there’s definitely value in leveraging external JS, but the practice really needs to be reeled in before something serious goes down. For every noteworthy hack out there, there are thousands of subtler attacks that go unnoticed. I wouldn’t be surprised if there were some very popular compromised snippets out there, live right now, just piping credit cards to who-knows-where in volumes low enough to avoid detection.</p><p>Next time your boss asks you to “just paste this snippet,” send them this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YnzuZrnAGBkFn7m_B68j6g.jpeg" /><figcaption>Cool combination.</figcaption></figure><p><em>Metric Collective is a holding company based in NYC that both </em><a href="http://www.forbes.com/sites/alexkonrad/2016/06/06/metric-collective-the-startup-landing-spot/"><em>acquires existing companies and builds new ones from scratch</em></a><em>, mostly focusing on tools that support the SMB space. If you enjoyed our shamelessly self-promoting dev blog and want to talk about opportunities at Metric, </em><a href="/service/mailto:kevin@metriccollective.com"><em>email me</em></a><em>, or read more stuff by the business weenies at </em><a href="https://musings.metriccollective.com/"><em>Metric Musings</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3032eca3480e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metric-tech/of-course-ill-let-you-execute-arbitrary-javascript-code-in-my-users-browsers-3032eca3480e">Of Course I’ll Let You Execute Arbitrary Javascript Code in My Users’ Browsers</a> was originally published in <a href="https://medium.com/metric-tech">Metric Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Dunning–Kruger Effect : or Why You Have No Idea How Long That Feature Will Take]]></title>
            <link>https://medium.com/metric-tech/the-dunning-kruger-effect-is-why-you-have-no-idea-how-long-that-feature-will-take-88759de8f6a8?source=rss-eb8ddc567d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/88759de8f6a8</guid>
            <category><![CDATA[management]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[psychology]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[agile]]></category>
            <dc:creator><![CDATA[Kevin J. Dolan]]></dc:creator>
            <pubDate>Wed, 13 Jul 2016 15:43:18 GMT</pubDate>
            <atom:updated>2016-10-04T20:24:38.298Z</atom:updated>
            <content:encoded><![CDATA[<p>To remain consistent with historical precedents, we’d like to take a moment to add to the tomes of think-pieces regarding project estimates. We’re going to discuss a little-known (but essentially common-sense) cognitive bias that I believe leads to some of the most pathological problems with project estimates.</p><blockquote>“The Foole doth thinke he is wise, but the wise man knowes himselfe to be a Foole” — As You Like It; Shakespeare</blockquote><p>Like any technology company, progress for Metric is driven in significant part by the productivity of our developers.</p><p>Building new and unique software is not like building a prefab-house, there is not an established playbook of the steps required and even if there were, there’s inadequate understanding of how long it takes a typical worker to complete those steps. There is a so much uncertainty with respect to what small steps will lead to the completion of a feature, and further, no matter how hard you try, you often can’t tease out the ambiguity in feature specifications until you’ve started trying to implement them.</p><p>That being said, schedules are critical when coordinating across teams within any engineering organization, so estimates are a fact of life.</p><p>So much has been written about various techniques for getting better at estimates, for how to quantify estimates, and there are plenty of Capital-A Agile Jerks who will take your money to teach you some new ones, so we’ll leave the deep discussion of that to them. The goal is generally the same: we want to get some sense for how long it will take to complete something, so we can plan around having or not having that thing.</p><blockquote>“There are lies, damn lies, and project estimates.” — Misattributed to plenty of important management consultants I’m sure.</blockquote><p>At <a href="https://www.metriccollective.com/">Metric</a>, we use a Fibonacci-scaled points system to attempt to understand the relative difficulty of stories that we enter into our tracker. Each of our different projects typically settles on a different norm for what one developer is generally expected to complete, but the basic premise is that, as a developer, you commit to a certain number of points for a certain iteration, and you are held to that commitment at the end of the iteration. If you fail to deliver on that, you are publicly shamed* in a company-wide email, and we try to figure out strategies to come up with better estimates in the future.</p><p>Still, we fail to meet our timelines.</p><p>These timelines are not handed down from above by a pointy-haired manager who doesn’t understand the tech; they are reached cooperatively among a team of people who have a deep understanding of the systems they’re working on.</p><p>We are mainly concerned here with the problem of under-estimating the time features will take to build. Over-estimation can be problematic too, but is rarely something to complain about.</p><p>I believe that under-estimation stems primarily from two distinct errors:</p><ol><li>Ambiguity in the specification of the feature that causes the overall scope of the feature to creep outward, sometimes dramatically highlighting failures in other features which were considered to be stable</li><li>Misunderstanding of precisely what little steps need to be taken to cause the feature to be completed, either from a lack of knowledge, or an inadequate assessment of the specification</li></ol><p>Theoretically, as engineers who have made and failed to meet estimates in the past, you’d expect that we can compensate for these problems by simply applying some constant factor of expected ambiguity into our estimates, but even if we do that, we tend to under-estimate still!</p><p>The pathological problem at hand here is that when good software engineers do their best to come up with estimates, they actually do create a mental model of what little steps are required to complete the issue. The issue is that they tend to be incorrect in this regard, in major part due to the Dunning-Kruger Effect.</p><p>The Dunning-Kruger Effect is a cognitive bias (birthed primarily from my Alma Mater!) that inexperienced individuals have a tendency to over-estimate their abilities due to a lack of knowledge about where their deficiencies lie. Conversely, experienced individuals often mistakenly believe tasks to be easy for others to complete, due to their own lack of those deficiencies.</p><blockquote>“The miscalibration of the incompetent stems from an error about the self, whereas the miscalibration of the highly competent stems from an error about others.” — From the Dunning-Kruger paper, “Unskilled and Unaware of It: How Difficulties in Recognizing One’s Own Incompetence Lead to Inflated Self-Assessments”</blockquote><p>This has some disastrous upshots for project estimates in a few important ways. The first and perhaps most important is that when we begin working on a new feature, no matter what our level of experience in programming in general or the problem domain in particular, we are novices with respect to that particular feature. Dunning-Kruger tells us that, as novices, we will likely mis-respect the difficulty and complexity of the problem due to the fact that we simply do not know enough about it to be worried.</p><p>Further, when experience in the broader sense is lacking, either from inexperience as a programmer or inexperience in a particular environment, we simply lack the ability to break the problem down into steps at all. At that point, we either treat the feature as a single amorphous step, or we declare the whole business impossible and give up.</p><p>For cases where we might expect the broader experience to be lacking, we try to help newer developers by pairing them with a relative expert who can help to break the feature down and provide guidance on how to proceed. This is where the converse corollary of the Dunning-Kruger Effect can rear its ugly head.</p><p>Because the features assigned to newer developers tend to be simpler and more completely defined, and because the estimates are guided by relative experts, there is a tendency for these experts to over-estimate what the novices should be capable of accomplishing and under-estimating how difficult they will be for them. This often leads to anger on the part of the experts who can’t fathom why something so simple proves so difficult.</p><p>So how can we combat Dunning-Kruger in practice?</p><p>Cognitive Biases are notoriously difficult to solve, because they represent deeply-rooted, fundamental errors in the way we think. Awareness is the first step, but wholly insufficient unless we take active steps to compensate for them.</p><p>For the case of expert-driven estimates for novices, there is at least some hope. At Metric, we find that involving novices deeply in the process of estimation goes a long way. We accomplish this by breaking down the small steps we believe are required to solve issues, and making sure each step is adequately understood by allowing for questions and challenges.</p><p>We need to make sure that where there are gaps in knowledge which will require education, the necessary resources are made available, and ample time for experimentation is allotted (beyond simply performing the minimum work required to complete a task). Finally, we need to make the experts available in real-time to help them through steps that might block or delay completion of the feature.</p><p>For self-driven estimates, the situation is a little more grim. Dunning-Kruger is an especially difficult bias to tease out, because it stems not from a correctable error, but rather from an overall lack of information.</p><p>The only salve we’ve found to be effective in combatting this at Metric is allowing for free-form exploration of stories before estimates are arrived. This might be as simple as mapping out on paper the steps required, and using that as an opportunity to highlight ambiguity/uncertainty, or it might be as involved as beginning a skeletal implementation of the feature to see what snags we hit along the way.</p><p>Doing this is expected to be a part of our weekly iterations, and should be accounted for in estimates of overall capacity, just like the bugs and high-priority things that inevitably creep up.</p><p>By taking the time to accurately and sufficiently work through our estimates, and by doing our best to highlight and be aware of our deficiencies, we have some hope** of overcoming Dunning-Kruger!</p><p>*Not really</p><p>**But not great hope.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QvZdNeT98JBeICxM_hfNDA.jpeg" /><figcaption>The sky.</figcaption></figure><p><em>Metric Collective is a holding company based in NYC that both acquires existing companies and builds new ones from scratch, mostly focusing on tools that support the SMB space. If you enjoyed our shamelessly self-promoting dev blog and want to talk about opportunities at Metric, </em><a href="/service/mailto:kevin@metriccollective.com"><em>email me</em></a><em>, or read more stuff by the business weenies at </em><a href="https://musings.metriccollective.com/"><em>Metric Musings</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88759de8f6a8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metric-tech/the-dunning-kruger-effect-is-why-you-have-no-idea-how-long-that-feature-will-take-88759de8f6a8">The Dunning–Kruger Effect : or Why You Have No Idea How Long That Feature Will Take</a> was originally published in <a href="https://medium.com/metric-tech">Metric Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What We Learned Writing Expandable SQL ETLs for All of our Schemaless Data]]></title>
            <link>https://medium.com/metric-tech/what-we-learned-writing-expandable-sql-etls-from-all-of-our-schemaless-data-d53d34725bab?source=rss-eb8ddc567d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/d53d34725bab</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Kevin J. Dolan]]></dc:creator>
            <pubDate>Wed, 13 Jul 2016 06:45:10 GMT</pubDate>
            <atom:updated>2016-07-13T21:24:06.924Z</atom:updated>
            <content:encoded><![CDATA[<p>Metric Collective is a company full of what other buzzier startups might call Data Scientists. Most of us come from STEM backgrounds, and we love challenging our assumptions with data.</p><p>That being said, getting all of our data into one place has historically been a bit of a challenge. We use a ton of different systems to collect data, and historically, it’s required either engineering support or time-consuming and boring manual tasks to export data to excel and then do our analysis.</p><p>Thankfully, lots of other companies like to use data too, so there’s this well-established concept in Business Intelligence called the Data Warehouse. The Data Warehouse is a single place for all of an enterprise’s data to be piped into for analysis with other tools. <em>But of course, you already knew that.</em></p><p>Data Warehouses take a wide variety of forms, from storing data in flat files, to storing data in relational tables, to storing arbitrarily-structured data like JSON. A variety of tools can then be layered on top of the warehouse for analysis.</p><p>The parts of the process that pipe data from their raw sources into the warehouse are typically referred to as Extract, Transform, Load or ETL processes.</p><p>At Metric, we wanted to build a Data Warehouse that our business users (who are smart, but are not programmers) could use to ask sophisticated questions of the data, truly integrating data from multiple sources in an ad-hoc manner. One requirement is that we needed to avoid anything which requires engineering ahead of the question to be performed.</p><p>So we built Metric Collector. Metric Collector consists of 4 main components:</p><ul><li>Extract layers that pipe data from a variety of sources through a variety of means into streams of JSON-encoded data with arbitrary schemas,</li><li>Transform/Load layers that format and pipe the data into a couple different warehouses for different use-cases using upsert semantics</li><li>Warehouse layers that store the data and offer certain analysis/query capabilities, including SQL and JSON-line formatted files</li><li>Analysis layers that display the data, perform computations over the data, and provide tools for business users to analyze the data</li></ul><p>Overall, from idea to stability was a process of about 3 months. Along the way, we ran into a ton of pitfalls. Here are some of the things we learned.</p><h4>Schemaless is rarely actually schemaless</h4><p>Our system allows for the generation of arbitrary JSON data to be emitted from the Extract layer. This data could be arbitrarily nested, contain objects and arrays, arrays of objects of arrays, etc.</p><p>The reality though, in practice, is that these data objects tend to stabilize over time into reasonably congruent data models that can be easily understood.</p><p>I would argue strongly that no analytical language has ever come close to matching the expressive power of SQL for asking rich, ad-hoc queries of data. This means that if you want to empower your team to ask such rich questions, it’s still the best tool you have.</p><p>Within that world, there’s a myriad of options. You can pipe things to a transactional database like Postgres, something designed for warehousing like Redshift, or something new and wacky like Hive. Depending on your choice, you may be required to provide them schemas before inserting your data.</p><p>We ultimately elected to use both Postgres and Redshift (for slightly different purposes), which meant we needed to inform these databases of our data model.</p><p>At first, we attempted to pre-define our schemas and transform the incoming JSON to match it. We built out a yaml-based DSL to describe the process. This ultimately proved overly burdensome for our developers, who saw it as an impediment to the things they really wanted to accomplish at that particular moment (you know, building actual applications).</p><p>So finally, we built out an automated system, which essentially learns JSON schemas for a particular model over time. The load layer then batches schema migrations when they occur and queues up data objects that don’t match the schema until the migrations can safely be performed.</p><p>We’re really proud of the code we’ve written to accomplish this. The Redshift version produces relational flat tables that maintain consistency with all of their relations through staging tables, and the Postgres version produces single-row upserts using arrays and custom types.</p><p>There’s one major risk here, and that is unchecked schema expansion. To combat this, all data that arrives from untrusted sources is ultimately fitlered through a schema whitelist to make sure it conforms with what we expect. Similarly, we have both soft and hard limits in place to detect cases where it seems like expansion might be occurring to either warn developers or queue the data into a “bad apple” bucket for further analysis.</p><h4>Choose the right warehouse for the job</h4><p>There are a ton of choices out there for what to use to actually store the data and analyze it. Not all choices are well-suited for the all tasks.</p><p>If you architect your ETL system appropriately, leveraging a sophisticated messaging system that supports fan-out semantics, it becomes a relative breeze to start adding additional warehouses for the same consolidated stream of data.</p><p>At Metric, we send our data to 3 main places:</p><ul><li>JSON-lines files, which simply contain a stream of all the data we’ve ever written to collector. This can be used to replay the stream to new or failed warehouses, and can also be used by more open-ended analysis, such as machine learning. Data in these files typically lags behind by about an hour.</li><li>Postgresql, which receives its upserts transactionally in as real-time as possible. Because of limitations of this server, we expire data based on its timestamp after a few months. As a result, this warehouse is best used for near-real-time questions. Data on Postgres typically lags behind by about 15 seconds.</li><li>Redshift, which is our massive data warehouse for long-term storage of all the data fit to store. We use this to ask more complex questions that might be too slow on Postgres or questions about old data that’s already expired from Postgres. Data on Redshift typically lags behind by about 6 hours.</li></ul><p>We also had some real-time statistic accumulators along the way that ultimately were made redundant by the unanticipated low latency of the PSQL ETL. We are considering adding elasticsearch to the mess, which should be a fairly straightforward exercise.</p><h4>You need a repeatable mechanism for replaying your ETLs</h4><p>Before anything else, you absolutely need to write an ETL that simply writes incoming items to some sort of log format as simply and losslessly as possible for replay to other ETLs when you write a new one, or when you inevitably mess them up.</p><p>Because all of our extract layers output well-formed JSON that is destined for upsert semantics into the warehouse, this makes the log format pretty simple. We can write the JSON to a encrypted, compressed file and send it off to some cold-storage server in the cloud. These files can get pretty large, but thanks to offerings like Amazon Glacier, it can be very cost effective and convenient.</p><p>With this setup, during development, we were able to replay the entire log over our new TL layers again and again to make sure they worked as designed.</p><p>It’s also a valuable tool for absolute-worst-case-disaster-recovery, because it is theoretically a perfect audit log of all of our historical data changes. There’s no simple way to recover from it, so we still have all sorts of other better-suited disaster recovery plans for particular technologies, but having this single-source-of-truth log is good for peace of mind.</p><p>This also could serve as an audit tool if we were subject to such requirements for any of our businesses, because we could theoretically go back in time to any particular point and see what the data looked like at that moment. We build in a chain of hashes to our log to prevent (or rather, detect and deter) tampering.</p><h4>You need to be very defensive about losing data in the Messaging layer</h4><p>The Pub/Sub model is an extremely natural model for building ETLs, and has been used in one form or another since the beginning. It’s easy to set up different channels that can be used to pass messages to workers that just chug away at data in message queues, and then forward their results to other channels.</p><p>Pub/Sub is really simple at first glance, but the details can get super-complicated. Things get really messy when you realize that the workers working on the data might die because their machines go out, because they were written wrong, or anything.</p><p>In many cases, our assumptions about the way the data would look or limitations about the databases we were using led to extended periods of time where for one particular component of the ETL was completely blocked.</p><p>These types of things will happen, no matter how hard you test your code and work to prevent it. Sometimes, it’s entirely outside of your control.</p><p>So it’s vital to make absolutely sure you are using a messaging protocol that lets you acknowledge messages you’ve completed, and redelivers messages that have been unacknowledged after some time. This will lead to duplicate messages for sure, but if you are using upsert semantics in your load layer, it’s not a problem.</p><h4>You also need to be defensive in your load layers</h4><p>A lot of our load layers essentially poll their data from some external source on a regular basis, like a third party CRM or github. We might, for example, run an hourly job that gets any new activity from the past hour.</p><p>Just like every other component of collector, these things fail, and since we don’t know much about the underlying architecture of the APIs we might be calling to, there may be large delays in the availability of data that they offer themselves.</p><p>Ideally, we’d run a full historical dump every single time we ask for new data, but that would get pretty costly pretty fast, so it’s not really an option. Instead, we usually ask for 5-10x the interval we are checking against just to be absolutely sure, and we keep track of successful runs of these tasks to make sure we make up for extended failures.</p><p>We also allow for manual intervention when other problems are detected that were missed through automatic checks (like somebody changing the signature of an API, for example).</p><h4>Things can and will arrive severely out-of-order</h4><p>So from all that defensive coding, it’s pretty clear to see how things are going to be arriving severely out-of-order from time to time. This means that nothing you do can count on any order predicates whatsoever.</p><p>If you are running some kind of online statistical accumulator, you might be able to get away with simply waiting an appropriate amount of time before emitting a final result with the hope you’ve collected any lagging data points, but only if its value is not mission critical.</p><p>Since we use upserting semantics on our load layer, understanding the source-of-truth ordering is really important, so we’ve written specific load procedures that will clobber older items and ignore outdated upserts.</p><h4>Benchmark everything and autoscale your ETL workers</h4><p>It’s important to make sure that your ETL system can sustain the load it will receive, even during spikes, without hurting the predictability at which it is being loaded into the warehouses.</p><p>To test overall throughput, we would replay the entire stream using the file output and just chug through it as quickly as possible with as many workers as we were willing to throw at it.</p><p>Each of our workers could sustain a throughput 2–4k messages per second on Google cloud hardware. We can scale workers up and down arbitrarily using <a href="https://medium.com/metric-tech/how-metric-manages-the-infrastructure-for-twelve-distinct-server-stacks-with-one-single-deployment-c146261f44d1">Topology</a>, and the addition of workers had no impact on throughput (other than by limitations of the database).</p><p>At its peak, the Postgres warehouse could handle approximately 50k upserts per second on an isolated n1-standard-4 Google Compute Engine instance with a local SSD. It’s unclear how this would scale with larger instances, but it is our belief that most of this limitation was due to disk throughput. Using batch uploads into temp tables followed by more cohesive upserts could probably improve overall throughput, but might hurt latency.</p><p>We were unable to reach any sort of throughput limit whatsoever with respect to inserts into Redshift, using our single-node ds2.xlarge cluster.</p><p>Collector has proven to be one of our most successful internal projects. It’s led to countless invaluable insights by our business team on a variety of topics. We also use the warehouse to broadcast stats about everything ranging from revenue to website latencies on TV screens throughout the office, so everybody can keep their pulse on what’s going on at Metric. More and more, we are also starting to use it for transactional things like structured search and client-facing dashboards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hbRUSYthPDdYvqFFPJXeaQ.jpeg" /><figcaption>Woah, two colors?</figcaption></figure><p><em>Metric Collective is a holding company based in NYC that both acquires existing companies and builds new ones from scratch, mostly focusing on tools that support the SMB space. If you enjoyed our shamelessly self-promoting dev blog and want to talk about opportunities at Metric, </em><a href="/service/mailto:kevin@metriccollective.com"><em>email me</em></a><em>, or read more stuff by the business weenies at </em><a href="https://musings.metriccollective.com/"><em>Metric Musings</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d53d34725bab" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metric-tech/what-we-learned-writing-expandable-sql-etls-from-all-of-our-schemaless-data-d53d34725bab">What We Learned Writing Expandable SQL ETLs for All of our Schemaless Data</a> was originally published in <a href="https://medium.com/metric-tech">Metric Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>