<?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[Making Dia - Medium]]></title>
        <description><![CDATA[Stories from the team who are building Dia&amp;Co. - Medium]]></description>
        <link>https://medium.com/dia-co-engineering?source=rss----f3878277f0b8---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Making Dia - Medium</title>
            <link>https://medium.com/dia-co-engineering?source=rss----f3878277f0b8---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 15:41:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/dia-co-engineering" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[QA Environments v2]]></title>
            <link>https://medium.com/dia-co-engineering/qa-environments-v2-ccfeefa4855c?source=rss----f3878277f0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/ccfeefa4855c</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Justin Hnatow]]></dc:creator>
            <pubDate>Wed, 17 Apr 2019 11:01:03 GMT</pubDate>
            <atom:updated>2019-04-17T11:01:02.781Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*Sy1dBOVtRCU__jw7fslX9w.png" /><figcaption>From <strong>Under the Ocean</strong> by Anouck Boisrobert and Louis Rigaud</figcaption></figure><h3>Summary (tl;dr)</h3><p>As described in <a href="https://making.dia.com/how-we-deploy-software-2-0-be0befd8976">How We Deploy Software 2.0</a>, quality assurance testing is an essential part of deploying code at <a href="https://www.dia.com/">Dia</a>. Early on, the simple idea that <em>shared environments do not scale while individual environments do</em> was taken to heart. The ability to build individual test environments for QA was added to our main application. While these test environments provided exceptional parity with our production environment, the time to spin them up was lengthy, clocking in at approximately 45 minutes. As Dia has grown, the urge to reduce this time grew with it, so a process of revision for the test environments was undertaken. There were two main goals to this revision: maintain parity with production and increase the ease-of-use of the test environments.</p><p>Here we’ll provide a technical overview of the second iteration of individual testing environments, drawing particular attention to the reduction of spin-up time from approximately 45 minutes to approximately 15 minutes.</p><h3>Overview</h3><p>Our primary goal with the second iteration of our QA environments was to speed up provisioning. Using instrumentation code to gather timing data on QA environment spin-up time, it became patently obvious that the greatest gains to be had were related to the data layer. The chart below depicts the output from an instrumented run by showing the cumulative time (in red) and the per-step times (in blue). Restoring the test database from a backup took approximately 18 minutes and re-indexing <a href="https://www.elastic.co/">Elasticsearch</a> took over 8. The total time was over 45 minutes. We have a lot of test data!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mpfYTWnU5IxM9L8Q" /></figure><p>Since we need test data to test, the only options we had were to run the data layer operations in parallel or to pre-build the data layer. The major innovation in the second version was in pre-building the data layer. This was achieved by periodically creating a machine image in AWS (<a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html">AMI</a>) that contained the full data layer — a database with test data, re-indexed Elasticsearch, and <a href="https://redis.io/">redis</a>. This AMI was then used as the base for the <a href="https://aws.amazon.com/ec2/">EC2</a> instance that runs the test environment. The chart below depicts the current cumulative time and per-step time to spin-up a QA environment using this process. The total time is just over 15 minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KgShatMZbdIqqJc_" /></figure><p>With this single change, the time to create a full test environment went from 45 minutes to 15 minutes.</p><h3>How Did We Achieve Such Time Savings?</h3><p>Below is a high-level view of a QA environment. The characteristic that distinguishes a <em>version 1</em> environment from a <em>version 2</em> environment is that all of the elements outlined with a dashed line are preloaded into an AMI that is used as the base image for the EC2 instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/0*-0RngOhTm6ljeVNx" /></figure><h3>AMI, Postgres, ElasticSearch</h3><p>In the first version of the QA environment, each component was loaded serially. This involved creating an EC2 instance from an AMI, pulling images from <a href="https://www.docker.com/">Docker</a>, unpacking the test data archive, indexing Elasticsearch, loading the application code, and adding all the necessary infrastructure components (DNS entries, target groups, entries in the load balancer, etc).</p><p>By pre-populating an AMI with the test data and data-layer Docker images, there are fewer Docker images to pull, no data to unpack, and some relatively quick steps to bring the QA environment into an operational state. This saves a substantial amount of time. The AMI is created periodically using <a href="https://www.packer.io/">Packer</a>.</p><h3>Jenkins, Terraform, ECS</h3><p>Another improvement involved the manner in which the QA environments were created. The first version used a Makefile and several make commands to facilitate the lifecycle of QA environments. Much of the environment bootstrapping was built into these commands which, in their interface were simple, but, in their implementation were complex. There was a desire to remove the logic from these commands and place it somewhere more suitable.</p><p>A suitable location was found to be <a href="https://jenkins.io/">Jenkins</a>.</p><p>A Jenkins script was created to manage the lifecycle of the QA environment. This script runs a job that manages QA environments with a given set of parameters. During creation, the job runs the requisite steps to bring the QA environment together and to deploy it. Building the Docker image used by <a href="https://rubyonrails.org/">Rails</a> and <a href="https://sidekiq.org/">Sidekiq</a> requires installing Ruby, pulling the branch to be tested, bundling gems, and pre-compiling assets (among other steps). Deployment is a complex process facilitated by numerous Terraform scripts which provision AWS resources including an <a href="https://aws.amazon.com/ecs/">ECS</a> task responsible for running the QA environment. Among the resources created are a load balancer target group, DNS entries, the full EC2 instance, the aforementioned ECS task, and an ECS service to run the task.</p><p>This highlights another substantial but superficially transparent change: the new environments are managed by <a href="https://aws.amazon.com/fargate/">AWS Fargate</a>. <em>Version 1</em> QA environments did not have any application-management. They were simply EC2 instances running Docker containers. If the instance failed to start, shutdown, or started to act unpredictably, there was nothing to manage this. Now, QA environments are managed by Fargate. This means that there is a layer of infrastructure that ensures that the EC2 instance starts and continues to run. It also makes debugging a bit more challenging, but we’ve overcome that — more below.</p><h3>Automation</h3><p>The final update was in user-interaction. As mentioned above, users needed to run make commands to build the QA environments. Since we use Github to manage our version control and release process, it was determined that Github would be a suitable place to interact with QA environments. Now, users can place comments with commands on their pull requests to trigger lifecycle events for QA environments and the environment state is noted via labels on the pull request. Also, QA environments automatically update whenever new code is pushed to a branch with and open pull request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JJshiK3bfcV-OTIEb5sVsw.png" /><figcaption>Working in Github to spin-up a QA environment</figcaption></figure><p>These new commands work by using a Github webhook and a small <a href="http://sinatrarb.com/">Sinatra</a> application to monitor the webhook events. The label updates are performed by monitoring the ECS service state as it transitions through its lifecycle.</p><h3>Tooling &amp; Debugging</h3><p>Because of the transition to AWS Fargate, the means by which we debug the QA environments had to change. There are two huge technical boosters that brought the new QA environments to a state of approximately similar debuggability.</p><p>First, we began to push all logs into <a href="https://www.datadoghq.com/">Datadog</a>. Dia recently adopted Datadog as its de facto monitoring solution. It only made sense to redirect all logs from QA environments into Datadog. Now, we have simple filters in Datadog which allow anyone to view any log from any container running in a QA environment. It’s very powerful.</p><p>Second, a means of running a Rails console using the same application environment as that running in the QA environment was developed. This was done by pulling the Docker image to the local machine and attaching it to all of the external data-layer resources. It’s managed by a make command and allows for running scripts, rake tasks, and general data-exploration.</p><h3>Conclusion</h3><p>Ultimately, this update took about three months to complete. The time savings are huge, the interface simple, and the infrastructure resilient. Running a QA environment for a given branch is simple and powerful. The new developer workflow can be summarized in 2 steps:</p><ol><li>Open the PR</li><li>Tell the bot to spin-up a QA environment</li></ol><p>Once the QA environment is running, the bot automatically updates it when new code is pushed to the branch and automatically terminates it when the PR is merged.</p><p>This simple workflow incentivizes developers to test as well as experiment. There is a slight loss of configurability and visibility, but the overall gains are well worth the losses.</p><p>What’s next? As we gradually decompose our monolith into more focused applications and micro-services, we’ll need to expand the QA environment offerings to support these. Additionally, this decomposition will mandate improved integration testing. We’ve got our work cut out for us.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccfeefa4855c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dia-co-engineering/qa-environments-v2-ccfeefa4855c">QA Environments v2</a> was originally published in <a href="https://medium.com/dia-co-engineering">Making Dia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Deploy Software 2.0]]></title>
            <link>https://medium.com/dia-co-engineering/how-we-deploy-software-2-0-be0befd8976?source=rss----f3878277f0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/be0befd8976</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Natali Toupin]]></dc:creator>
            <pubDate>Wed, 17 Apr 2019 11:01:01 GMT</pubDate>
            <atom:updated>2019-04-17T11:01:01.099Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m gonna be bold here and say: <em>Unequivocally, the single most important thing a software development team does for a business is ship code to production.</em></p><p>There are many schools of thought on the best deployment practices — here at Dia we believe in continuous delivery. To us, continuous delivery means regularly delivering the highest level of value to our business in the most immediate way.</p><h3>Deploys 1.0</h3><p>You can read in-depth about the first major change to our deployment process <a href="https://making.dia.com/how-we-deploy-software-39088e6af996">here</a>. The condensed version: Our developers were managing deploys, we grew, slowed down, introduced a more formal QA process and transitioned to a QA-managed deploy strategy. The QA-managed deploy solution was always known to be temporary. However, we had some deployment and testing infrastructure that needed to be built before we could take our next step towards continuous deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VlmxdHEtPDwrhtfF4ihcUg.jpeg" /></figure><h3>What we’ve learned</h3><p>For the first year of the year and a half we worked this process it served us really well, with very few headaches. The best thing we did when transitioning to this new process was to understand how it would scale. That allowed us to identify early that certain parts would become more problematic as we scaled the team and that ultimately allowed us to build solutions in anticipation of our next steps. The two main problems we needed to address were the blocking nature of our QA environments and the misemployment of QA team members as deployment coordinators.</p><h3>QA Environments</h3><p>Having master equal staging and having only staging as a fully integrated environment was going to be a bottleneck. Every time we had changes that required product, design, QA and/or UAT testing, we’d have to block master. Not that big of a deal if everything in testing goes well and there are no issues found, but that’s a fairytale, not real life.</p><p>So, what happens when you find something considered deploy blocking? No code gets shipped to production until the issue is addressed. Is that deploy blocking issue the most important thing the business is working on? Should it be holding all other things from deploying? Yes, that feature may be unusable, which would absolutely make it deploy blocking, but deploy blocking should not be synonymous with “nothing else can be deployed until that issue is resolved.” We solved this problem by building and iterating on QA environments.</p><p>We had a “staging2” which is exactly what it sounds like: a second staging environment that had all of the same services and deploy process of staging. That was great except that it only allowed you to test one additional branch outside of what was on master. Having “staging2” better helped us to understand our requirements for our first iteration of the QA Environment. You can read more about the 2nd iteration of our QA environment <a href="https://making.dia.com/qa-environments-v2-ccfeefa4855c">here</a>. This iteration effectively allowed us to decouple deploys from testing. Fortunately, we have some ridiculously intelligent and talented engineers who have solved for our testing infrastructure scalability.</p><h3>QA Managing Deploys</h3><p>When we transitioned to this process, it made sense for QA to manage deploys. We saved a substantial amount of time by removing the need for coordination between developers and QA regarding what was going to be staged for testing and ultimately deployed. We intend to keep our QA team lean — this strategy means their testing time is a finite resource. As our development team grew, having someone who we hired to test spending time managing deploys was increasingly more painful. We needed testing resources and they were wrapped up in deploying code instead of testing it. Once we had QA environments in place, we were able to decouple deploys from testing.</p><blockquote>We’ve always known that, ultimately, deployments can and should be managed by the development team. Not only was the time spent by QA problematic, but, by not having developers in charge of deployment, we missed the opportunity to empower them to debug and improve our deployment tooling. It may go without saying; when you empower people to solve problems, especially a group of developers, you’ll be amazed at how quickly solutions are implemented. We want to create alignment and empower developers wherever we have an opportunity.</blockquote><h3>Deploys Today</h3><p>Recently, we transitioned back to a developer run deploy process. The transition was super simple. Because we understood our stakeholder, product management, and QA needs, we were able to account for the communication aspects and ensure that there was no disruption to the business and/or our deployment pipeline. We also knew that our iterative, ego-free approach to problem solving would allow us to quickly address any issues that should arise.</p><h3>What’s Next</h3><p>The next iteration of our deploy process will be to stop treating our Rails monolith as a special case. If we’re going to put time into sophisticated tools to support our deploy process, every internal service should be able to take advantage of them.</p><p>Some more items on our todo list:</p><ul><li>Automate ticket transitions so our issue tracker stays in sync with our code</li><li>Implement Slack bot commands to spin up QA environments / provide status on staging/production deploys</li><li>Improve metrics / monitoring, make deploy issues more visible to engineers</li><li>Investigate processes to coordinate deploys between services</li></ul><p>At Dia, we believe in empowerment, autonomy and collaboration as is evidenced by our ability to continue to iterate on how we deploy. We are actively and continuously exploring and implementing tooling and automation. Now that our deployment process is once again owned by our development team, we are positioned to quickly identify problems and implement solutions. If these problems interest you, <a href="https://www.dia.com/careers">become a member</a> of our awesome team!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be0befd8976" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dia-co-engineering/how-we-deploy-software-2-0-be0befd8976">How We Deploy Software 2.0</a> was originally published in <a href="https://medium.com/dia-co-engineering">Making Dia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Everywhere/Nowhere Office]]></title>
            <link>https://medium.com/dia-co-engineering/my-everywhere-nowhere-office-4a4c57ae6723?source=rss----f3878277f0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/4a4c57ae6723</guid>
            <category><![CDATA[future-of-work]]></category>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[distributed-teams]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[hiring]]></category>
            <dc:creator><![CDATA[Jim VanNest]]></dc:creator>
            <pubDate>Fri, 12 Apr 2019 11:01:01 GMT</pubDate>
            <atom:updated>2019-04-12T15:08:25.942Z</atom:updated>
            <content:encoded><![CDATA[<h3>My Everywhere / Nowhere Office</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lONBBbKQ0fHsbu_RsS3pSw.jpeg" /><figcaption>The soggy bit of the Back Cove. Portland, Maine. A random Friday’s “office.”</figcaption></figure><p>As I write this, it’s 65° and sunny. I’m in a park near my house, leeching off of a donut shop’s WiFi, witnessing the splendor of our world, and I just pushed a commit to a PR that I’ve been working on for a few hours. In another hour, I’ll have a meeting, and that meeting will take place via Zoom from this picnic table. I’m limited only by the weather, connectivity, and my MacBook’s battery-life. This is the promise of the future of work and I am living it.</p><p>Most days I work from my home office, or my couch, or my dining room table. Other days it’s a coffee shop or my kitchen counter. On days like this one, though, glorious freedom calls.</p><p>Why don’t we all work like this? Why isn’t this golden day being shared by all of my fellow gentle code enthusiasts and casual Friday attendees?</p><p><strong>Traditiooooooooon. Tradition.</strong></p><p>The emphasis on centrality in a workforce is an old one. It marches lockstep with the corporate, industrialized model that permeates our governments and school systems. Its roots can be traced back to when the work being done necessitated close proximity: I add a widget, you add a wingnut, and someone at the end spins them together into a hoodad.</p><p>Though the additive nature of production hasn’t changed much in the intervening century or so, the nature of the assembly line most certainly has. One need not be in the same cubicle, nor even on the same floor, to design a website component that will be implemented by someone else. So, why not a different state, timezone, or even country?</p><p>The answer for most companies is a matter of trust.</p><p><strong>The Cost</strong></p><p>Desk work is expensive. Period. When a company makes an investment in human labor in a specialized field, it comes at a pretty steep price. One must consider salary, insurance costs, tax implications, liability, on-boarding, eventual raises, bonuses, and maybe even stock options when deciding to hire an employee. It’s an investment, and a weighty one at that.</p><p>Through that lens, it’s relatively easy to see why the idea of a centralized office and a solid management layer would be so appealing to the person or entity signing payroll checks. Having control is an important feeling for people with skin in the game.</p><p>Dia&amp;Co. has made a decision to distribute its engineering resources in the face of this, and for good reason. This is an ever-ongoing process around which we’ve been iterating. We’ve been<a href="https://making.dia.com/how-dia-does-distributed-ed983eec6cb8"> cataloguing these changes</a>, too.</p><p><strong>The Talent</strong></p><p>Some specific personal qualities and technical qualifications are necessary to do an exemplary job in our line of work. Amongst those are empathy, drive, meticulousness, and talent.</p><p>I know that that last word is a bit ugly and hand-wavy, but it best encapsulates a large gray area of skill that could be expounded upon (and has been) in books by people with Ph.Ds. To me, talent is a mixture of acquired skills (expertise in a language or framework, for example) and an ability to learn new skills quickly and well. We routinely hire developers to contribute in their primary languages while training them in others. This is not rare in the industry, either.</p><p>Empathy is a large pillar of our workforce at Dia&amp;Co., and something that we look for in potential candidates. Being able to assume best intentions and lead with the same is instrumental in effective communication and aids the software development lifecycle in running smoothly. Communicating one’s ideas without stepping on toes, or understanding needs without being explicitly told, makes teamwork dreamwork™.</p><p>Being attentive, really attentive, to the minutiae of the work being done is another x-factor for our hires. People with the ability to rigorously test their code before opening a PR, or who can use that skill to aid in finding better ways to implement a feature are invaluable to an engineering organization. They save time in test and maintenance.</p><p>Which brings us to drive. It’s not enough to be able. There are thousands of excellent singers with pretty faces (looking at you, Bublé), but 99.9% of them lack the drive, connections, and luck that it takes to make a career out of it.</p><p>The same holds true for anyone contributing to the SDLC. Being a truly solid software engineer, QA engineer, DevOps engineer, or machine learning engineer requires the ability to drive your own workflow. To seek out problems which arise and settle them. To predict where issues might come about and prepare for them. Essentially, to be a grownup and do your job.</p><p>With these pillars (and others) in place, the trust which was once assumed through centralizing workers in tiny, neck-height, hideously-carpeted walls without a door, can be ensured through the personality and skill set of a given developer, designer, PM, etc.</p><p><strong>Keeping it Productive</strong></p><p>Goodwill, talent, drive, and empathy are important. Maintaining order and purpose requires means beyond those of the individual. Our teams and rituals are designed to elevate those needed attributes to a thrumming hive of productivity.</p><p>Work groups are arranged into cross-disciplinary pods (hi, weird SCRUM dolphin reference), and the workflow is managed by a product team — one member of which resides within the pod. Design, development, QA, and product all have an equal space and voice within these groups.</p><p>Rituals (standup, retrospectives, backlog grooming, and planning) are preordained and allow the team to share what they’re working on, reduce friction, and develop camaraderie. All of these rituals take place on Zoom, have a stated agenda, and are lead by whomever is available to attend. Keeping focus in this way allows for not only the completion of work, but the ability to tackle incoming work from other stakeholders within the company.</p><p>Having each of these take place via video call allows those remote workers (an increasing number) to feel connected to their pod, and informed of decision-making and timelines. In short, to feel included and contributory.</p><p><strong>Talent lives everywhere</strong></p><p>Dia&amp;Co. is a NYC-based institution. It grew up there, and there it will remain. Many of the best developers, QA, designers, PMs, and DevOps folk on Earth live and work there already. But, talent lives <em>everywhere</em>, and finding someone with the skills listed previously — specifically the empathy and drive bits — is exceedingly hard, even in a market as big as NYC.</p><p>So, we search outwardly to find the best fit, regardless of their place in the States. And, for those team members on staff in NYC, having the added flexibility to “WFH” when needed cushions what already is a fantastic work environment.</p><p>Dia&amp;Co. has engineers in Oregon, Illinois, Michigan, Pennsylvania, California, Maine, and a host of other places throughout the United States. And we’re growing. (<a href="http://www.dia.com/careers">Join us!</a>)</p><p><strong>My Picnic Table and the Future of Work</strong></p><p>After a day of shipping deliverables from my kitchen and writing this post from a picnic table, I am able to really appreciate the trust placed in me by my employer. That trust, and the adaptability of the engineering team at Dia&amp;Co. due to its distribution, are the future of work.</p><p>And, as rents increase in major work hubs and more experienced developers move out to the country to raise their families — or raise alpacas in their spare time previously-lost to commuting — distributed teams will likely be the future of work for our industry.</p><p>I’m going to close my laptop now, buy a guilt-precipitated coffee from the donut shop whose internet I’ve been Bogarting all afternoon, and walk home to see my family.</p><p>As I do so, I’ll not be thinking about the advantages of remote work; but, of my incredible luck at having found a group of empathetic, kindly, skilled, and professional colleagues at Dia&amp;Co. My feeling included (despite being miles and miles away) is all the proof that I need that ours is the coming way for our line of work. See you in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a4c57ae6723" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dia-co-engineering/my-everywhere-nowhere-office-4a4c57ae6723">My Everywhere/Nowhere Office</a> was originally published in <a href="https://medium.com/dia-co-engineering">Making Dia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Little Refactoring Goes a Long Way]]></title>
            <link>https://medium.com/dia-co-engineering/a-little-refactoring-goes-a-long-way-e029965da1de?source=rss----f3878277f0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/e029965da1de</guid>
            <category><![CDATA[rspec]]></category>
            <category><![CDATA[refactoring]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Aaron Baker]]></dc:creator>
            <pubDate>Fri, 14 Dec 2018 12:31:01 GMT</pubDate>
            <atom:updated>2018-12-14T15:44:39.854Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9S-soH1G0iLVcjdGpOeTTg.jpeg" /></figure><p>A couple months ago we published a <a href="https://making.dia.com/testing-csv-files-in-rails-on-the-fly-7a1285cc2aac">blog post</a> about testing CSVs without fixtures. At that time, our application had one place where CSVs were being used to upload data and the solution was right for that use case. However, in the pipeline there were additional planned usages of CSVs across the application.</p><p>When revisiting the CSV processing code we realized the code was rigid and focused on only one part of our application. To solve this we refactored the code in a way that splits up the current functionality and allows us to continue adding new CSV uploads to the app with as little effort as possible. The underlying code was completely rewritten so it’s easier to read, maintain, and test.</p><h3>Planning the Refactor</h3><p>The refactor was focused on splitting our existing functionality into two paths: One for creating new products and the associated product styles, the other for just creating product styles for existing products. In order to achieve this result, we had two options. One was to use inheritance by providing a master CSV processor from which the two flows would inherit, the other was to use composition to tie the system together. To avoid too much of a refactor, we decided to work on top of the existing design using inheritance.</p><h3>Trying Inheritance</h3><p>The idea was to create a series of processors that inherit from a core CSV processor. Depending on what you wanted to upload, you would initialize the respective processor class. This removed the many conditionals inside each processor, but introduced a few problems.</p><h4>Readability and Indirection</h4><p>One of the problems was a lack of readability due to indirection. Code was constantly bouncing between parent and child.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/00a279939dbef8aca4c5ce210815693c/href">https://medium.com/media/00a279939dbef8aca4c5ce210815693c/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1283a6172f1357fd4c4e0bf0252fd53b/href">https://medium.com/media/1283a6172f1357fd4c4e0bf0252fd53b/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/48e73cf64f40caae3c467048fccd116e/href">https://medium.com/media/48e73cf64f40caae3c467048fccd116e/href</a></iframe><p>As you can see, the flow of information is very unclear. The “process” method is called on the child, which calls “process” on the parent, which calls “process_row” on the child (or grandchild, then child). This back and forth calling made the flow difficult to follow, debug, and test.</p><h4>Testing</h4><p>The main pain point in using an inheritance approach was testability. It was nearly impossible to isolate pieces of the code to test. This resulted in many duplicate and unmaintainable tests that covered far too much.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e0973d474f72cf69671f2b262636de0/href">https://medium.com/media/0e0973d474f72cf69671f2b262636de0/href</a></iframe><p>There were over 100 tests like this, going through the entire workflow with simulated CSVs. Testing individual product or product style attributes was impossible because everything was so intertwined. Inheritance seemed to be the core cause of the issue, so during a Friday Funday we took some time to try a different solution using composition.</p><h3>Trying Composition</h3><p>The composed system took the master and child processors and split them into a reader class and assorted processor classes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a09e6b11f7e2accf026870a41e0f4a2/href">https://medium.com/media/4a09e6b11f7e2accf026870a41e0f4a2/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/783e3195c29933ab8c27fee1d5ba7b83/href">https://medium.com/media/783e3195c29933ab8c27fee1d5ba7b83/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/34e5f414a374ed8612965cc8789d7d6b/href">https://medium.com/media/34e5f414a374ed8612965cc8789d7d6b/href</a></iframe><p>The reader takes in a processor as an argument and calls out to it with each row of the CSV. The processors call out to other services to format and create data. This also allowed us to dramatically improve our tests.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d12e74735333d0785248c65d52d5e75/href">https://medium.com/media/0d12e74735333d0785248c65d52d5e75/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/50300395f1cafc0c31d678d2f036f716/href">https://medium.com/media/50300395f1cafc0c31d678d2f036f716/href</a></iframe><p>This method removed indirection, and allowed us to test processors and creators individually with isolated pieces of data, rather than with full pseudo CSVs. The general flow of information also became much more clear with explicit services rather than implicit inheritance overrides.</p><h3>Making a Decision</h3><p>Although it was more work to implement, the composition path made more sense for the future of the CSV processing feature. It allowed each piece of the process to have clearly defined responsibilities and allowed us to unit test each part of the process. It’s now pretty clear how each piece of the puzzle works and makes further extension simpler and cleaner.</p><h3>Revisiting Fixtures</h3><p>By making this refactor, we reduced the number of end-to-end CSV tests needed from over 100 to around 15. Since we no longer have such a large amount of CSV test cases to maintain we’ve gone back to using a small set of CSV fixtures. Everything else can be unit tested with small sets of data only relevant to the service being tested.</p><h3>Wrap Up</h3><p>Sometimes in the interest of speed, it’s easier to pile bad code onto a less-than-ideal architecture. I’m glad we were given the opportunity here to take a step back and rethink the architecture, knowing future developers will need to understand and extend it.</p><p>By using composition we ended up with a much more robust CSV processing solution. The code is easier to read, test, and extend. We have since added many more CSV uploads using this core structure and we continue to add more.</p><h3>See also</h3><p><a href="https://making.dia.com/testing-csv-files-in-rails-on-the-fly-7a1285cc2aac">Previous Article</a></p><p><a href="https://medium.com/humans-create-software/composition-over-inheritance-cb6f88070205">Composition &gt; Inheritance</a></p><p><em>Originally published at </em><a href="https://gist.github.com/ebf835ba982c0d1dea1d0edf2800ccb0"><em>gist.github.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e029965da1de" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dia-co-engineering/a-little-refactoring-goes-a-long-way-e029965da1de">A Little Refactoring Goes a Long Way</a> was originally published in <a href="https://medium.com/dia-co-engineering">Making Dia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Testing CSV Files in Rails (on the fly)]]></title>
            <link>https://medium.com/dia-co-engineering/testing-csv-files-in-rails-on-the-fly-7a1285cc2aac?source=rss----f3878277f0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/7a1285cc2aac</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[rspec]]></category>
            <dc:creator><![CDATA[Pat Walls]]></dc:creator>
            <pubDate>Wed, 19 Sep 2018 14:01:02 GMT</pubDate>
            <atom:updated>2018-09-19T14:01:02.123Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*143qCDpww31xSFrimYJlqg.jpeg" /></figure><p>At Dia, we’ve built much of our own backend operations tools from the ground up such as Inventory and Warehouse Management Systems on Rails, Postgres, and AWS.</p><p>In our Inventory Management System we manage thousands of products and styles. We also keep track of every single item of the several million garments that have been entered into our inventory system.</p><h4>The feature: Mass upload through CSV</h4><p>We were tasked to build a feature to allow our merchandising team to mass upload new items that have been purchased from various vendors through a CSV file.</p><p>Before this feature, our merchandise team had to manually add new styles into our system one by one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cjCZK5UGf5YBTg_T" /><figcaption><em>Example CSV</em></figcaption></figure><h4><strong>Complexity &amp; handling associations</strong></h4><p>Our styles have many required properties including color, size, pattern, brand, etc.</p><p>Having this logic built into the CSV creates a lot of room for error when we import because many of the properties of our styles are not just string columns in our database — they are often associations represented by a foreign key.</p><p>For example, in the image above, the data in the pattern column is represented by a name. When we upload the CSV we must query our patterns table independently to ensure a pattern exists with that name.</p><p>There are many scenarios where things can go wrong in the CSV import. We wanted the unit tests to be robust while keeping things flexible and maintainable.</p><h4><strong>Saying no to fixtures</strong></h4><p>The traditional way to test CSV files in rails is with <a href="https://api.rubyonrails.org/v2.3.8/classes/Fixtures.html">fixtures</a>. Fixtures are a way of organizing data that you want to test against — they are also saved as a separate file in your repository.</p><p>We quickly found that fixtures were not flexible enough, because:</p><ul><li><strong>We would need dozens of fixture files</strong> to handle the many different cases.</li><li><strong>Fixtures can be hard to maintain.</strong> If we add an extra column or change the value of a column from string to an integer, we would have to update all of the fixture files.</li><li><strong>It can be tough to grok your test cases </strong>since the data is stuffed in another file.</li></ul><h4><strong>A more flexible solution</strong></h4><p>We came up with a solution to build up CSV files on the fly, and define our test data inside of our spec file.</p><p>At a high level, we:</p><ol><li>Define the rows and columns of a potential CSV scenario.</li><li>Write that data to an actual CSV file.</li><li>Run that CSV through our CSV import class.</li><li>Test the results with RSpec.</li><li>Delete the file.</li></ol><p>This allows us to spin up hundreds of different CSV scenarios in one go.</p><h4>Breaking down the code</h4><p><strong>Defining the columns and rows with RSpec:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68ca2c134543e354a68cd7b8e753b93f/href">https://medium.com/media/68ca2c134543e354a68cd7b8e753b93f/href</a></iframe><p>This allows for a lot of flexibility. For example, we might only want to change one thing in row2 in another scenario. To do this, we can add one more let call inside of a new context:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3cf802b7074a950626fd5f89f95ba9d/href">https://medium.com/media/a3cf802b7074a950626fd5f89f95ba9d/href</a></iframe><p><strong>Building up the CSV:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/83b10da8ba8ee8dc15a8cbff07b68922/href">https://medium.com/media/83b10da8ba8ee8dc15a8cbff07b68922/href</a></iframe><p>With our defined rows, we build up a CSV file inside the filesystem.</p><p>We save it in the /tmp directory under test.csv.</p><p><strong>Actually testing the CSV:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f351d05a5ae4f52f8e983e8705adaa7/href">https://medium.com/media/2f351d05a5ae4f52f8e983e8705adaa7/href</a></iframe><p>This is the actual class that we are testing, and all we have to do is pass in the file path since we are always saving our file there right before this code is run.</p><p><strong>Deleting the file:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d27a566d5830fb84abef48d3e9a58d0/href">https://medium.com/media/2d27a566d5830fb84abef48d3e9a58d0/href</a></iframe><p>After every test we delete the file just to be safe.</p><h4><strong>Testing the results</strong></h4><p>Having that code in place, we wrote tests actual tests on the business logic.</p><p>For us, this meant testing at the database level to ensure records are getting created/updated as expected. And for the negative scenarios, we tested that proper validation errors are being captured and presented to the user.</p><h4><strong>Limitations of our approach</strong></h4><p>With most technical solutions there are often downsides.</p><p>This solution was a byproduct of one single CSV upload <em>trying to do too many things</em>. When you have so many different scenarios of data input, the code can get intricate, leading to errors — as most of the business logic is encapsulated in one Ruby class.</p><p>For this reason, we are working with our product team to break the upload into several smaller, more specific uploads so we can separate out some of the CSV processor logic into more maintainable chunks.</p><p>As a feature becomes more complex, it’s important to embrace this separation of concerns.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a1285cc2aac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dia-co-engineering/testing-csv-files-in-rails-on-the-fly-7a1285cc2aac">Testing CSV Files in Rails (on the fly)</a> was originally published in <a href="https://medium.com/dia-co-engineering">Making Dia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AMP on Rails]]></title>
            <link>https://medium.com/dia-co-engineering/amp-on-rails-3f491a06ba3d?source=rss----f3878277f0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/3f491a06ba3d</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[amp]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Matthew Ciampa]]></dc:creator>
            <pubDate>Thu, 22 Mar 2018 14:01:01 GMT</pubDate>
            <atom:updated>2018-03-22T14:01:01.440Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tm6MCiQ8p8mtdL0k8NtoZw.jpeg" /></figure><p>At Dia, we’re constantly trying to improve our user experience and a big part of it is serving our pages faster to customers with slower network connections. Since we serve customers throughout the US, and not just in major cities, many of our users are on mobile devices that still use 3G connections. There’s also the case of a potential customer on the subway or out in the country where availability can be limited. So what can we do about that?</p><p>Our main goal is to create a better first-page experience for our customer, and in order to do that, we need to take a closer look at our load times and how we can improve upon them. First, incrementally bring down the load time of our existing experience without having to re-write too much HTML/CSS. Second, create a mirror of our landing page using <a href="https://www.ampproject.org/">AMP</a> to serve our organic mobile users from Google search results at a much faster rate.</p><h3>What is AMP? ⚡</h3><p>AMP is an open sourced Google project centered around providing <strong>A</strong>ccelerated <strong>M</strong>obile <strong>P</strong>ages to users through search. AMP is a way for Google to cache a static version of your page to serve up quickly to mobile users in search results.</p><p>AMP pages have strict rules that attempt to blacklist anything that could have a negative performance implication. It removes the ability to use things like !important in CSS and disallows any JavaScript that isn’t run within the context of an AMP component. If you’d like to learn more, check out their <a href="https://www.ampproject.org/docs/">docs</a>.</p><h3>First Pass Before AMP</h3><p>The way our static assets are built vary depending on where you are in our experience. Little more than half of our views are in React and bundled through webpack and split by view. The rest still lives within Rails’ asset pipeline, which is only bundled once for all views. That means, on our homepage, we’re serving those beefy application.js and application.css bundles on each page-load. They weren’t too bad, application.js hovered around 112kb uglified + gzipped and our application.css around 55.4kb. What if we built separate bundles just for the homepage? We could maybe just create a homepage webpack bundle should only include the things we need? Do we really need jquery, lodash, etc. for our JavaScript and on our Sass side, we probably can rid most of our dependency on bootsrap3 and in-app component styling?</p><p>What we ended up with was pretty staggering in file size change. It turns out we didn’t need ~111kb of that JavaScript bundle and ~50% of the CSS bundle. Our home.js webpack bundle now hovers around 1.4kb gzipped and our CSS bundle around 22kb! That represents a 98% decrease in JavaScript file size!</p><p>Our main bottleneck with load, and still is today, has to do with our images. We have a lot of them, each with a lot of color information. We did another pass on compression and reducing file size where we could. The problem that we’re still facing today, is due to the fact that all of our images are loaded through our CSS file and that makes it hard for us to make some really good optimizations without having to do a markup re-write. Following this article, we plan to defer image load for assets outside of our viewport and do a few other cool things to help boost our load times.</p><p>From the perspective of a customer on a 3G connection, this probably still doesn’t mean the difference between a bounce and her staying and learning about all the awesome things we do! AMP to the rescue!</p><h3>How We Implemented AMP</h3><p>Since we’re running our landing page through Rails, we’ll need a way for Rails to distinguish between the AMP version of our page and our normal HTML page. Easy enough, we decided to simply create a new mime-type that aliases text/html. This an easy addition to your mime_types.rb file:</p><pre>Mime::Type.register_alias(&#39;text/html&#39;, :amp)</pre><p>This has the following benefits:</p><ul><li>Preserve the same action to distinguish between an AMP page and non-AMP version of the same page so we can simply call the page with format=amp to serve us the AMP version.</li><li>Create separate layout files and templates for AMP pages. We’ll need to include AMPs JavaScript and CSS.</li><li>Allow us to add number of AMP pages later if we need to.</li></ul><p>CSS became one of the larger earlier challenges for us. AMP requires you to write all of your CSS inline in the head through a &lt;style data-custom/&gt; tag that also has a file-size limit. The problem is, all of our CSS is defined through Sass and if our goal is for both the AMP and non-AMP to mirror, there’s no sense in forcing ourselves to re-write all of our CSS within our head, 🤢! We decided to bite the bullet and output the contents of our built CSS bundle into this tag via a small helper method:</p><pre><em>def </em>amp_stylesheet<br>  asset =<br>    <em>if </em>Rails.env.development?<br>      Rails.application.assets.find_asset(&quot;path/to/asset&quot;)<br>    <em>else<br>      </em>File.read(<br>        Rails.root.join(<br>          &quot;public#{stylesheet_path(&quot;path/to/asset&quot;)}&quot;<br>        )<br>      )<br>    <em>end<br><br>  </em>raw(asset)<br><em>end</em></pre><p>This ended up working out well for us. We had access to our style guide CSS, retain the file structure/separation and ability to still use our production compilation step during CI builds.</p><p>Being able to think about the page as mobile-only not only feels amazing (because that never happens 🙂), it provides you with a different set of rules that you need to follow when constructing the markup for these types of pages. For example, in the below image, we only need to deal with column A. The problem with how we setup column B is around having the image load within our CSS. Doing this, we’re not able to defer the loading of the image. Why not take advantage of &lt;amp-img /&gt; with it’s lazy-loading and responsive capabilities?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sje_z4a-ffwklBuG5-BGWw.jpeg" /></figure><p>Having so many images on our site, this ended up being an even larger win for us. Now all images except for those above the fold will be deferred in loading until they’re scrolled into view!</p><h3>Pitfalls to Avoid</h3><p>With all this fun stuff, there were definitely a few road bumps along the way that we needed to iron out before we could really get this page live. There are just some things that will start to get clunky in working with AMP and it’s expected; It’s a completely different workflow and adheres to a very strict set of rules that must be followed or else the page will not be indexed.</p><h4>JavaScript</h4><p>Firstly, you cannot write your own JavaScript and it will prevent Google from indexing your page if any exist. All JavaScript needs to live within the context of AMP ‘components’. You need to ensure that there are is no javascript lingering behind feature flags, analytics or error reporting tools.</p><p>We ran into a few cases of this. New Relic, for instance, will insert JavaScript at the head of your page only within — for our case — a production context. It’s use cases don’t apply since the page is not within the app so we we’re able to just remove it. That might not always be the case, though.</p><h4>Analytics</h4><p>All analytics will need to run through AMP’s &lt;amp-analytics /&gt; component that whitelist different providers (their list is not very long 🙂). With pixel tracking, it’s a little more lenient but worth a read through the docs before getting started.</p><h4>Testing</h4><p>Sometimes things don’t always work as intended and we as humans are more than prone to creating bugs! The problem with AMP is that, since the page is indexed and the search result handles the redirect, reverting things isn’t immediate and straightforward. If you feel it’s necessary, like we do, create a feature flag to disable the view-ability of the AMP page along with the related canonical urls in the case of a severity 1 bug. This can be the difference in time between just waiting for Google to kick off the cache removal and de-index or waiting for a pull request and CI build to run and deploy along with the cache removal.</p><p>Finally, general testing is a very different experience with AMP — especially if the non-AMP version of that page is rendered via the server. It’s important to always test flows in a faux cached environment that lives away from your application. AMP doesn’t know and doesn’t care about your main application session, behavior or view rendering since the cached page will live elsewhere. We simply Curl’d our in-app version of the page and uploaded the outputted HTML to another server and tested all of our different possible flows.</p><p>Ultimately, AMP cut our load times in around half on average and we’re already starting to see the benefits. In contrast, the updates to our existing page have seen nominal results with around the same amount of effort being put into both — but we’ll keep iterating on this.</p><p>If you love tinkering with the performance tab and all things JavaScript and CSS, we’d love to talk to you about joining our <a href="https://www.dia.com/careers">exceptional team</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f491a06ba3d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dia-co-engineering/amp-on-rails-3f491a06ba3d">AMP on Rails</a> was originally published in <a href="https://medium.com/dia-co-engineering">Making Dia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Dia Does Distributed]]></title>
            <link>https://medium.com/dia-co-engineering/how-dia-does-distributed-ed983eec6cb8?source=rss----f3878277f0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/ed983eec6cb8</guid>
            <category><![CDATA[work-life-balance]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[remote-working]]></category>
            <dc:creator><![CDATA[Natali Toupin]]></dc:creator>
            <pubDate>Mon, 26 Feb 2018 17:31:01 GMT</pubDate>
            <atom:updated>2018-02-26T17:31:01.092Z</atom:updated>
            <content:encoded><![CDATA[<p>Anyone who has met me knows I passionately believe a flexible remote culture is the way of the future. My passion comes in part because it is the future I’m building for myself. I could pontificate for hours about the whys and what-fors but that, my friends, is a different topic for a different day. Suffice to say, I have a vested interest in helping build and create what I want here at Dia&amp;Co. Here’s how we’re building a culture that promotes lasting success for remote employees on our engineering team at Dia&amp;Co.</p><p>It all starts (for me of course) in my interview at Dia, when I asked about transitioning to a remote employee, in fact, becoming the first remote employee on the engineering team. My manager didn’t so much as bat an eye at this request. While I was excited, I was also optimistically cautious. I realized that becoming the first remote employee of a co-located team was going to present several challenges. Some I knew and some I didn’t even know enough to know (isn’t that the way with most things?). So I started with a few simple and overarching questions:</p><ul><li><strong><em>Is it possible to work remotely in this organization and be effective?</em></strong></li><li><strong><em>Will leadership provide the necessary support for remote work to be successful on this team?</em></strong></li><li><strong><em>How do my teammates feel about a remote co-worker?</em></strong></li><li><strong><em>Can I work as effectively with my team when I am remote as when I’m in the office?</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hyl5TOPvE9G--F4ufzi9yQ.jpeg" /></figure><h3><em>Is it possible to work remotely in this organization and be effective?</em></h3><p>Lucky for me, there were examples that I could leverage to answer some of my questions. We already had two business critical teams that were distributed. A flexible work from home culture was embraced and actively promoted. And get this!, not just by engineering, but throughout our entire organization. Dia&amp;Co has been building a business with co-located teams, remote employees and distributed teams since its inception.</p><p>It didn’t take me long to realize that Dia was not using “remote” as a buzzword to draw in tech talent. We all know <em>that company</em> — the one that says you can work from home but there seems to be a passive aggressive sigh or rearrangement of schedules and meetings to accommodate the “flexible” schedule. The water cooler comments about what people are “really working on” when they are working remotely. To say nothing about the willingness or desire to make sure the employee is productive and happy in a remote role.</p><p>I do think it’s important here to delineate between a company that uses “remote work” as a recruitment tactic or as a “perk” to remain competitive and one that actively supports and builds the business to allow for productive remote work. It’s important to make this distinction because it is directly reflected in your ability to be an impactful member of the team while working remotely.</p><p>Are you able to attend meetings and actively participate in the discussion when all attendees are in one room with the exception of you? Are you being pulled into conversations that pertain to your area of expertise even when you are remote? Are there mechanisms in place that mark your productivity and/or solve for any productivity issues that may arise? Are you able to contribute to your team remotely? Are you someone who works well in a remote environment? Are you allowed the ability to explore if this option is right for you? These are some of the key differences you’ll find between those two organizations.</p><h3><em>Will leadership provide the necessary support for remote work to be successful on this team?</em></h3><p>It speaks volumes that at Dia, a member of our executive leadership is remote and that other members of our executive leadership team embrace working from home themselves. They demonstrate the balance necessary to contribute, be visible and available and lead while they themselves are distributed.</p><p>Additionally, Dia doesn’t let employees who are inexperienced with working remotely go remote right away because this can set them up for failure. If someone has remote experience already, no problem, but for someone interested in making the transition to remote for the first time, we spend time acclimating the employee and their fellow team members to a remote context. This is an important step for those who haven’t worked remotely before because remote work isn’t for everyone and teams that haven’t had remote members before need to get used to the new dynamic.<strong> </strong>This way, we don’t force a remote culture, we embrace a blended culture where those who prefer to be in the office and those who prefer to be remote are both well supported.</p><p>Minimally, every conference room is equipped with video conferencing software but what’s more impressive is when we discovered our first video conferencing software was subpar — we made the necessary changes to improve the situation. In addition to tooling, as the engineering team looks to hire our Director of Engineering, one of the criteria they are being benchmarked against is their ability to lead team members who are remote. These were just a few of the clear indications that remote life at Dia is not only foundational and cultural, but actively reinforced by leadership. So at Dia&amp;Co, if you need to work from home or take a trip and work remotely, there really isn’t anything to it — just add it to the calendar, let your team know and be on your way. If there are any issues, there will be communication and a problem solving approach to make sure everyone is happy and productive. With all of this, you can feel secure in the fact that should we determine other flaws that hinder remote, distributed or co-located team members, we’ll work to resolve that issue as well.</p><h3><em>How do my teammates feel about a remote co-worker?</em></h3><p>Just because I talk about leadership support first, does not in any way make it the most important factor to consider. In fact, I would go as far as to say the success or failure lies directly in the hands of the team. While I’m not one to believe in making business decisions based on feelings, the feelings of our team surrounding working with and collaborating with remote members is critical in how we navigate this transition. Some parts of distributed communication can be challenging at best. Asking someone who isn’t already bought in to an idea, to then accommodate that idea, makes things more difficult to manage. Luckily, I encountered no resistance as I broached this subject with the team. In fact, I was met with enthusiastic support.</p><p>In hindsight, that response should have been obvious. I work with a team that is excited for challenges, that with no egos or titles will sit down and talk through problems with the intent to solve them. A team that isn’t interested in recreating what we’ve already seen but relying on our collective expertise to create what we want to see. After all, when you <a href="https://making.dia.com/mind-the-culture-b8373c430075">mind your culture</a>, you might find yourself surrounded by a group of talented, open minded individuals who are ready to solve this problem with you. And that’s exactly where I’ve found myself.</p><h3><em>Can I work as effectively with my team when I am remote as when I’m in the office?</em></h3><p>So that brings me to my final question, given the team and my responsibilities, is it possible to deliver while being remote? This question has taken some field research to answer. In my eight months at Dia, I have spent collectively close to 3 months working remotely. I have worked from California, Kansas, South Dakota and Staten Island. In basements, on couches, at kitchen tables and from the comfort of my own home. I can honestly say, that regardless of my location — my ability to interact with my team and actively contribute hasn’t been hindered. There are a lot of little things that we’ve adjusted and talked about to make that possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vH8ISZXz9aCZrYkrqCWxeg.jpeg" /><figcaption>View from my basement desk while working remotely during the holidays</figcaption></figure><p>An example of this, is when I first started participating in meetings remotely, there were a few that I attended from someone’s laptop in the room while on a Google Hangout (we’ve all been there). I found those meetings hard to follow and hard to be an active participant. I mentioned this to our CTO and to the team in retro. Since that time, we have made a point to schedule meetings in rooms with video conferencing equipment. Now, I am able to actively participate in the conversation and/or meeting — not just because the equipment is available, but also because I am being treated as if I am in the room not just an afterthought. Another example, is how we’ve moved from daily standup at 10:15am EST in a meeting room with a hangout laptop to providing our daily standup updates with a slack bot in a channel.</p><p>There are sure to be other challenges as we build this flexibility in to our team and add distributed team members; however, I have zero doubts that we will overcome them with our ego free, autonomous and iterative approach to problem solving.</p><p>If this flexible culture speaks to you, we’d love to talk to you about joining our <a href="https://www.dia.co/careers">exceptional team</a>. Get in touch!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed983eec6cb8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dia-co-engineering/how-dia-does-distributed-ed983eec6cb8">How Dia Does Distributed</a> was originally published in <a href="https://medium.com/dia-co-engineering">Making Dia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Rollback is not the Solution but the Problem]]></title>
            <link>https://medium.com/dia-co-engineering/when-rollback-is-not-the-solution-but-the-problem-25fa490e220a?source=rss----f3878277f0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/25fa490e220a</guid>
            <category><![CDATA[payments]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Arpita Dhundia]]></dc:creator>
            <pubDate>Tue, 13 Feb 2018 22:01:01 GMT</pubDate>
            <atom:updated>2018-02-13T22:01:01.212Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BMgLq8aOgfzz9Sp95-LjFQ.jpeg" /></figure><p>Database transactions are heavily used in most web-applications to ensure the integrity and consistency of data while performing writes in multiple tables, in a single piece of work. Here at <a href="https://www.dia.com/">Dia&amp;Co</a>, we’re constantly making database changes during user requests, both external and internal. We use transactions whenever we want to make sure either all changes or none are saved to the database (i.e. making multiple updates atomic in nature). We recently ran into an interesting bug in which having an operation wrapped in a transaction was causing an unforeseen complication. The real question here wasn’t “why is this happening?”, but “how should we solve it?”. Generally, in my experience, once you have clearly determined a problem, you have already half-solved it. So we put our creative hats on to find a smart yet simple solution by properly formulating this problem.</p><h3>The Bug</h3><p><a href="https://www.dia.com/how-it-works">Dia&amp;Co is an online styling service</a> for women exclusively in sizes 14 &amp; up: we send a box of 5 hand-picked items to the customer, she tries the clothes/accessories, keeps what she likes and returns the rest. She pays online after indicating which items she wants to keep (so we know how much to charge for the box) and sends the rest back as returns. Our order management and payments systems are a lot more complicated than that of a traditional retail or e-commerce. We charge based on intention but also have to reconcile on the basis of receiving returns as well as *not* receiving the expected returns after a certain time period. Eventually what the customer paid for a box is determined by this multi-system coordination.</p><p>Recently, we noticed that for one particular case when the customer was paying for her items online, if the actual charge fails, there is no record of the failed payment in our system. This results in data inconsistencies between our payment providers like Stripe or PayPal and our internal system, e.g. our system would show that the order is not paid, but looking at our data we wouldn’t even know that the customer attempted to pay but the payment failed. Our Customer Support team would have to look at an external dashboard (e.g. Stripe’s) to understand what’s going with an order. Now, that sucks.</p><p>Why was this happening? Because, all of the checkout code was wrapped in a single database transaction, which was committed only if all steps succeeded and was rolled back - at any point of failure. In short, when charging the customer failed, the failed payment record that we saved was being rolled back</p><h3>Finding a Solution</h3><p>To start, it was important to understand exactly what happened when a customer performed checkout. At a high level our controller action performed the following steps:</p><ul><li>Creates an order for the box and add all items that the customer decides to keep to the order</li><li>Charges her (e.g. via Stripe)</li><li><strong>Saves a payment record in our database with state failed/succeeded according to the response from Stripe.</strong></li><li>Updates the order state to paid if payment was successful and display an appropriate response to the customer.</li></ul><p>Here is a simplified version of the code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a1980d0ab726edc393d38aeebccb0dbe/href">https://medium.com/media/a1980d0ab726edc393d38aeebccb0dbe/href</a></iframe><p>As evident from the code, when order.pay! failed, the rollback on line#13 is triggered hence undoing all changes to the database including the failed payment record. Looking at this we knew we had to move creating the payment record out of the main transaction. We played around with the idea of wrapping order.pay! method in its own <a href="http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html">true nested transaction</a>. The code looked liked this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1cd167a616f4eea945501ad763363961/href">https://medium.com/media/1cd167a616f4eea945501ad763363961/href</a></iframe><p>Since the rollback was happening in the outer transaction, it would still cause the inner to rollback. A true nested transaction only guarantees that it can be rolled back, but it is committed with the outer transaction, so its not independent of it. We couldn’t easily rearrange the code such that the ‘pre-payment’ steps like calculating the order total and attempting to pay, could happen in two distinct yet nested transactions, while ensuring that pre-payment rolls back when order.pay! fails.</p><p>Now if ‘Payments’ was its own Microservice we wouldn’t have this bug at all. The order.pay! part of the code would belong to the Payments Service, which means the two database transactions in the above code snippet would be independent of each other since they would be created by completely different processes running on separate boxes, thus automatically providing the necessary decoupling of the transactions. Another reason why asynchronous transactions are better is because long operations should not be performed inside a single transaction — that can cause resource contention in the database as it involves locking of certain rows and tables. So is creating a Payments service the answer we’re looking for?</p><p>At Dia, we have carefully taken a <a href="https://martinfowler.com/bliki/MonolithFirst.html">MonolithFirst</a> approach, which continues to work well for the current size of our engineering team. This bug is definitely not a big enough reason to begin our microservices journey, in fact it probably doesn’t even come close to answering any of the <a href="https://martinfowler.com/bliki/MicroservicePremium.html">questions a team should ask before considering microservices as an architecture</a>. Though, coming back to the problem in hand, we realized that <strong>decoupling</strong> creation of the payment record from the user request was the key to our solution. That was our lightbulb moment!</p><h3>The Winner</h3><p>We decided to throw the failed payment’s serialized object at a background worker, which would create the record asynchronously…Voila! We have a beautiful solution which looks something like this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff5405e836fe7958645a64b31baabbbb/href">https://medium.com/media/ff5405e836fe7958645a64b31baabbbb/href</a></iframe><p>P.S.- You may wonder why we didn’t save both failed and successful payments asynchronously, since we wont need the extra if statement then. The main reason is because box.checkout! relies on successful payments to be available as soon as order.pay! finishes. Saving successful payments asynchronously will make the behavior of box.checkout! unreliable and often incorrect.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25fa490e220a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dia-co-engineering/when-rollback-is-not-the-solution-but-the-problem-25fa490e220a">When Rollback is not the Solution but the Problem</a> was originally published in <a href="https://medium.com/dia-co-engineering">Making Dia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Deploy Software]]></title>
            <link>https://medium.com/dia-co-engineering/how-we-deploy-software-39088e6af996?source=rss----f3878277f0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/39088e6af996</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[continuous-deployment]]></category>
            <dc:creator><![CDATA[Zachary Friedman]]></dc:creator>
            <pubDate>Fri, 15 Sep 2017 20:01:00 GMT</pubDate>
            <atom:updated>2017-09-15T20:01:00.730Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6K5vmzalJUxn44v3cm6wBw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/oZPwn40zCK4?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Thomas Kvistholt</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>People have written amazing articles on <a href="https://zachholman.com/posts/deploying-software">deploying software to production</a>. One of the best quotes I’ve heard about deploys in the last two years is from early GitHub engineer, <a href="https://twitter.com/holman">Zach Holman</a>:</p><blockquote>Your deploys should be as boring, straightforward, and stress-free as possible. Deploying major new features to production should be as easy as starting a flamewar on Hacker News about spaces versus tabs.</blockquote><p>I couldn’t really state our end goal better than this, so I won’t even attempt to redefine what we are ultimately shooting for. It’s exactly this. What I will do is attempt to tell the complete story of how and why we recently changed our deployment process at Dia&amp;Co., what the benefits of doing so were, and what we still have standing in between our team and boring deploy nirvana.</p><p>By way of background, we have two major, protected branches on GitHub, master, which corresponds to our staging environment, and production, which, you guessed it, maps to our production environment. We branch features off of master, make pull requests back into master, perform code reviews, run our CircleCI build, and run our automated linting in those pull requests, and when accepted, we merge into master. Once that merge happens into master, CircleCI will kick off a build that ultimately results in a deployment to staging. The same is true of our workflow for deploying features to production.</p><h4>The Exact Moment We Realized We Had a Problem</h4><p>Once our engineering team size reached a certain headcount, the pipeline of new features to production got a little too hectic. We generally respect the boy scout rule of taking one story from our backlog at a time, so our GitHub pull request page would roughly have one open pull request per developer at any given point in time. This is totally manageable with a small set of engineers, and for awhile, this worked just fine for us.</p><p>We noticed that as we added more engineers, we were not deploying software any more frequently. In fact, we were probably deploying a little less often, which is really a business problem, one that we needed to correct in order to maximize the impact of our engineering team.</p><h4>Refactoring Our Process</h4><p>We started to think about what was causing our deployment frequency to decline or stagnate, as one would expect that with a product of increasing complexity and more engineers building features, that the opposite would occur.</p><p>One of our consistent bottlenecks over the past year or so has been QA and UAT. Previously this responsibility fell to the product manager, who in addition to the full-time job of being a product manager, was also a part-time QA analyst. As with most part-time jobs one attempts to perform simultaneously with his or her full-time job, one can expect to do that job pretty poorly, and for good reason. Finding time to perform QA was near impossible, so it would tend to get done in chunks of time that had more to do with the product manager’s schedule than our product deployment needs. Our product managers did a fantastic job of juggling multiple priorities with respect to this, but it was a problem we felt that we could pretty easily remove from their day-to-day.</p><h4>“Real” QA</h4><p>After a lot of searching, we found a pretty badass QA analyst who wanted to work with our team. I personally had not had much experience working with QA before, so I was interested to see how this role would fit into our existing process, which was wholly driven by automated testing and manual testing from people who had a lot of other things to do at a given point in time.</p><p>My biggest observation over the past couple of months has been that the job title of QA is a complete misnomer.</p><blockquote>When performing at its highest level, QA doesn’t just assure quality, they drive it, both in the product and in the overall software development lifecycle.</blockquote><p>So what’s the point in mentioning all of this? Another major bottleneck in our old deployment process was a bit of a game theory problem, ultimately related to answering the question of who deploys, and when.</p><h4>Who’s On First</h4><p>Previously, an engineering team member would be responsible for creating a deploy, and pull requests were merged into master, generally whenever they were accepted in code review, but not quite, because one always had to take into account how much was on master (staging) currently, because with increased deployment size, the risk of breaking something in production goes up.</p><p>This created the need for a concept which was referred to by two words which I will never enjoy hearing said together: <strong>merge freeze ⛄️</strong>. Merge freeze is terrible for a couple of reasons. For starters, I’m not sure exactly how much deploying is the right amount of deploying, but I can assure you, we haven’t even begun to approach that limit. The entire point of the work that our team does is to have an impact on our business. Leaving features that will make our customer’s or our employee’s lives better in a GitHub pull request because we cannot take on the additional risk of including it in the next release just sounds silly to me. Especially if we can avoid it by largely decreasing the risk. And the way you de-risk software deployments is by making them smaller. Like <em>much</em> smaller.</p><p>So now that we have a QA owner, there is really one primary owner of our staging environment. That being the case, really the only team that needs to merge pull requests into master is the QA team itself. The merge freeze problem is eliminated by eliminating engineers merging to master. Engineers still merge features or stories that we refer to as “engineering acceptance”, which would be a non-customer facing change, for instance. Now, QA decides what to merge and when, thereby controlling exactly what is on our staging environment at any time, and tailoring the pace of deploys to match the pace of QA.</p><h4>So What’s Left?</h4><p>Many companies have written about how they deploy software to production 50 to 100 times per day. Intercom has a <a href="https://blog.intercom.com/why-continuous-deployment-just-keeps-on-giving/">great article detailing how and why they ship over 100 times per day</a>. We certainly desire similar benefits in our own deployment process, namely the invaluable feedback loop of deploying smaller changes more frequently. Doing so would require fundamentally changing our entire process of working on many levels, so we’re also cautious about blowing up a system of delivering impact that has served us well, and continues to. One of our core values at Dia&amp;Co. is “take off with a denim parachute”. The story behind the name warrants an explanation out of scope for this post, feel free to ask me on Twitter if you are interested 😀, but what it means is basically: Lead with a get-it-done attitude. Drive exceptional outcomes with fewer resources. Creativity is your currency. How this applies to deploying software is that while continuous deployment has a number of benefits, our current process represents an order of magnitude improvement over our previous process, and it probably quite stage-appropriate for our current needs.</p><p>If you are interested in thinking about deploying software, and working with a team that is changing the fashion industry in a permanent way, please reach out to me or <a href="https://www.dia.com/careers">apply to join our team on our careers page</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39088e6af996" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dia-co-engineering/how-we-deploy-software-39088e6af996">How We Deploy Software</a> was originally published in <a href="https://medium.com/dia-co-engineering">Making Dia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ABC: Always Be benChmarking]]></title>
            <link>https://medium.com/dia-co-engineering/abc-always-be-benchmarking-5854252fc6b1?source=rss----f3878277f0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/5854252fc6b1</guid>
            <category><![CDATA[modeling]]></category>
            <category><![CDATA[research-and-development]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Alex Abate]]></dc:creator>
            <pubDate>Thu, 07 Sep 2017 15:01:09 GMT</pubDate>
            <atom:updated>2017-09-07T15:01:09.220Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YcY2118N6R77jYuBZUifdQ.png" /></figure><p>Here at Dia&amp;Co coffee is for everyone! And our workplace is perhaps as far as you can get from what was depicted in the legendary <a href="http://www.imdb.com/title/tt0104348/">1992 film Glengarry Glen Ross</a>.</p><p>That being said there is still value in the ABC: Always Be benChmarking! Much of what we do right now at Dia is creating new models, with freedom to choose their implementation, so a decent amount of R&amp;D is required.</p><p>A question I found myself asking was the seemingly nonsensical “what is good and how do I get there?”. We’re just about sensible enough to know that we won’t make a near-perfect model on the first iteration, but when do we determine we have our MDP: minimum deployable product?</p><p>A simple empirical way to get towards “good” is to study the delta-improvement in the model as you add increasing complexity. However you want to do this as consistently as possible, and in the face of perhaps somewhat unknown new directions. So here’s an overly enthusiastic guide to adhering to your own low-tech benchmarking ethos:</p><ul><li><strong>Spend a lot of time thinking about the data you will use,</strong> so you can design model independent and implementation independent ways of engineering your features. This will reduce the amount of times you need to go back and modify the definitions of your features, which makes each iteration more difficult to compare.</li><li>Always <strong>plan out the next few implementations you intend to try</strong> and develop your code base with the extensions in mind. Make sure you always design simultaneously for at least the current step and the next step in the plan, and hopefully the extensibility of your model will follow on naturally from this.</li><li><strong>Keep the data extraction and feature engineering stages separate from the model building stage</strong>, and make sure they are well indexed, meaning that “model i was run on data j” is something that is recorded.</li><li><strong>Create basic infrastructure that stores all attributes associated with the model you ran</strong>. This can be as straightforward as saving the results in a pickle file along with the code commit-hash, python environment details, config parameters etc:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dfd49d2318ae86a6389cc8be9f55cda8/href">https://medium.com/media/dfd49d2318ae86a6389cc8be9f55cda8/href</a></iframe><ul><li><strong>Set a minimum benchmark for performance.</strong> What is the most naive thing you could use as a predictor? How well does that perform? A sophisticated model should do better than this and you can use this to define success!</li><li>Finally, <strong>when is good good enough</strong>? Think less about every machine learning performance metric you’ve ever heard of and think instead about what matters for your particular problem. If given data X the model produces outputs y: does that improve upon or worsen the current system? Take a step back and run simulations of realistic outputs given an assumed performance level, study their likely impact, and use this to help inform your decision.</li></ul><p>Sticking to such a plan not only helps you efficiently converge to the MDP, but also allows the pieces you build along the way to be generically useful for other applications, saving you or others work in the future.</p><p>So if you’d like to join a workplace that celebrates <a href="https://www.instagram.com/explore/tags/ootd/?hl=en">#ootd</a>, bagels, movie nights and karaoke over competing for steak knives, follow the lead over to <a href="https://www.dia.com/careers">our careers page</a> — we’re hiring!</p><p><em>Thanks to Zuzanna Klyszejko, Christopher Morrison, Alec Baldwin</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5854252fc6b1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dia-co-engineering/abc-always-be-benchmarking-5854252fc6b1">ABC: Always Be benChmarking</a> was originally published in <a href="https://medium.com/dia-co-engineering">Making Dia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>