<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shaun Hall on Medium]]></title>
        <description><![CDATA[Stories by Shaun Hall on Medium]]></description>
        <link>https://medium.com/@shaun.hall?source=rss-18d8d642904d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*THzl89T5i3fXZIjG</url>
            <title>Stories by Shaun Hall on Medium</title>
            <link>https://medium.com/@shaun.hall?source=rss-18d8d642904d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 18:46:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shaun.hall/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[THG’s Ingenuity and Google Cloud]]></title>
            <link>https://medium.com/thg-tech-blog/thgs-ingenuity-and-google-cloud-cca125d6a5ee?source=rss-18d8d642904d------2</link>
            <guid isPermaLink="false">https://medium.com/p/cca125d6a5ee</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Shaun Hall]]></dc:creator>
            <pubDate>Wed, 31 Oct 2018 11:16:19 GMT</pubDate>
            <atom:updated>2018-10-31T11:16:19.695Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOayu0dijF0TUgtxvDSnMg.png" /><figcaption>THG’s tech platform, Ingenuity, powers some big brands.</figcaption></figure><p>The brands running on Ingenuity’s e-commerce platform attracted 500 million customers and generated £736m revenue <a href="https://www.thg.com/press/">last year</a>. Automated marketing and data analytics are key to this success, and here’s how we use GCP (Google Cloud Platform) to power this part of our platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_zqSpwnsiWZzMy18NyHyA.png" /><figcaption>We capture both frontend and backend customer interations to analyse how customers interact with site features and check platform health.</figcaption></figure><p>The raw data from the customer isn’t quite enough to be useful on its own. We need to add information about fx rates at the time and detect bots — they skew a/b test analyses and we don’t want to waste resources trying to convince them to buy. This is done by the Data Enrichment Application, which we run in GKE (Google Kubernetes Engine).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/032bf5f089c2362272126d919d6c733c/href">https://medium.com/media/032bf5f089c2362272126d919d6c733c/href</a></iframe><p>The enrichment app needs to issue a NACK to reprocess the message when there is a transient issue, but should ACK the message and throw an alert if there is a more serious issue with the message to avoid an infinite reprocessing loop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GLb68Z70mJHb_Nzrc2u9Sg.png" /><figcaption>Here’s how the enrichment app performs during a Black Friday load simulation</figcaption></figure><p>We’re using CPU-based horizontal pod autoscaling (HPA) in kubernetes to scale the enrichment app when it gets busy. We also have a variable number of nodes in our kubernetes cluster — you can see new nodes being started at 10:25 above. A small backlog builds up during the test because the CPU scaling metric is just an approximation for the true metric we want — pubsub backlog size and growth rate (we could implement this with <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics">custom metrics</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N4RgoEwlc_I-fADDyZ21SQ.png" /><figcaption>We use a combination of pub/sub and bigquery to support both realtime and batch applications</figcaption></figure><p>Some applications need to run in realtime, such as site health monitors, and others run on a batch basis, like product recommendations. We can cater for both of these models by writing an adapter layer, which streams from Pub/Sub into BigQuery. We’ve experimented with writing the adapter in GKE as well as Dataflow, and the Dataflow scaling is much more effective, although the programming model is more restrictive (it’s declarative, based on the <a href="https://beam.apache.org/">Apache Beam SDK</a>):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/76b76a360c901da7d45c8ba51aacc53d/href">https://medium.com/media/76b76a360c901da7d45c8ba51aacc53d/href</a></iframe><p>Here, we’re batching together events into 1 minute-wide intervals and writing into the relevant date-partitioned table. There are a few subtleties around how we determine time (it’s data in the event body rather than arrival time) and handling late arrivals (we keep the window open for 30 minutes so we can tolerate a backlog).</p><h3>Business Applications</h3><p>Product recommendations are responsible for between 1–4% of all revenue on our sites. Some are personalised and calculated in realtime, and others look at overall customer patterns and are calculated as batch jobs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-n6fnnjy4vGJ2rMCUZOCA.png" /></figure><p>Most of our platform runs on <a href="https://www.thg.com/2017/05/26/thg-makes-1st-technology-investment-global-infrastructure-player-uk2/">THG’s data centres</a>, and the 20ms RTT between those and GCP is too high to block user-impacting requests, so we pull the relevant data for our algorithms into our DC from GCP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uGLnUurk2Yyfyj3UwX-xJA.png" /><figcaption>Green lines are calls on a latency-critical path.</figcaption></figure><p>We have a number of realtime dashboards around the office visualising technical and business metrics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cXrW8nVAVAi-hjnqsW7Udw.png" /><figcaption>The “cashboard” (left) and global speed checker (right)</figcaption></figure><p>When the cashboard lights up on Black Friday, it’s time to party!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cca125d6a5ee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thg-tech-blog/thgs-ingenuity-and-google-cloud-cca125d6a5ee">THG’s Ingenuity and Google Cloud</a> was originally published in <a href="https://medium.com/thg-tech-blog">THG Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>