<?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[Zulily Tech Blog - Medium]]></title>
        <description><![CDATA[Learn about Zulily’s development teams, job opportunities, tech talks and more. - Medium]]></description>
        <link>https://medium.com/zulily-tech-blog?source=rss----7f983e729a44---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Zulily Tech Blog - Medium</title>
            <link>https://medium.com/zulily-tech-blog?source=rss----7f983e729a44---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 14:10:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/zulily-tech-blog" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Orchestrating the Refunds Process at Zulily]]></title>
            <link>https://medium.com/zulily-tech-blog/orchestrating-the-refunds-process-at-zulily-661d2592b760?source=rss----7f983e729a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/661d2592b760</guid>
            <category><![CDATA[solution-architecture]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[zulily]]></category>
            <category><![CDATA[refund]]></category>
            <dc:creator><![CDATA[Zulily Tech News]]></dc:creator>
            <pubDate>Tue, 05 Oct 2021 19:42:43 GMT</pubDate>
            <atom:updated>2021-09-01T23:44:27.755Z</atom:updated>
            <content:encoded><![CDATA[<h4>By: Nanya Origbo, Senior Software Engineer, Shopping Experience, Zulily</h4><p>As Zulily scaled to serve millions of customers, it needed to modernize its refunds process. Its initial refunds system was highly distributed and complex, which meant it was unreliable and created gaps in customers’ experiences. We will share how our team was able to evolve our refunds technology stack and create a shopping experience that customers trust.</p><h3><strong>Problem Statement</strong></h3><p>The organic evolution of Zulily’s refunds system led to increased complexity in its architecture, with multiple teams owning different pieces of the refunds process.</p><p>The primary consequence of this evolution was a reduction in the system’s reliability, which refers to the rate at which refund requests were successfully processed. For example, the distributed nature of the system meant that it was difficult to determine when and where refunds failed. In certain cases, customers had to contact customer service in order to move their refunds along.</p><p>Furthermore, the system’s complexity reduced developers’ productivity. Debugging issues and adding new features became difficult and time consuming. Also, we did not have robust retry mechanisms which meant that retrying certain failed refunds was manual and expensive.</p><h3><strong>Proposed Solution</strong></h3><p>Addressing the above challenges required us to build a service that reliably serves as a single source of truth for anything related to refunds at Zulily.</p><p>To accomplish this, we needed to:</p><ul><li>Define <strong>service endpoints</strong> that allow clients to create a refund request as well as retrieve details about a refund request.</li><li>Implement<strong> </strong>a <strong>reliable asynchronous workflow execution mechanism </strong>that maintains a history of workflow events and proactively catches and resolves transient errors.</li><li>Implement a <strong>messaging system</strong> to alert subscribed consumers of predetermined events relevant to their use case (IE workflow success, failure etc)</li><li>Implement robust <strong>monitoring mechanisms</strong> that provide visibility into the overall system health.</li></ul><p>At the heart of our solution was the asynchronous workflow execution mechanism. The most suitable “out of the box” implementation of this mechanism that matched our use case was the Simple Workflow Service (SWF), an AWS service that provides simple workflow orchestration management and state persistence via the AWS Flow Framework library.</p><p>Other implementations of workflow orchestration and management considered include:</p><ul><li><strong>Homegrown orchestration engine: </strong>Building a custom solution to address the issues we faced was going to take longer and require more effort. Thus, leveraging an existing solution within a cloud environment that Zulily was already a part of was more appealing and cost-effective. This approach of “not reinventing the wheel” allowed us to focus on what mattered which included building a reusable workflow library for other microservices at Zulily.</li><li><strong>AWS Step Functions: </strong>Step functions were considered for the workflow execution mechanism. However, for our use case, we had two requirements that could not be achieved using Step Functions. The first requirement was we needed to implement business logic in our workflows using code instead of JSON. This was easily achieved using the AWS flow framework which provided a better developer experience. Secondly, our refund workflows had a parent-child relationship where a parent workflow could launch one or more child workflows that return a result to the parent. At the time of implementation, this parent-child feature was not available in Step Functions.</li></ul><h3><strong>Solution Architecture</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*fW0A_wDQLkAKezkPYICZew.png" /><figcaption><strong>Fig 1:</strong> High Level Architecture Diagram</figcaption></figure><p><strong>a. Service Endpoints</strong></p><p>For the service endpoints, we defined RESTful APIs for a variety of client use cases. These APIs abstract clients and consumers from the implementation details of the refund workflow and database. We decided to go with REST APIs because it was sufficient for our use case and it is an architectural pattern understood within Zulily.</p><p><strong>b.</strong> <strong>Workflow Execution</strong></p><p>When refund requests are received, they are processed in two steps:</p><ul><li>Request data are persisted in the refunds database.</li><li>Execution of the Refund workflow is initiated</li></ul><p>Refunds Database: This is the single source of truth for Zulily refunds. That is, business and engineering teams can query this database for details regarding a refund request. The base entity in this database is a refund workflow, which could be modeled as a single denormalized table. Therefore, we decided to adopt NoSQL as the database technology for our service. DynamoDB was our chosen NoSQL solution. We picked DynamoDB for the following reasons:</p><ul><li>DynamoDB is an AWS service and integrates seamlessly with other AWS services used across Zulily.</li><li>It is a fully managed solution with capabilities such as redundancy and replication provided out of the box.</li><li>It is a highly available service that offers three-way replication which suited our refunds use case.</li></ul><p>Refunds workflow: At Zulily, refunds are a multi-step process that we modeled as a workflow. When a refund request is received, the refunds workflow is started asynchronously. A workflow consists of one or more tasks and its execution involves the coordination and management of these tasks. For a simplified and reliable processing of refunds, we decided on Amazon’s SWF as our orchestration service. For our use case, the benefits of SWF include:</p><ul><li>Maintenance of a workflow execution history which makes debugging issues much easier for engineers</li><li>Automatic retries for failed tasks using exponential backoff which helps proactively resolve transient errors.</li><li>Quick and easy definitions of workflows and their associated activities in code using libraries provided with the SWF flow framework.</li></ul><p><strong>c. Workflow Completion</strong></p><p>The completion of a workflow involves updating the workflow status in the refunds database and notifying clients. For client notification, we use AWS Simple Notification Service (SNS) to publish the refund workflow entity to an SNS topic. Clients can subscribe to this topic to track the status of their refund request.</p><p><strong>d. Workflow Monitoring</strong></p><p>Monitoring of our refund requests involved implementing a reliability metric to ensure that refunds are being processed successfully. We also implemented additional metrics such as availability, latency, and throughput to track the overall health of the system.</p><p>All metrics were visualized using Grafana dashboards. We also used Grafana to implement alerts that catch spikes or dips in our metrics.</p><p>Zulily takes customer trust seriously. By evolving the technology stack that powers Zulily refunds, we were able to significantly improve the reliability of our refund process, and consistently deliver shopping experiences that our customers trust.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=661d2592b760" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zulily-tech-blog/orchestrating-the-refunds-process-at-zulily-661d2592b760">Orchestrating the Refunds Process at Zulily</a> was originally published in <a href="https://medium.com/zulily-tech-blog">Zulily Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rapid Mobile App Updates at Scale, Speed and Consistency]]></title>
            <link>https://medium.com/zulily-tech-blog/rapid-mobile-app-updates-at-scale-speed-and-consistency-62fced2cb8a?source=rss----7f983e729a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/62fced2cb8a</guid>
            <category><![CDATA[mobile-application]]></category>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[mobile]]></category>
            <dc:creator><![CDATA[Zulily Tech News]]></dc:creator>
            <pubDate>Mon, 30 Aug 2021 16:58:18 GMT</pubDate>
            <atom:updated>2021-09-01T23:13:41.788Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>By: Sophia Miyazaki, Senior Software Engineer, Zulily</strong></h4><p>Mobile is the future of retail. For online retailer Zulily, 74% of customer purchases are placed via mobile devices. How can an organization balance the agility of development with the reality of app marketplace bottlenecks? In this article, learn how Zulily’s tech team favors rapid back-end deployments over client updates and builds a reusable component system to scale its work while maintaining quality.</p><p>Keeping the app experience fresh for our customers is a Zulily core value. The need for constant change requires significant dev resources. Previously, daily requests for new features would take weeks and were not scalable, thus a way to add more features more efficiently was imperative. In order to address this need, a developer-led initiative started in 2015. The group had to solve the biggest problem at hand: releasing features and changes at a faster rate.</p><p>As Zulily grew, we built up our mobile team to keep up with customer needs, but we also needed to build up a framework to work more efficiently.</p><p>There were two problems to solve in order to release features and changes at a faster rate:</p><ol><li>Cut down on the app release bottleneck</li><li>Design and develop faster</li></ol><p>We started by looking closely at the feature screens we were building. We considered what part of this development could be carved out to deliver app updates to our user’s hands quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tym9T5lelrYxcuw-YYDFoA.jpeg" /><figcaption><strong><em>Fig. 1</em></strong><em>: Examples of feature screens</em></figcaption></figure><p>Feature screens were always composed of stacked or a grid of items (Fig. 1). The industry trend was moving toward modular development, so thinking of one entire screen as multiple components felt like a natural approach. We posited that if we could break down any screen to be composed of reusable UI components that are controlled by the back-end application program interface (API), we could solve both pieces of the problem.</p><h3><strong>Problem #1 — Cut down on the app release bottleneck</strong></h3><p>Because Zulily can control the timing and frequency of our own back-end server deployments, if we could have the Mobile API handle content delivery, we could bypass the need for an app review from the Play Store (Android) or the App Store (iOS). This meant a reduction in the time it takes to roll out a new app version to customers.</p><p>For example, a Mobile API release takes only a few minutes to roll to 100% of our customers, as compared to an Android release taking approximately five days to get 70% of our users to update to the latest app version, and about a week for an iOS update to be circulated to users.</p><h3><strong>Problem #2</strong> <strong>— Design and develop faster</strong></h3><p>We also found that reusable UI components can be used like a plug-and-play system. Once UI and data models had survived a group review (Fig. 2 &amp; Fig. 3), we could document them well enough to be easily reused across teams.</p><p>We called these components “Sections”, and this was the beginning of the Zulily Sections Architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*VXm397njSHPS7W-bAWzDtA.jpeg" /><figcaption><strong><em>Fig. 2:</em></strong><em> Whiteboard brainstorming session showing some different components that compose a screen</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*yGLoh33-1rR_JUc7H4WByw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZusgUaW0sn_PR0ywjliviA.png" /><figcaption><strong><em>Fig. 3</em></strong><em>: Example JSON payload generated by the Mobile API and the corresponding app display</em></figcaption></figure><p>In order to show how robust this system could be, let’s look at what can be handled by purely Mobile API deployments.</p><h3><strong>Content</strong></h3><p>We built custom Spannable functionality for Android and custom NSAttributedStrings for iOS to handle specific spans attributes that the Mobile API sends as part of the page payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*l8z_S8lMCaXPs0dxAIs7Dw.png" /></figure><p>We also expanded the Span functionality to handle a custom Zulily icon font, so instead of hardcoding an image resource into the app client, the Mobile API payload includes a span that maps to an icon, which can then be sized and stylized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*fcVyMXYuLZHdH0-jgAX7qA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*4RDFmpCVn2h4jQJ5AGmQlQ.png" /><figcaption><strong><em>Fig. 4:</em></strong><em> Text copy, font size and color + font icons</em></figcaption></figure><p>In the Shipping Options example (Fig. 4), the text and the icons are sent to the clients in the Mobile API payload.</p><h3><strong>Layout</strong></h3><p><strong>Order of sections</strong>: The API output can control the order in which sections appear and the clients will display them accordingly. This allows us to personalize screens for customers or test variants easily.</p><p><strong>Multivariant testing</strong>: Logic around which sections show for a subset of customers that are part of an AB or Multivariant test is handled by the API.</p><p>Looking back at our sample mocks (Fig. 1), the Mobile API can change the order of the Search tabs and contents or can dictate where on the screen the Order button should be shown.</p><p>When content, styling, order, and show-or-display logic became handled on the server side, the expense of new features and iterative updates considerably decreased.</p><h3><strong>Next Steps</strong></h3><p>Zulily mobile development rallied around this Sections Architecture from 2015 until now, which allowed us to build fast, but we came across several pain points. While we reused many Sections, in order to keep the look of the app fresh over five years, many Sections were slight variations of past UI. This resulted in a lot of copy-paste Sections.</p><p>As the number of Sections increased, our original Section naming convention also became problematic. We couldn’t tell the difference between Header Variation 1 through Header Variation 9 from the names alone, unless we dug into the documentation or implementation.</p><p>To tackle these new problems, in early 2021 we began developing the next generation of the component architecture. We are aligning our approach with UX designers much earlier in the tech design process to develop a new “Design Language System”, where the designers would have a component library to build mocks from. Subsequently, engineers would use these components to compose new screens and layouts. These components would be even more granular. For example, individual Text Input fields or Buttons would have their own specs. Currently, the new Design Language System components are being incorporated inside of new Sections, where we have already seen examples of a <strong>50% reduction in engineering time</strong>.</p><p>By setting up an architecture where back-end server deployments provide an increasing amount of control over what is displayed on the Zulily app screens, we have increased the output of features and iterative changes while also cutting down on the time it takes to make them. But there’s always room for improvement. It’s imperative to continue to dig into the challenges our own architectures may form, so that we can keep getting better and faster, all while keeping our eye on the ball — and ensuring Zulily’s customers are happy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62fced2cb8a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zulily-tech-blog/rapid-mobile-app-updates-at-scale-speed-and-consistency-62fced2cb8a">Rapid Mobile App Updates at Scale, Speed and Consistency</a> was originally published in <a href="https://medium.com/zulily-tech-blog">Zulily Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leveraging Serverless Tech without falling into the “Ownerless” trapThe appeal of serverless…]]></title>
            <link>https://medium.com/zulily-tech-blog/leveraging-serverless-tech-without-falling-into-the-ownerless-trapthe-appeal-of-serverless-d559b69bee45?source=rss----7f983e729a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/d559b69bee45</guid>
            <dc:creator><![CDATA[Ethan Spiro]]></dc:creator>
            <pubDate>Fri, 07 Feb 2020 18:53:42 GMT</pubDate>
            <atom:updated>2020-02-07T18:53:42.686Z</atom:updated>
            <content:encoded><![CDATA[<h3>Leveraging Serverless Tech without falling into the “Ownerless” trap</h3><p>The appeal of serverless architecture sometimes feels like a ­­silver bullet: Offload your application code to your favorite cloud providers’ serverless offering and enjoy the benefits of extreme scalability, rapid development, and pay-for-use pricing. At this point in time most cloud providers’ solutions and tooling are well defined, and you can get your code executing in a serverless fashion with little effort.</p><p>The waters start to get a little murkier when considering making an entire application serverless while maintaining the coding standards and maintainability of traditional server-based architecture. Serverless has a tendency to become ownerless (aka hard to debug and painful to work on) over time without the proper structure, tooling and visibility. Eventually these applications suffer due to code fragility and slow development time, despite how easy and fast they were to prototype.</p><p>On the pricing team at Zulily, our core services are written in Java using the Dropwizard framework. We host on AWS using Docker and Kubernetes and deploy using Gitlab’s CICD framework. For most of our use cases this setup works well, but it’s not perfect for everything. We do feel confident though that this setup provides the structure and tools that help in avoiding the ownerless trap and this setup helps us achieve our goals of well-engineered service development. While this list of goals will differ between teams and projects, for our purposes it can be summarized below:</p><p><strong>Goals:</strong></p><ul><li>Testability (Tests &amp; Local debugging &amp; Multiple environments)</li><li>Observability (Logging &amp; Monitoring)</li><li>Developer Experience (DRY &amp; Code Reviews &amp; Speed &amp; Maintainability)</li><li>Deployments</li><li>Performance (Latency &amp; Scalability)</li></ul><p>We are currently redesigning our competitive shopping pipeline and thought this would be a good use case to experiment with a serverless design. For our use case we were most interested in its ability to handle unknown and intermittent load and were also curious to see if it improved our speed of development and overall maintainability. We think we have been able to leverage the benefits of a serverless architecture while avoiding some of the pitfalls. In this post, I’ll provide an overview of the choices we made and lessons we learned.</p><p><strong>OUR STACK IN A NUTSHELL AND HOW IT WORKS</strong></p><p>There are many serverless frameworks, some are geared towards being platform agnostic, others focus on providing better UIs, some make deployment a breeze, etc… We found most of these frameworks were abstraction layers on top of AWS/GCP/Azure and since we are primarily an AWS-leaning shop at Zulily, we decided to stick with their native tools where we could, knowing that later we could swap out components if necessary. Some of these tools were already familiar to the team and we wanted to be able to take advantage of any new releases by AWS without waiting for an abstraction layer to implement said features.</p><p><em>Basic architecture of serverless stack:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/0*GCIdpVNlB_jGyV5a" /></figure><p>Below is a breakdown of the major components/tools we are using in our serverless stack:</p><p><strong>API Gateway:</strong></p><p><strong>What it is</strong>: Managed HTTP service that acts as a layer (gateway) in front of your actual application code.</p><p><strong>How we use it</strong>: API gateway handles all the incoming traffic and outgoing responses to our service. We use it for parameter validation, request/response transformation, throttling, load balancing, security and documentation. This allows us to keep our actual application code simple while we offload most of the boilerplate API logic and request handling to API Gateway. API gateway also acts as a façade layer where we can provide clients with a single service and proxy requests to multiple backends. This is useful for supporting legacy Java endpoints while the system is migrated and updated.</p><p><strong>Lambda:</strong></p><p><strong>What it is</strong>: Lambda is a serverless compute service that runs your code in response to events and automatically manages the underlying compute resources.</p><p><strong>How we use it</strong>: We use Lambdas to run our application code using the API gateway Lambda proxy integration. Our Lambdas are written in Nodejs to reduce cold start time and memory footprint (compared to Java). We have a 1:1 relationship between an API endpoint and Lambda to ensure we can fine tune the memory/runtime per Lambda and utilize API Gateway to its fullest extent, for example, to bounce malformed requests at the gateway level and prevent Lambda execution. We also use Lambda layers, a feature introduced by AWS in 2018, to share common code between our endpoints while keeping the actual application logic isolated. This keeps our deployment size smaller per lambda and we don’t have to replicate shared code.</p><p><strong>SAM (Cloudformation):</strong></p><p><strong>What it is</strong>: AWS SAM is an open-source framework that you can use to build serverless applications on AWS. It is an extension of Cloudformation which lets you bundle and define serverless AWS resources in template form, create stacks in AWS, and enable permissions. It also provides a set of command line tools for running serverless applications locally.</p><p><strong>How we use it</strong>: This is the glue for our whole system. We use SAM to describe and define our entire stack in config files, run the application locally, and deploy to integration and production environments. This really ties everything together and without this tool we would be managing all the different components separately. Our API gateway, Lambdas (+ layers) and permissions are described and provisioned in yaml files.</p><p><em>Example of defining a lambda proxy in template.yaml</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/0*s_1yI65ef0rLjTof" /></figure><p><em>Example of shared layers in template.yaml</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/0*02Ltd6RXAt2UMOzy" /></figure><p><em>Example of defining corresponding API gateway endpoint in template.yaml</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/0*xKXUXGBTpoA-C5sH" /></figure><p><strong>DynamoDB:</strong></p><p><strong>What it is</strong>: A managed key value and document data store.</p><p><strong>How we use it</strong>: We use DynamoDB for our ingestion pipeline getting data into our system. Dynamo was the initial reason we chose to experiment with serverless for this project. Your serverless application is limited by your database’s ability to scale fluidly. In other words, it doesn’t matter if your application can handle large spikes in traffic if your database layer is going to return capacity errors in response with this increase in load. Our ingestion pipeline spikes daily from ~5 to ~700 read or write capacity units per second and is scheduled to increase, so we wanted to make sure throwing additional batches of reads or writes to our datastore from our serverless API wasn’t going to cause a bottleneck during a spike. In addition to being able to scale fluidly, Dynamo has also simplified our Lambda-datastore interaction as we don’t have the complexity overhead of trying to open and share database connections between lambdas because Dynamo’s low-level API uses HTTP(S). This is not to say it’s impossible to use a different database (lots of examples out there of this), but its arguably simpler to use something like Dynamo.</p><p><em>Normal spikey ingestion traffic for our service with dynamo scaling</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/0*3k2X7KLKe1F3X20_" /></figure><p><strong>Other tools: Gitlab CICD, Cloudwatch, Elk stack, Grafana</strong>:</p><p>These are fairly common tools, so we won’t go into detail about what they are.</p><p><strong>How we use it</strong>: We use Gitlab CICD to deploy all of our other services, so we wanted to keep that the same for our serverless application. Our Gitlab runner uses a Docker image that has AWS SAM for building, testing, deploying (in stages) and rolling back our serverless application. Our team already uses the Elk stack and Grafana for logging, visualization and alerting. For this service all of our logs from API Gateway, Lambda and Dynamo get picked up in Cloudwatch. We use Cloudwatch as a data source in Grafana and have a utility that migrates our Cloudwatch logs to Logstash. That way we can keep our normal monitoring and logging systems without having to go to separate tools just for this project.</p><p><strong>DID WE ADDRESS OUR GOALS?</strong></p><p>So now that we have laid out our basic architecture and tooling: How well does this system address our goals mentioned at the start of this post? Below is a breakdown for how these have been addressed and a (yes, very subjective) grade for each.</p><p><strong>Testability</strong> (Tests &amp; Local debugging &amp; Multiple environments) de</p><p><strong>Positives</strong>: The tooling for serverless has come a long way and impressed us in this category. One of the most useful features is the ability to start your serverless app locally by running</p><pre>sam local start-api &lt;OPTIONS&gt;</pre><p>This starts a local http server based on your AWS::Serverless::Api specification in your template.yaml. When you make a request to your local server, it reads the corresponding CodeUri property of your lambda (AWS::Serverless::Function) and starts a docker container (same image AWS runs deployed lambdas) to run your lambda locally in conjunction with the request. We were able to write unit tests for all the lambdas and lambda layer code as well as deploy to specific integ/prod environments (discussed more below). There are additional console and CLI tools for triggering API gateway endpoints and lambdas directly.</p><p><strong>Negatives: </strong>Most of the negatives for this category are nitpicks. Unit testing with layers took some tweaking and feels a little clumsy and <em>sam local start-api</em> doesn’t exactly mimic the deployed instance in how it handles errors and parameter validation. In addition, requests to the local instance were slow because it starts a docker container locally every time an endpoint is requested.</p><p><strong>Observability </strong>(Logging &amp; Monitoring)</p><p><strong>Overall Grade: B</strong></p><p><strong>Positives: </strong>At the end of the day this works pretty well and mostly mimics our other services where we have our logs searchable in Kibana and our data visible in Grafana. The integration with Cloudwatch is pretty seamless and really easy to get started with.</p><p><strong>Negatives:</strong> Observability in the serverless world is still tough. It tends to be distributed across lots of components and can be frustrating to track down where things unraveled. With the rapid development of tooling in this category, we don’t see this being a long-term problem. One tool that we have not tried, but could bump this grade up, is AWS X-ray which is a distributed tracing system for AWS components.</p><p><strong>Developer Experience </strong>(DRY &amp; Code Reviews &amp; Speed &amp; Maintainability)</p><p><strong>Overall Grade: A-</strong></p><p><strong>Positives</strong>: Developer experience was good, bordering on great. Each endpoint is encapsulated in its own small codebase which makes adding new code or working on existing code really easy. Lambda layers have solved a lot of the <em>DRY</em> issues. We share response, error and database libraries between the lambdas as well as NPM modules. All of our lambda code gets reviewed and deployed like our normal services.</p><p><strong>Negatives</strong>. In our view the two biggest downsides have been unwieldy configuration and immature documentation. While configuration has its benefits, and it’s great to be able to see the entire infrastructure of your application in code, this can be tough to jump into and SAM/Cloudformation has a learning curve. Documentation is solid but could be better. Part of the issue is the rapid pace of feature releases and some confusion on best practices.</p><p><strong>Deployments Overall Grade: A</strong></p><p><strong>Positives:</strong> Deployments are awesome with SAM/Cloudformation. From our Gitlab runner we execute:</p><pre>aws cloudformation package --template-file template.yaml --output-template-file packaged_{env}.yaml --s3-bucket {s3BucketName}</pre><p>which uploads template resources to s3 and replaces paths in our template. We can then run:</p><pre>aws cloudformation deploy --template-file packaged_{env}.yaml --stack-name {stackName} --capabilities CAPABILITY_IAM --region us-east-1 --parameter-overrides DeployEnv={env}</pre><p>which creates a change set (shows effects of proposed deployment) and then creates the stack in AWS. This will create/update all the resources, IAM permissions and associations defined in template.yaml. This is really fast, a normal build and deployment of all of our Lambdas, API Gateway endpoints, permissions etc… takes ~90 seconds (not including running our tests).</p><p><strong>Negatives:</strong> Unclear best practices for deploying to multiple environments. One approach is to use different API stages in API gateway and have your other resources versioned for those stages. Or (the way we chose) is to have completely different stacks for different environments and pass a DeployEnv variable into our Cloudformation scripts.</p><p><strong>Performance</strong> (Latency &amp; Scalability)</p><p><strong>Overall Grade: A-</strong></p><p><strong>Positives: </strong>To test our performance and latency before going live we proxied all of our requests in parallel to both our existing (Dropwizard) API and new serverless API. It is important to consider the differences between the systems (data stores, caches etc..), but after some tweaking we were able to achieve equivalent P99, P95 and P50 response times between the two systems. In addition to the ability to massively scale out instances in response to traffic, the beauty of the serverless API is that you can fine tune performance on a function (endpoint) basis. CPU share is proportionally allocated depending on overall memory of each Lambda, so increasing the memory of each Lambda has the ability to directly decrease latency. When we first started routing traffic in parallel to our serverless API we noticed some of the bulk API endpoints were not performing as well as we had hoped. Instead of increasing the overall CPU/memory of the entire deployment, we just had to do this for the slow Lambdas.</p><p><strong>Negatives:</strong> A well-known and often discussed issue with serverless is dealing with cold start times. This refers to the latency increase when an initial instance is brought up by your cloud provider to process a request to your serverless app. In practice this is on the scale of sometimes several hundred ms latency added on cold start for our endpoints. Once spun up, instances won’t get torn down immediately and subsequent requests (if routed to this same instance) won’t suffer from that initial cold start time. There are several strategies to avoid these cold starts like “pre-warming” your API with dummy requests when you know traffic is about to spike. You can also configure your application to run with more memory which persist for longer between requests (+ increase CPU). Both of these strategies cost money, so the goal is to try to find the right balance for your service.</p><p>Example of scaling (at ~14:40) an arbitrary computation-heavy lambda from 128mb to 512mb in response times</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/0*g-uSqDpsXE-Nvj21" /></figure><p>Overall latency with spikes over a ~3 hour period (most lambdas configured at 128mb or 256mb). Spikes re either cold start times or calls that involve several hundred queries (bulk APIs) or a combo. Note* this performance is tweaked to be equivalent to the p99 p90 and p50 times of the old service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/0*DtM4kloUN8XTXA0S" /></figure><p><strong>WRAPPING UP</strong></p><p>At the end of the day this setup has been a fun experiment and for the most part satisfied our requirements. Now that we have set this up once, we will definitely use it again for suitable projects in the future. A few things we didn’t touch on in this post are pricing and security, two very important goals for any project. Pricing is tricky to get an accurate comparison of because it depends on traffic, function size, function execution time and many other configurable options along the entire stack. It is worth mentioning, though, that if you have large and consistent traffic to your APIs, it is highly unlikely that serverless will be as cost effective as rolling you own (large) instance. That being said, if you want a low maintenance service that can scale on demand to handle spikey, intermittent traffic, it is definitely worth considering. Security considerations are also highly dependent on your use case. For us, this is an internal facing application so strategies like associating an internal firewall, limited resource IAM permissions and basic gateway token validation sufficed. For public facing applications there are a variety of security strategies to <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-to-api.html">consider</a> that aren’t mentioned in this post. Overall, we would argue that the tools are at a point where it does not feel like you are sacrificing in terms of development standards by choosing a serverless setup. Still not a silver bullet, but a great tool to have in the toolbox.</p><p><strong>RESOURCES AND FURTHER READING</strong></p><p>Overview of serverless computing: <a href="https://martinfowler.com/articles/serverless.html">https://martinfowler.com/articles/serverless.html</a></p><p>API gateway: <a href="https://docs.aws.amazon.com/apigateway/index.html#lang/en_us">https://docs.aws.amazon.com/apigateway/index.html#lang/en_us</a></p><p>Lambda: <a href="https://docs.aws.amazon.com/lambda/index.html#lang/en_us">https://docs.aws.amazon.com/lambda/index.html#lang/en_us</a></p><p>SAM: <a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html">https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html</a></p><p>Cloudformation: <a href="https://docs.aws.amazon.com/cloudformation/index.html#lang/en_us">https://docs.aws.amazon.com/cloudformation/index.html#lang/en_us</a></p><p>Dynamo: <a href="https://docs.aws.amazon.com/dynamodb/index.html#lang/en_us">https://docs.aws.amazon.com/dynamodb/index.html#lang/en_us</a></p><p>Cloudwatch: <a href="https://docs.aws.amazon.com/cloudwatch/index.html#lang/en_us">https://docs.aws.amazon.com/cloudwatch/index.html#lang/en_us</a></p><p>Xray: <a href="https://docs.aws.amazon.com/xray/index.html#lang/en_us">https://docs.aws.amazon.com/xray/index.html#lang/en_us</a></p><p>Grafana: <a href="http://docs.grafana.org/">http://docs.grafana.org/</a></p><p>Elk stack: <a href="https://www.elastic.co/guide/index.html">https://www.elastic.co/guide/index.html</a></p><p>Gitlab CICD: <a href="https://docs.gitlab.com/ee/ci/">https://docs.gitlab.com/ee/ci/</a></p><p><em>Originally published at </em><a href="https://zulily-tech.com/2019/05/22/leveraging-serverless-tech-without-falling-into-the-ownerless-trap/"><em>https://zulily-tech.com</em></a><em> on May 22, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d559b69bee45" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zulily-tech-blog/leveraging-serverless-tech-without-falling-into-the-ownerless-trapthe-appeal-of-serverless-d559b69bee45">Leveraging Serverless Tech without falling into the “Ownerless” trapThe appeal of serverless…</a> was originally published in <a href="https://medium.com/zulily-tech-blog">Zulily Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The “Power” of A/B Testing]]></title>
            <link>https://medium.com/zulily-tech-blog/the-power-of-a-b-testing-c7db00144eb8?source=rss----7f983e729a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/c7db00144eb8</guid>
            <category><![CDATA[zulily]]></category>
            <category><![CDATA[ab-testing]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Arushi Prakash]]></dc:creator>
            <pubDate>Fri, 07 Feb 2020 08:29:27 GMT</pubDate>
            <atom:updated>2020-02-07T08:29:27.535Z</atom:updated>
            <content:encoded><![CDATA[<p>Customers around the world flock to Zulily on a daily basis to discover and shop products that are curated specially for them. To serve our customers better, we are constantly innovating to improve the customer experience<em>.</em><strong><em> To help us decide between different customer experiences, we primarily use split testing or A/B testing</em></strong><a href="https://www.forbes.com/sites/forbesagencycouncil/2017/11/14/is-split-testing-your-landing-pages-actually-worth-it/#766966e93741"><strong><em>, the industry standard for making scientific decisions about products</em></strong></a><strong><em>.</em></strong> In a <a href="https://zulily-tech.com/2018/04/06/practical-a-b-testing/">previous post</a>, we talked about the fundamentals of A/B testing and described our home-grown solution. In this article, we are going to explore one choice behind designing sound A/B tests: we will calculate the number of people that need to be included in your test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*udB404E76oBfjMG2F4NBlQ.png" /><figcaption><strong>Figure 1.</strong> For example, in an A/B test, we might compare two variants of the navigation bar on the website. Here, the New Today tab, displaying new events, appears either in position one (original version) or position two (test version).</figcaption></figure><p>To briefly recap the idea of A/B testing, in an A/B test we compare the performance of two variants of the same experience. For example, in a test, we might compare two ways of ordering the navigation tabs on the website (see Figure 1). In the original version (variant A or control), the tabs are ordered such that events launched today (New Today) appear before events that are ending soon (Ends Soon). In the new version of the website (variant B or control), Ends Soon appears before New Today. The test is set up such that, for a pre-defined period of time, customers visiting the website would be shown either variant A or variant B. Then, using statistical methods, we would measure the incremental improvement in the experience of customers that were shown variant B over those who were shown variant A. Finally, if there was a statistically significant improvement, we might decide to change the order of the tabs on the website.</p><p>Since Zulily relies heavily on A/B testing to make business decisions, we are careful about <a href="https://hbr.org/2017/06/a-refresher-on-ab-testing">avoiding common pitfalls of the method</a>. The length of an A/B test ties in strongly with the success of the business for two reasons:</p><ul><li><strong>If A/B tests run for more days than necessary</strong>, the pace of innovation at the company will slow down.</li><li><strong>If A/B tests run for fewer days than required</strong> to achieve statistically sound results, the results will be misguided.</li></ul><p>To account for these issues, <strong><em>before making decisions based on the A/B test results</em></strong>, we run what’s called a ‘ <em>power analysis.’</em> <strong>A power analysis ensures</strong> <strong><em>that a certain number of people have been captured in the test to confirm or deny whether variant B was an improvement over variant A, which is the focus of this article.</em></strong> We also make sure that the test is run long enough so that short-term business cycles are accounted for<strong><em>. </em></strong>The calculation for the number of people needed in a test is a function of three things, effect size, significance level, and power.</p><blockquote><em>To consult the statistician after an experiment is finished is often merely to ask [them] to conduct a post mortem examination. [They] can perhaps say what the experiment died of.</em></blockquote><blockquote><em>- Robert Fisher, Statistician</em></blockquote><h3>Common Terms</h3><p>Before we get into the mechanics of that calculation, let us familiarize ourselves with some common statistical terms. In an A/B test, we are trying to estimate how all the customers behave (<strong><em>population</em></strong>) by measuring the behavior of a subset of customers (). For this, we ensure that our sample is representative of our entire customer base. During the test, we measure the behavior of the customers in our sample. Measurements might include the number of items purchased, the time spent on the website, or the money spent on the website by each customer.</p><p>For example, to test whether variant B outperformed variant A, we might want to know if the customers exposed to variant B spent more money than the customers exposed to variant A. In this test, our default position is that variant B made no difference on the behavior of the customers when compared to variant A (<strong><em>null hypothesis</em></strong>). As more customers are exposed to these variants and start purchasing products, we collect measurements on more customers, which allows us to either accept or reject this null hypothesis. The difference between the behavior of customers exposed to variant A and variant B is known as the <strong><em>effect size</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*8wyC3yvWnFmXx0lSji77ZA.png" /><figcaption><strong>Figure 2. </strong>In A/B testing, different types of errors can occur, depending on where the results lie on this graph. Therefore, the parameters that we set under the hood, namely significance level and power, need to be set carefully, keeping our appetite for error in mind.</figcaption></figure><p>Further, there are a number of parameters set under the hood. Before starting the test, we assign a <strong><em>significance level </em></strong>which means that we might reject the null hypothesis when it is actually true in 5% of the cases (<strong><em>Type I error rate</em></strong>). Further, we will assign a <strong><em>power</em></strong> which means that when the null hypothesis does not hold, or variant B changes the behavior of customers, the test will allow us to reject the null hypothesis 80% of the time. <strong><em>Importantly, these parameters need to be set at the beginning of the test and upheld for the duration of the test to avoid </em></strong><a href="https://freakonometrics.hypotheses.org/19817"><strong><em>p-hacking</em></strong></a><strong><em>, which leads to misguided results.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*yGRCou9Dm7daFSD49UETIw.png" /><figcaption><strong>Figure 3. </strong>In A/B testing, different types of errors can occur, depending on where the results lie on this graph. Therefore, the parameters that we set under the hood, namely significance level and power, need to be set carefully, keeping our appetite for error in mind.</figcaption></figure><h3>Estimating the Number of Customers for the A/B Test</h3><p>For this exercise, let us revisit the previous example where we show customers two versions of the Zulily navigation bar. Let us say we want to see if this change makes customers less or more engaged on Zulily’s website. One metric that can capture this is the proportion of customers who revisit the website when shown variant B versus variant A. for this exercise, let us say that we are interested in a boost in this metric of at least 1 % ( <em>effect size</em>). If we see at least this effect size, we might implement the variant B. Question is, how many customers should be exposed to each variant to allow us to confirm that this change of 1% exists?</p><p>Starting off, we define some parameters. First, we define the significance level at 0.05. Second, from the central limit theorem, we assume that the average money that a group of customers spends on the website is normally distributed. Third, we direct 50% of the customers visiting the site to variant A and 50% of them to variant B. These last two points greatly simplify the math behind the calculation. Now, we can estimate the number of people that need to be exposed to each variant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*8jpEMRfG2SZikmkXdl0AuQ.png" /></figure><p>where σ is the standard deviation of the population, δ is the change we expect to see, the first and second components inside parentheses are quantiles from a normal distribution. For the case of the parameters defined above, a significance level of 0.05 and a power of 0.80, and the ability to detect 1% change in the metric, our formula would simplify to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*y4zGH7v3aOs6i1WtXpYjAw.png" /></figure><p>This formula gives us the number of people that need to be exposed to one variant. Finally, since the customers were split evenly between variant A and variant B, we would need twice the number of the people in the entire test. This estimate can change significantly if any of the parameters change. For example, to detect a larger difference at this significance level, we would need much smaller samples. Further, if the observations are not normally distributed, then we would need a more complicated approach.</p><h3>Benefits of this calculation</h3><p>In short, getting an estimate of the number of customers needed allows us to design our experiments better. We suggest conducting a power analysis both before and after starting a test for several reasons:</p><ul><li><strong>Before starting the test </strong>— This gives us an estimate of how long our test should be run to detect the effect that we are anticipating. Ideally, this is done once to design the experiment and the results are tallied when the requisite number of people are exposed to both variants. However, the mean and standard deviation used in the calculation before starting the test are approximations to the actual values that we might see during the test. Thus, these <em>a priori</em> estimates might be off.</li><li><strong>After starting the test </strong>— As the test progresses, the mean and standard deviation converge to values representative of the current sample which allows us to get more accurate estimates of the sample size. This is especially useful in cases where the new experience introduces unexpected changes in the behavior of the customers leading to significantly different mean and standard deviation values than those estimated earlier.</li></ul><p>At Zulily, we strive to make well-informed choices for our customers by listening to their voice through our A/B testing platform, among other channels and ensuring that we are constantly serving the needs of the customers. While obtaining an accurate estimate of the number of people for the test is challenging, we hold it central to the process. Most people agree that <a href="https://hbr.org/2014/02/ab-testing-and-the-benefits-of-an-experimentation-culture">the benefits of a well-designed, statistically sound A/B testing system</a> far outweigh the benefits from obtaining quick, but misdirected numbers. Therefore, we aim for a high-level level of scientific rigor in our tests.</p><p><em>I would like to thank my colleagues in the data science team, Demitri Plessas and Pamela Moriarty, and ourmanager, Paul Sheets, for taking the time to review this article. This article is possible due to the excellent work by the entire data science team of maintaining the A/B testing platform and ensuring that experiments at Zulily are well-designed.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7db00144eb8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zulily-tech-blog/the-power-of-a-b-testing-c7db00144eb8">The “Power” of A/B Testing</a> was originally published in <a href="https://medium.com/zulily-tech-blog">Zulily Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[USING DATA TO DRIVE SUCCESS]]></title>
            <link>https://medium.com/zulily-tech-blog/using-data-to-drive-success-8a874a7f55e0?source=rss----7f983e729a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/8a874a7f55e0</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[zulily]]></category>
            <category><![CDATA[seattle-sounders-fc]]></category>
            <category><![CDATA[tech-talk]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Melissa Thorne]]></dc:creator>
            <pubDate>Wed, 27 Nov 2019 05:03:51 GMT</pubDate>
            <atom:updated>2019-11-27T05:03:51.287Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using Data to Drive Success</h3><h4>Learn how Zulily and Sounders FC get the most out of their metrics!</h4><p>On Tuesday, September 10 th, Zulily was proud to partner with Seattle Sounders FC for a tech talk on data science, machine learning and AI. This exclusive talk was led by <a href="https://www.linkedin.com/in/ollydowns/">Olly Downs</a>, VP of Data &amp; Machine Learning at Zulily, and <a href="https://www.linkedin.com/in/ravi-ramineni-3798374/">Ravi Ramineni</a>, Director of Soccer Analytics at Sounders FC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*SxjCWlcsNyA_t7tGWij_1g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sAtxuTttMbXjZ8w43IJ0MA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*LTkrEZaYap9oz_JY0Nk6Zw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*VIshm148smfWOEI--t4Paw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pl-WLBFmAPZ91gJ3_15ofA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ex3oFpFuFCpeHhR-H5E8cg.jpeg" /></figure><p>Zulily and Sounders FC both use deep analysis of data to improve the performance of their enterprises. At Zulily, applying advanced analytics and machine learning to the shopping experience enables us to better engage customers and drive daily sales. For Sounders FC, the metrics reflect how each player contributes to the outcome of each game; understanding the relationship between player statistics, training focus and performance on the field helps bring home the win. For both organizations, being intentional about the metrics we select and optimize for is critical to success.</p><p>We would like to thank everyone who attended the event for a great night of discussion and for developing new ties within the Seattle developer community. For any developers who missed this engaging discussion, we invite you to view the full presentation and audience discussion:</p><p><a href="https://speakerdeck.com/zulilytech/using-data-to-drive-success-learn-how-zulily-and-sounders-fc-get-the-most-out-of-their-metrics">USING DATA TO DRIVE SUCCESS: Learn how Zulily and Sounders FC get the most out of their metrics!</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FD-eLAg7EZmo%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DD-eLAg7EZmo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FD-eLAg7EZmo%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/b2151f727d1a6f75946bf6970b92f5b1/href">https://medium.com/media/b2151f727d1a6f75946bf6970b92f5b1/href</a></iframe><h4><strong>Acknowledgments</strong>:</h4><p>Thanks to <a href="https://www.linkedin.com/in/ollydowns/">Olly Downs</a> and <a href="https://www.linkedin.com/in/ravi-ramineni-3798374/">Ravi Ramineni</a> for presenting their talks, Sounders FC for hosting, and <a href="https://www.linkedin.com/in/lukefriang/">Luke Friang</a> for providing a warm welcome. This would not have been possible without the many volunteers from Zulily, <a href="https://www.meetup.com/BellevueAISchool/">Bellevue School of AI</a> for co-listing the event, as well as all the attendees for making the tech talk a success!</p><h4><strong>For more information</strong></h4><p>If you’d like to chat further with one of our recruiters regarding a position within data science, machine learning or <a href="https://www.zulily.com/careers">any of our other existing roles</a>, feel free to reach out directly to <a href="/service/mailto:techjobs@zulily.com?subject=I&#39;d%20like%20to%20talk%20about%20jobs!%20%5Bfollow%20up%20from%209/10%20tech%20talk%5d">techjobs@zulily.com</a> to get the conversation started. Also be sure to follow us on <a href="https://www.linkedin.com/company/zulily/">LinkedIn</a> and <a href="https://twitter.com/zulily">Twitter</a>.</p><p><em>Originally published at </em><a href="https://zulily-tech.com/2019/09/25/using-data-to-drive-success/"><em>https://zulily-tech.com</em></a><em> on September 25, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a874a7f55e0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zulily-tech-blog/using-data-to-drive-success-8a874a7f55e0">USING DATA TO DRIVE SUCCESS</a> was originally published in <a href="https://medium.com/zulily-tech-blog">Zulily Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AT THE TOP OF YOUR GAME]]></title>
            <link>https://medium.com/zulily-tech-blog/at-the-top-of-your-game-8c52d51b95cb?source=rss----7f983e729a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/8c52d51b95cb</guid>
            <category><![CDATA[seattle-reign-fc]]></category>
            <category><![CDATA[womens-leadership]]></category>
            <category><![CDATA[zulily]]></category>
            <category><![CDATA[tech-talk]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <dc:creator><![CDATA[Melissa Thorne]]></dc:creator>
            <pubDate>Wed, 27 Nov 2019 05:02:53 GMT</pubDate>
            <atom:updated>2019-11-27T05:02:53.238Z</atom:updated>
            <content:encoded><![CDATA[<h3>At The Top of Your Game</h3><h4><em>Seattle Female Leaders Discuss Their Paths to Success</em></h4><p>On September 5th, Zulily was proud to partner with Reign FC for a thought leadership event, celebrating and highlighting leadership skills from Seattle leaders, including women in STEM, sports and business. This discussion was led by <a href="https://www.linkedin.com/in/kellylwolf/">Kelly Wolf</a>, with <a href="https://www.instagram.com/celiajimdel/">Celia Jiménez Delgado</a>, <a href="https://www.instagram.com/kat.khosro/">Kat Khosrowyar</a>, <a href="https://www.linkedin.com/in/jana-krinsky-13b585b/">Jana Krinsky</a> and <a href="https://www.linkedin.com/in/angela-dunleavy-stowell-a5401320/">Angela Dunleavy-Stowell</a>. Our panel addressed a variety of topics, including mentorship, leadership, impostor syndrome, advocacy and unconventional advice. Following the discussion and audience Q&amp;A, attendees had the opportunity to meet <a href="https://www.instagram.com/celiajimdel/">Celia Jiménez Delgado</a>, <a href="https://www.instagram.com/bevyanez/">Bev Yanez</a>. <a href="https://www.instagram.com/mo_andrews3/">Morgan Andrews</a>, <a href="https://www.instagram.com/bethanybalcer/">Bethany Balcer</a>, <a href="https://www.instagram.com/luuuuluuu/">Lauren Barnes</a>, <a href="https://www.instagram.com/michellebetos/">Michelle Betos</a>, <a href="https://www.instagram.com/darian_jenks/">Darian Jenkins</a>, <a href="https://www.instagram.com/meganoyster/">Megan Oyster</a>, <a href="https://www.instagram.com/taylornsmith11_/">Taylor Smith</a> and <a href="https://www.instagram.com/morg09/">Morgan Proffitt</a> of Reign FC! Attendees were also able to take a professional headshot, courtesy of Zulily’s hardworking studio team. We’d like to thank all who were able to attend, as well as the Zulily staff whose efforts made this event a success.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FCOiUS7Gxw9k%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCOiUS7Gxw9k&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FCOiUS7Gxw9k%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/1179a6a939f4e6cfe5bace3fefc95f2b/href">https://medium.com/media/1179a6a939f4e6cfe5bace3fefc95f2b/href</a></iframe><h4><strong>Panel Highlights:</strong></h4><p><strong><em>“As you grow in your career, you are being sought for your leadership and critical thinking skills, and for your ability to diagnose and solve problems, not regurgitate facts.”</em></strong>- <a href="https://www.linkedin.com/in/kellylwolf/"><strong>Kelly Wolf</strong></a>, VP of People at <a href="http://www.zulily.com/">Zulily</a></p><p><strong>“<em>I wouldn’t be where I am if it wasn’t for my mentors. We need to push more, take more risk to support each other and come together as a community. It doesn’t matter if you’re a man or a woman, we all need to work together.”</em></strong> — <a href="https://www.instagram.com/kat.khosro/"><strong>Kat Khosrowyar</strong></a>, Head Coach at <a href="https://www.reignacademy.com/">Reign Academy</a>, former Head Coach of Iran’s national soccer team, Chemical Engineer</p><p><strong><em>“I am not a developer, but currently mentor a female developer. She drives the topic, and I act as a sounding board. Working on a predominately male team, she needed a different confidante to work through issues, approach, development ideas and career path goals.”</em></strong> — <a href="https://www.linkedin.com/in/jana-krinsky-13b585b/"><strong>Jana Krinsky</strong></a>, Director of Studio at <a href="http://www.zulily.com/">Zulily</a></p><p><strong><em>“During meetings, I sometimes tell myself, ‘should I be here? I’m in over my head.’ And I sort of have to call bull**** on myself. I think we all need to do that.”</em></strong> — <a href="https://www.linkedin.com/in/angela-dunleavy-stowell-a5401320/"><strong>Angela Dunleavy-Stowell</strong></a>, CEO at <a href="https://www.farestart.org/">FareStart</a>, Co-Founder at <a href="https://www.ethanstowellrestaurants.com/">Ethan Stowell Restaurants</a></p><p><strong><em>“When you have confidence in yourself, when you think ‘I’m going to own it, this is going to happen because I’m going to make it happen,’ it matters. As women, we can’t use apologetic language like ‘Sorry, whenever you have a second, I would like to speak to you’ — we don’t need to be sorry for doing our jobs. Women need to start changing those sentences to, ‘when would be a good time to talk about this project?’ and treating people as your equal, not as someone who’s above you.”</em></strong> — <a href="https://www.instagram.com/celiajimdel/"><strong>Celia Jiménez Delgado</strong></a>, right wing-back for <a href="https://www.reignfc.com/">Reign FC</a> + Spain’s national soccer team, Aerospace Engineer</p><p><strong><em>“We all have to find our courage. Because if you want to grow and be in a leadership role, that’s going to be a requirement. I think identifying that early in your career is a great way to avoid some pitfalls, down the road.”</em></strong> — <a href="https://www.linkedin.com/in/angela-dunleavy-stowell-a5401320/"><strong>Angela Dunleavy-Stowell</strong></a>, CEO at <a href="https://www.farestart.org/">FareStart</a>, Co-Founder at <a href="https://www.ethanstowellrestaurants.com/">Ethan Stowell Restaurants</a></p><h4><strong>Acknowledgments</strong>:</h4><p>Thanks to <a href="https://www.instagram.com/celiajimdel/">Celia Jiménez Delgado</a>, <a href="https://www.instagram.com/kat.khosro/">Kat Khosrowyar</a>, <a href="https://www.linkedin.com/in/jana-krinsky-13b585b/">Jana Krinsky</a>, <a href="https://www.linkedin.com/in/angela-dunleavy-stowell-a5401320/">Angela Dunleavy-Stowell</a> and <a href="https://www.linkedin.com/in/kellylwolf/">Kelly Wolf</a> for this engaging panel! We’d also like to give a big thanks to <a href="https://www.farestart.org/">FareStart</a>, <a href="https://www.reignfc.com/">Reign FC</a> and <a href="https://www.reignacademy.com/">Reign Academy</a> for supporting this event. This would not have been possible without the many volunteers from Zulily as well as all the attendees for making the night a success!</p><h4><strong>For more information:</strong></h4><p>If you’d like to chat further with one of our recruiters regarding a position within data science, machine learning or <a href="https://www.zulily.com/careers">any of our other existing roles</a>, feel free to reach out directly to <a href="/service/mailto:techjobs@zulily.com?subject=I%27d%20like%20to%20talk%20about%20jobs!%20%5Bfollow%20up%20from%209/10%20tech%20talk%5d">techjobs@zulily.com</a> to get the conversation started. Also be sure to follow us on <a href="https://www.linkedin.com/company/zulily/">LinkedIn</a> and <a href="https://twitter.com/zulily">Twitter</a>.</p><p><em>Originally published at </em><a href="https://zulily-tech.com/2019/09/24/at-the-top-of-your-game/"><em>https://zulily-tech.com</em></a><em> on September 24, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c52d51b95cb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zulily-tech-blog/at-the-top-of-your-game-8c52d51b95cb">AT THE TOP OF YOUR GAME</a> was originally published in <a href="https://medium.com/zulily-tech-blog">Zulily Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Compute Engine Hadoop clusters with zdutil]]></title>
            <link>https://medium.com/zulily-tech-blog/google-compute-engine-hadoop-clusters-with-zdutil-e309ef0f6a4?source=rss----7f983e729a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/e309ef0f6a4</guid>
            <category><![CDATA[zulily]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[developer-stories]]></category>
            <category><![CDATA[stem]]></category>
            <dc:creator><![CDATA[Melissa Thorne]]></dc:creator>
            <pubDate>Wed, 27 Nov 2019 05:01:48 GMT</pubDate>
            <atom:updated>2019-11-27T05:01:48.138Z</atom:updated>
            <content:encoded><![CDATA[<p>Here at Zulily, we use <a href="https://cloud.google.com/compute/">Google Compute Engine</a> (GCE) for running our Hadoop clusters. Google has a utility called <a href="https://cloud.google.com/hadoop/setting-up-a-hadoop-cluster">bdutil</a> for setting up and tearing down Hadoop clusters on GCE. We ran into a number of issues when using the utility and were using an internally patched version of it to create our Hadoop clusters. If you look at the source, bdutil is essentially a collection of bash scripts that automate the various steps of creating a GCE instance and provisioning it with all the necessary software needed to run Hadoop. One major issue we found with bdutil was that there is no way to provision a Hadoop cluster where the datanodes do not have external IP addresses. For clusters with many datanodes — the kind we typically run — this means we end up running against our quota of external IP addresses. Additionally, there is no reason for the datanodes to have external IP addresses as they should not be accessible to the public.</p><p>We decided to stop patching bdutil and write our own utility to provision a Hadoop cluster. The utility is called zdutil and you can find it on our <a href="https://github.com/zulily/zdutil">GitHub page</a>. Here’s how it works:</p><ul><li>First, GCE instances are created for the namenode and all datanodes in your Hadoop cluster.</li><li>Then, any persistent disks that you requested are created and attached to the instances.</li><li>If you have have any tags that you would like to be applied to the namenode or datanodes, the tags are added to the instances. This saves you from having to manually tag every single instance in your cluster or write your own script to do so.</li><li>Next, all of the required setup scripts to provision the namenode and datanodes are copied to a GCS bucket of your choosing. The namenode then provisions itself.</li><li>Once it completes, it copies (via scp) all scripts needed for datanode provisioning to each datanode and then each datanode will provision itself.</li><li>Once all datanodes have been provisioned, the namenode will start the Hadoop cluster.</li></ul><p>If you deploy the datanodes with either external or ephemeral IP addresses, they will have internet access as determined by the rules of your GCE network. If you deploy the datanodes with “none” for the IP address, they will proxy through the namenode using <a href="http://www.squid-cache.org/">Squid</a>. You don’t have to configure any of this yourself; zdutil will take care of the details for you, including installing and provisioning Squid on your namenode. It is also important to be aware that Google’s version of the <a href="https://cloud.google.com/hadoop/google-cloud-storage-connector">Google Cloud Storage Connector</a> currently does not support proxying. If you use zdutil, it will install <a href="https://github.com/zulily/bigdata-interop">our fork</a> of the GCS Connector which does support proxying by adding the following properties to your Hadoop core-site.xml configuration file: <em>fs.gs.proxy.host</em> and <em>fs.gs.proxy.port</em>.</p><p>If you have any need for zdutil, please use it and give us your feedback. At the moment we only support Debian-based images and we only support Hadoop version 1. If you would like to see another OS supported or Yarn support, please add an issue to the <a href="https://github.com/zulily/zdutil/issues">GitHub page</a>.</p><p>This entry was posted in <a href="https://zulily-tech.com/category/open-source/">Open Source</a>, <a href="https://zulily-tech.com/category/relevancy-and-personalization/">Relevancy and Personalization</a> by . Bookmark the <a href="https://zulily-tech.com/2014/12/03/google-compute-engine-hadoop-clusters-with-zdutil/">permalink</a>.</p><p><em>Originally published at </em><a href="https://zulily-tech.com/2014/12/03/google-compute-engine-hadoop-clusters-with-zdutil/"><em>https://zulily-tech.com</em></a><em> on December 3, 2014.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e309ef0f6a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zulily-tech-blog/google-compute-engine-hadoop-clusters-with-zdutil-e309ef0f6a4">Google Compute Engine Hadoop clusters with zdutil</a> was originally published in <a href="https://medium.com/zulily-tech-blog">Zulily Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimizing memory consumption of Radix Trees in Java]]></title>
            <link>https://medium.com/zulily-tech-blog/optimizing-memory-consumption-of-radix-trees-in-java-1a7bf0800be8?source=rss----7f983e729a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/1a7bf0800be8</guid>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[java-development]]></category>
            <category><![CDATA[zulily]]></category>
            <dc:creator><![CDATA[Melissa Thorne]]></dc:creator>
            <pubDate>Wed, 27 Nov 2019 05:01:22 GMT</pubDate>
            <atom:updated>2019-11-27T05:01:22.742Z</atom:updated>
            <content:encoded><![CDATA[<p>On the <a href="http://www.zulily.com/careers?dept=technology">Relevancy</a> team at Zulily, we are often required to load a large number of large strings into memory. This often causes memory issues. After looking at multiple ways to reduce memory pressure, we settled on <a href="http://en.wikipedia.org/wiki/Radix_tree">Radix Trees</a> to store these strings. Radix Trees provide very fast prefix searching and are great for auto-complete services and similar uses. This post focuses entirely on memory consumption.</p><p>Radix Trees take sequences of data and organize them in a tree structure. Strings with common prefixes end up sharing nodes toward the top of this structure, which is how memory savings is realized. Consider the following example, where we store “antidisestablishmentarian” and “antidisestablishmentarianism” in a Radix Tree:</p><pre>+- antidisestablishmentarian (node 1) +- ism (node 2)</pre><p>Two strings, totaling 53 characters, can be stored as two nodes in a tree. The first node stores the common prefix (25 characters) between it and its children. The second stores the rest (3 characters). In terms of character data stored, the Radix Tree stores the same information in approximately 53% of the space (not counting the additional overhead introduced by the tree structure itself).</p><p>If you add the string “antibacterial” to the tree, you need to break apart node 1 and shuffle things around. You end with:</p><pre>+- anti (node 3) |- disestablishmentarian (node 4) | +- ism (node 2) +- bacterial (node 5)</pre><p>We run a lot of software in the JVM, where memory performance can be tricky to measure. In order to validate our Radix Tree implementation and measure the impact, I pumped a bunch of pseudo-realistic data into various collections and captured memory snapshots with <a href="http://www.yourkit.com/java/profiler/">YourKit Java Profiler</a>.</p><h3>Input Data</h3><p>It didn’t take long to hack together some real-looking data in Ruby with <a href="https://github.com/stympy/faker">Faker</a>. I created four input files of approximately 1,000,000 strings that included a random selection of 12-digit numbers, bitcoin addresses, email addresses and ISBNs.</p><pre>sreed:src/ $ head zulily-oss/radix-tree/12-digit-numbers.txt 141273396879 414492487489 353513537462 511391464467 633249176834 347155664352 632411507158 752672544343 483117282483 211673267195 sreed:src/ $ head zulily-oss/radix-tree/bitcoins.txt 1Mp85mezCtBXZDVHGSTn3NYZuriwRMmW6D 1N8ziuitNLmSnaXy2psYpLcXvugHw1Yc5s 18DnruBzLHmnVHQhDghoa6eDt6sDkfuWKr 1A3sRfAnP89HE4RgNQARa3kCq4xFEF9eev 12WR4DrsR4mM8gDHZCuqXe2h37VUSUPSNu 1PRmYuevwZXZamBEgANzLXe2SjFneGDsXp 1EpjPwt8Ap47XA6HwJhCTxUZRDH11GKWuQ 1P8MAgobhLw4FYcFHbw7a8t2FvQZg8K597 15xhiiLdkin8zi6S5KL9DkDDQyvLb1pjjT 1NPEZeEjgGu5TYdz5d3kxjVfLwxAZ2fK6f sreed:src/ $ head zulily-oss/radix-tree/emails.txt jakayla.hoppe@krajcikpollich.info abbey.goodwin@tromp.org laney.dach@walkerlubowitz.biz rosanna_towne@marks.name sherwood@oberbrunnerauer.name mohamed_rice@champlin.com margaret_kirlin@greenfeldercasper.net vince@funk.net leora_ohara@hackett.biz audra.hermann@bauch.org sreed:src/ $ head zulily-oss/radix-tree/isbns.txt 216962073-7 640524955-7 955360834-5 429656067-0 605437693-4 204030847-4 037410069-1 239193083-6 182539755-4 034988227-4</pre><h3>Measuring Memory with YourKit</h3><p>YourKit provides a measurement of “retained size” in its memory snapshots which is helpful when trying to understand how your code is impacting the heap. What isn’t necessarily intuitive about it, though, is what objects it excludes from this “retained size” measurement. Their <a href="http://yourkit.com/docs/java/help/sizes.jsp">documentation</a> is very helpful here: only object references that are <strong>exclusively</strong> held by the object you’re measuring will be included. Instead of telling you “this is how much memory usage your object imposes on the VM,” retained size instead tells you “this is how much memory the VM would be able to garbage-collect if it were gone.” This is a subtle, but very real, difference if you wish to optimize memory consumption.</p><p>Thus, my memory testing needed to ensure that each collection held complete copies of the objects I wished to measure. In this case, each string key needed to be duplicated (I decided to intern and share every value I stored in order to measure only the memory gains from different key storage techniques).</p><pre>// Results in shared reference, and inaccurate measurement map1.put(key, value); map2.put(key, value); // Results in shared char[] reference, and better but // still inaccurate measurement map1.put(new String(key), value); map2.put(new String(key), value); // Results in complete copy of keys, and accurate measurement map1.put(new String(key.toCharArray()), value); map2.put(new String(key.toCharArray()), value);</pre><h3>Collections Tested</h3><p>I tested our own Radix Tree implementation, ConcurrentRadixTree from <a href="https://code.google.com/p/concurrent-trees/">https://code.google.com/p/concurrent-trees/</a>, a string array, <a href="https://code.google.com/p/guava-libraries/">Guava</a> ‘s ImmutableMap and Java’s HashMap, TreeMap, Hashtable and LinkedHashMap. Each collection stored the same values for each key.</p><p>Both zulily’s Radix Tree and the ConcurrentRadixTree from concurrent-trees were configured to store string data as UTF-8-encoded byte arrays.</p><p>ConcurrentRadixTree was included simply to ensure that our own version (to be open-sourced soon) was worth the effort. The others were measured simply to highlight the benefits of Radix Tree storage for different input types. Each collection has its own merits and in most ways they are all superior to the Radix Tree for storage (put/get performance, concurrency and other features).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/0*qh8e-5D-h6wrY64Q" /></figure><p>First of all, Guava’s ImmutableMap is pretty good. It stored the same key and value data as java.util.HashMap in 92–95% of the space. The Radix Tree breaks keys into byte array sequences and stores them in a tree structure based on common prefixes. This resulted in a best case of 62% the size of the ImmutableMap for bitcoin addresses (strings which have many common prefixes) and a worst case 88% for random 12-digit numbers. We see that the memory used by this data structure is largely dependent on the type of data put into it. Large strings with many large common prefixes are stored very efficiently in a narrow tree structure. Unique strings create a lot of branches in the underlying tree, making it very wide and adding a lot of overhead.</p><p>Converting Java Strings to byte arrays accounts for most of the memory savings, but not all. Byte array storage was anywhere from 90% (bitcoin addresses) to 99% (ISBNs) in the tests I ran.</p><p>For us, storing byte-encoded representations of string data in a radix tree allowed us to reclaim valuable memory in our services. However it wasn’t until validating the implementation in an accurate manner with realistic data and trustworthy tools that we rested easy knowing we had set out what we wished to accomplish.</p><p><em>Originally published at </em><a href="https://zulily-tech.com/2014/09/15/optimizing-memory-consumption-of-radix-trees-in-java/"><em>https://zulily-tech.com</em></a><em> on September 16, 2014.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a7bf0800be8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zulily-tech-blog/optimizing-memory-consumption-of-radix-trees-in-java-1a7bf0800be8">Optimizing memory consumption of Radix Trees in Java</a> was originally published in <a href="https://medium.com/zulily-tech-blog">Zulily Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Experience optimization at Zulily]]></title>
            <link>https://medium.com/zulily-tech-blog/experience-optimization-at-zulily-a1f8c02f4053?source=rss----7f983e729a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/a1f8c02f4053</guid>
            <category><![CDATA[zulily]]></category>
            <category><![CDATA[personalization]]></category>
            <category><![CDATA[developer-stories]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Melissa Thorne]]></dc:creator>
            <pubDate>Wed, 27 Nov 2019 05:00:54 GMT</pubDate>
            <atom:updated>2019-11-27T05:00:54.305Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*ZahV44DlYTyv2LWm" /></figure><p>Experimentation is the name of the game for most top tech companies, and it’s no different here at Zulily. Because new Zulily events launch every day, traditional experiments can be cumbersome for some applications. We need to be able to move quickly, so we’ve built a contextual multi-armed bandit system that learns in real time to help us deliver the best experience to each Zulily member.</p><p>As Zulily has grown over the past four and a half years, the number of new events and products launching each day has increased at a tremendous pace. This is great for our members, but it brings with it the challenge of ensuring that each member’s experience is as personalized as possible. My team, the Data Science team, and Relevancy, with whom we work closely, are tasked with seamlessly optimizing and customizing that experience. In order to do so, we run experiments — a lot of them. Even the most minor changes to the site usually have to prove their mettle by beating a control group in a well-designed, sufficiently-powered experiment.</p><p>This is a great approach for testing out changes before we push them to all of our members. However, it also comes with some obvious and not-so-obvious drawbacks.</p><p>1) Collecting data in well-designed experiments (i.e., experiments with high statistical power, large sample sizes, and well-specific stopping rules) can take a long time, especially if the groups getting the treatment are very small or the effect of that treatment on behavior is expected to be small.</p><p>2) Most of Zulily’s events are only available for three days and are only on the front page for one day. This doesn’t provide much time, and the event may be over before the experiment concludes.</p><p>3) Experiments often have the goal of finding which experience is the “best” experience — many people have read stories of companies testing many shades of colors for their buttons to find the best one. While this is appropriate for more permanent aspects of the site, it runs contrary to the idea of a personalized experience. We want to find the best experience *for you, right now* — and what’s best for you might change.</p><p><strong>Our Solution</strong></p><p>We decided to implement a system that learns in real time and guides which experiences are being delivered to members. This system is called a <a href="http://en.wikipedia.org/wiki/Multi-armed_bandit">multi-armed bandit</a> (MAB). To better understand what a MAB is, imagine walking into a casino and seeing, instead of rows of slot machines, a slot machine with multiple levers. You know that one of those levers pays out rewards at a higher rate than the other ones, but you don’t know which one. There’s a catch, too: all of those levers will pay out some of the time, which makes finding the winning one pretty difficult.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*kWaH0oVVThrf5lBj" /></figure><p>You are tasked with figuring out which lever’s the best, and the only way you can is to run lots of experiments. You pull one of the levers, make a note if it pays out or not, and then either pull it again or pull another one. As you pull the levers, you start to pull the ones that seem to be rewarding at a higher rate more often, but returning to the other levers if that rate was just inflated due to randomness.</p><p>Fundamentally, you have to balance between searching for the lever you think is the winner and trying to pull the winning lever as much as possible. Search for too long, and you’re missing out on the gains you could have had from the winning lever; search too little and you might have settled on an also-ran lever. Even worse, what if the levers change their reward rate after a while? You’d miss that, too.</p><p>This might seem like a contrived example, but it ends up being very powerful as a way to deliver many different experiences to our members and get real-time feedback. We need to stay flexible and optimize the experience for different kinds of members who may visit at different points in the day. The MAB occasionally tries out different experiences in new situations to see if its operating assumptions about its available choices are still holding up. Luckily, we get thousands of visits an hour, and can collect and process a lot of data to help us.</p><p>Now, you may have noticed that this approach has the same shortcoming as #3 above. That’s where the contextual part of “contextual multi-armed bandit” fits in. We’ve implemented a slightly more complicated algorithm that not only looks to deliver the best experience out of a set of choices — it tries to deliver the best one for you and members like you. We recognize that our members are a diverse bunch and what’s an optimal experience for some members may not be the optimal experience for others.</p><p><strong>THE GORY DETAILS</strong></p><p>Since this is an engineering blog, I’d be remiss if I didn’t delve into some of the more technical details about our contextual bandit. If you’re interested in learning more about multi-armed bandits, I highly recommend <a href="http://shop.oreilly.com/product/0636920027393.do">John Myles White’s book</a> on the topic.</p><p>We prototyped the system using Python, the language of choice for the Data Science team. Because contextual MABs learn through reinforcement and rely on contextual information about the user and the experience, testing them offline has some challenges. You never know exactly which members will visit the site on a given day, in what order, and how they will react when faced with a given experience. To solve this problem, we used what are known as <a href="http://en.wikipedia.org/wiki/Monte_Carlo_method">Monte Carlo simulations</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/0*HnnRLuHzSKp0ex_w" /></figure><p>We simulated the process of members with given browsing histories visiting the site and interacting with the chosen experience with some pre-defined probability. We kept track of the math that the MAB was doing at each step and tracked how often and how quickly it learned from these interactions. Once we were comfortable that the MAB was operating as expected under controlled conditions, the Relevancy engineers took over and implemented it in Java so that it could handle thousands of requests an hour without any site experience degradation.</p><p>Finally, we released it into the wild — but not before it proved its mettle by beating a control group in a well-designed, sufficiently powered experiment.</p><p><em>Originally published at </em><a href="https://zulily-tech.com/2014/06/16/experience-optimization-at-zulily/"><em>https://zulily-tech.com</em></a><em> on June 17, 2014.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1f8c02f4053" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zulily-tech-blog/experience-optimization-at-zulily-a1f8c02f4053">Experience optimization at Zulily</a> was originally published in <a href="https://medium.com/zulily-tech-blog">Zulily Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simulating Decisions to Improve Them]]></title>
            <link>https://medium.com/zulily-tech-blog/simulating-decisions-to-improve-them-e8c89a2298a8?source=rss----7f983e729a44---4</link>
            <guid isPermaLink="false">https://medium.com/p/e8c89a2298a8</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[developer-stories]]></category>
            <category><![CDATA[personalization]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[zulily]]></category>
            <dc:creator><![CDATA[Melissa Thorne]]></dc:creator>
            <pubDate>Wed, 27 Nov 2019 05:00:26 GMT</pubDate>
            <atom:updated>2019-11-27T05:00:26.570Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the jobs of the Data Science team is to help Zulily make better decisions through data. One way that manifests itself is via experimentation. Like most eCommerce sites, Zulily continuously runs experiments to improve the customer experience. Our team’s contribution is to think about the planning and analysis of those tests to make sure that when the results are read they are trustworthy and that ultimately the right decision is made.</p><p>As a running example throughout this post, consider a landing page experiment. At Zulily, we have several landing pages that are often the first thing a visitor sees after they click an advertisement on a third-party site. For example, if a person was searching for pet-related products, and they clicked on one of Zulily’s ads, they might land <a href="http://www.zulily.com/pets">here</a>. Note: while that landing page is real, all the underlying data in this post is randomly generated.</p><p>The experiment is to modify the landing page in some way to see if conversion rate is improved. Hopefully data has been gathered to motivate the experiment but, please, just take this at face-value.</p><p>Any single landing page is not hugely critical, but in aggregate they’re important for Zulily, and small improvements in conversion rates or other metrics can have a large impact on the bottom line. In this example, the outcome metric (what is trying to be improved) is conversion rate, which is simply the number of conversion over the total number of visitors.</p><p>Planning an experiment consists of many things, but often the most opaque part is the implications associated with <a href="http://en.wikipedia.org/wiki/Statistical_power">power</a>. The simple definition of power: given some effect of the treatment, how likely will that effect be detectable. The implication here is that the more confident one wants to be in their ability to detect the change, the longer the test needs to run. How long the test needs to run has a direct bearing on the number of tests a company can run as a whole and which tests should be given priority… unless you don’t care about conflating treatments, but then you have bigger problems :).</p><p>Power analysis, however, is a challenge. For anything beyond a simple <a href="http://en.wikipedia.org/wiki/A/B_testing">AB test</a>, a lot needs to be thought through to determine the appropriate test. Therefore, it is often easier to think about the data, then work backwards through the analysis, and then the power.</p><p>Ultimately power analysis boils down to the simple question: for how long does a test need to run?</p><p>To illustrate this, consider the example experiment, where the underlying conversion rate for landing page A (the control) is 10%, and the expected conversion rate of the treatment is 10.5%. While these are the underlying conversion rates, due to randomness the realized conversion rate will likely be different, but hopefully close.</p><p>Imagine that each page is a coin, and each time a customer lands on the page the coin is flipped. Even though it’s known <em>a priori</em> that the underlying conversion rate for page A is 10%, if the coin is flipped 1000 times, it’s unlikely that it will be “heads” 100 times. If you were to run two tests, you would get two different results, even though all variables are the same.</p><p>The rest of the post walks through the analysis of a single experiment, then describes how to expand that single experiment analysis into an analysis of the decision making process, and finally discusses a couple examples of complications that often arise in testing and how they can be incorporated into the analysis of the decision making.</p><p>For instance: flipping the “landing page” coin, so to speak, 1000 times for each page, A and B. In this one experiment, the realized conversion rates (for fake data) are in the bar chart below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/0*7TNNxwtN2VZvYDWr" /></figure><p>That plot sure looks convincing, but just looking at the plot is not a sufficient way to analyze a test. Think back to the coin flipping example; since the difference in the underlying “heads” rate was only 0.5%, or 5 heads per 1000 flips, it wouldn’t be too surprising if A happened to have more heads than B in any given 1000 flips.</p><p>The good news is that statistical tools exist to help make it possible to understand how likely the difference observed was truly due to an underlying difference in rates, due to randomness.</p><p>The data collected would look something like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/166/0*o0pHAnPaTUrxc2H_" /></figure><p>where Treatment is the landing page treatment, and Converted is 0 for a visit without a conversion and 1 for a visit with a conversion. For an experiment like this, that has a binary outcome, the statistical tool to choose is logistic regression.</p><p>Now we get to see some code!</p><p>Assuming the table from above is represented by the “visits” dataframe, the model is very simple to fit in <a href="https://github.com/statsmodels/statsmodels">statsmodels</a>.</p><p>The output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*FTSkJQHohVK28W1n" /></figure><p>This is a lot information, but the decision will likely be based on only one number: in the second table, the interception between “C(Treatment)[T.B]” and “P&gt;|z|”. This is one minus the probability that the difference between the two conversion rates is actually different, or the significance level. The convention is that if that value is less than .05, the difference is significant. Another number worth mentioning is the coefficient of the treatment. This is how much change is estimated. It’s important, because even if the outcome was significant it’s possible to have been a significant negative coefficient, and then the decision is worse than just not accepting a better page, since we’ll accept a worse landing page.</p><p>In this case the significance level is greater than .05, so the decision would be that the difference observed is not indicative of an actual difference in conversion rates. This is clearly the wrong decision. The conversion rates were specified as being different, but that difference cannot be statistically detected.</p><p>This is ultimately the challenge with power and sample sizes. Had the experiment been run again, with a larger sample, it is possible that we would have detected the change and made the correct decision. Unfortunately, the planning was done incorrectly and only 1000 samples were taken.</p><p>Although the wrong decision was made in the last experiment, we want to improve our decision making. It is possible to analyze our analysis through simulation. It is a matter of replicating — many times over — the analysis and decision process from earlier. Then it is possible to find out how often the correct decision would be made given the actual difference in conversion rate.</p><p>Put another way, the task is to:</p><ol><li>Generate a random data-set set for the treatment and control group based on the expected conversion rates.</li><li>Fit the model that would have been from the example above.</li><li>Measure the outcome based on the decision criteria; here it’ll just be a significant p-value &lt; 0.05.</li></ol><p>And now be prepared for the most challenging part: the simulation. These three steps are going to be wrapped in a for loop, and the outcome is collected in an array. Here’s a simple example in python of how that could be carried out.</p><p>Running that experiment 500 times, with a sample size of 1000, would yield a correct decision roughly 4.2% of the time. Ugh.</p><p>This is roughly the power the of the experiment at a sample size of 1000. If we did this experiment 500 times, we would rarely make the correct decision. To correct this, we need to change the experiment plan to generate more trials.</p><p>To get a sense for the power at different sample sizes we choose several possible sample sizes, then run the above simulation for those samples. Now there are two for loops: one for to iterate through the sample size, and one to carry out the analysis above.</p><p>Here is the outcome of the decisions at various sample sizes. The “Power” column is the proportion of time a correct decision was made at the specified sample size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/98/0*ibR7m5QjXPsF0RL2" /></figure><p>Not until 10⁴.5 samples — roughly 31,000 — does the probability of making the correct decision become greater than 50%. It is now a matter of making the business decision about how necessary it is to detect the effect. Typically it is around 80%, in the same way that the significance level is normally around 5%… convention. It would be easy to repeat this test for several intermediate sample sizes, between 10⁴.5 and 10⁵, to determine a sample size that has the power the business is comfortable with.</p><h3>Uncertainty in Initial Conversion Rate</h3><p>The outcome of the experiment was given a lot of criticism, but the underlying conversion rate was (more or less) taken for granted. The problem is there’s probably a lot of error in the estimated effect of the treatment before the experiment, and some error in the estimated effect of the control, since the control is based on past performance and the treatment is based on a combination of analysis and conjecture.</p><p>For example, say we had historical data that indicated that 1,000 out of 10,000 people had converted for the control thus far, and we ran a similar test to the control recently, so we have some confidence that 105 out of 1,000 people would convert.</p><p>If that was the prior information for each page the distribution for conversion rate for each landing page over 1,000 experiments could look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/0*AMWCIM1y_oVMowwB" /></figure><p>Even though it appears that landing page B does have a higher conversion rate on average, its distribution around that average is much wider. To factor in that uncertainty, we can rerun that model with but instead of assuming a fixed conversion rate, we can sample from the distribution of the conversion rate before each simulation. Here’s the outcome, similar to above, of the proportion of times we’d make the correct decision.</p><p>Sadly our power was destroyed by the randomness associated with the uncertainty between landing pages. Here’s the same power by sample size table as above. For example, at 10⁵.0 it is likely that conversion rate for landing page B was less than landing page A.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/93/0*EfFcOak-eTvHW1jx" /></figure><p>An alternative route in a situation like this is the use of a <a href="http://en.wikipedia.org/wiki/Beta-binomial_distribution">beta-binomial model</a> to continue to incorporate additional data to the initial conversion rates.</p><h3>More Complicated Experiments</h3><p>The initial example was a very simple test, but more complex tests are often useful. With more complex experiments, the framework for planning needs to expand to facilitate better decision making.</p><p>Consider a similar example to the original one with an additional complication. Since the page is a landing page, the user had to come from somewhere. These sources of traffic are also sources of variation. Just like how any realized experiment could vary from the expectation, any given source’s underlying conversion rate could also could also vary from the expectation. In the face of that uncertainty, it would be a good idea to run the test on multiple ads.</p><p>To simplify our assumptions, consider that the expected change in conversion rate is still 0.5%, but across three ads the conversion rate varies individually by -0.01%, 0.00% and +0.01% due to the individual ad-level characteristics.</p><p>For example, this could be outcome of one possible experiment with two landing pages and three ads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/0*OCo7OO6R7mRhmqPC" /></figure><p>Thankfully statsmodels has a consistent API so just a few things need to change to fit this model:</p><ul><li>Use <a href="http://en.wikipedia.org/wiki/Generalized_estimating_equation">gee</a> instead of logit. This is a general estimating equation. It enables a correlation within groups for a GLM to be fit, or, for these purposes, a logit regression with the group level variances taken into consideration.</li><li>Pass the groups via the “groups” argument.</li><li>Specify the family of the GLM; here it’s binomial with a logit link function (the default argument).</li></ul><p>Those changes would like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/0*bZALCQVEn6Rqfe78" /></figure><p>The decision criteria here is similar to the first case, so we cannot say anything about the effect of the landing page, and likely this test would not roll out. Now that the basic model is constructed, we follow the same process to estimate how much power the experiment would have at various levels of sample size.</p><p>Experiments are challenging to execute well, even with these additional tools. The groups that have sufficient size to necessitate testing are normally sufficiently large and complex that wrong decisions can be made. Through simulation and thinking about the decision-making process, it is possible to quantify how often a wrong decision could occur, its impact, and how to best mitigate the problem.</p><p>(By the way, Zulily is actively looking for <a href="http://www.zulily.com/careers/position/3546">someone</a> to make experimentation better, so if you feel that you qualify, please apply!)</p><p><em>Originally published at </em><a href="https://zulily-tech.com/2014/12/10/simulating-decisions-to-improve-them/"><em>https://zulily-tech.com</em></a><em> on December 10, 2014.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8c89a2298a8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zulily-tech-blog/simulating-decisions-to-improve-them-e8c89a2298a8">Simulating Decisions to Improve Them</a> was originally published in <a href="https://medium.com/zulily-tech-blog">Zulily Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>