<?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 Stephan Claus on Medium]]></title>
        <description><![CDATA[Stories by Stephan Claus on Medium]]></description>
        <link>https://medium.com/@stephanclaus?source=rss-59fd88a5b400------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_HHkhZZly2YBzJqQ4RcvGQ.jpeg</url>
            <title>Stories by Stephan Claus on Medium</title>
            <link>https://medium.com/@stephanclaus?source=rss-59fd88a5b400------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 20:56:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@stephanclaus/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[How Tecton’s Feature Platform Supercharged HomeToGo’s Ranking]]></title>
            <link>https://engineering.hometogo.com/how-tectons-feature-platform-supercharged-hometogos-ranking-5c7ae60f063e?source=rss-59fd88a5b400------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c7ae60f063e</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[feature-store]]></category>
            <category><![CDATA[tecton]]></category>
            <dc:creator><![CDATA[Stephan Claus]]></dc:creator>
            <pubDate>Mon, 14 Oct 2024 05:50:45 GMT</pubDate>
            <atom:updated>2024-10-16T10:20:41.161Z</atom:updated>
            <content:encoded><![CDATA[<p>At HomeToGo, our vision is to make incredible homes easily accessible to everyone. As the SaaS-enabled marketplace with the world’s largest selection of vacation rentals, we rely heavily on advanced machine learning models to provide personalised recommendations and optimise search results. Ensuring these models have access to high-quality, reliable data in (near to) real-time is crucial to delivering a superior user experience. This is where Tecton, our feature platform, comes into play.</p><h3>What is a feature store/feature platform?</h3><p>Much has been written about this topic already, so piggybacking on <a href="https://eugeneyan.com/writing/feature-stores/">elaborate treatments of this question</a>, a feature platform in the context of this post refers to</p><blockquote><strong>A tool to serve and aggregate feature data for machine learning models at low latency. It also ensures the data’s integrity and correctness across training and production environments.</strong></blockquote><h3>Ranking setup within HomeToGo:</h3><ul><li><strong>Elasticsearch: </strong>Elasticsearch is our primary search engine, responsible for indexing, searching and filtering our vast database of vacation rental listings</li><li><strong>Snowplow: </strong>Snowplow is used for comprehensive event tracking, capturing user interactions and behaviors across our platform. It is one of the primary sources for the data warehouse</li><li><strong>Snowbridge: </strong>Small service for replicate or route streams, it connects to kinesis and has multiple configurable sinks such as http endpoint</li><li><strong>Snowflake: </strong>Snowflake serves as our central data warehouse, storing both historical and real-time data. It also integrates seamlessly with Tecton using <strong>Snowbridge</strong> for managing feature data</li><li><strong>HomeToGo Search Service: </strong>Our custom ranking service applies machine learning models to the retrieved listings and determines their order based on relevance and user preferences. It encapsulates Prescoring and Rescoring models and also has its own in memory database for slowly changing features. We update once a day and this helps to serve requests in low latency</li><li><strong>Prescoring: </strong>The<strong> </strong>Prescoring step assigns initial score for all inventory before filtering.<strong> </strong>Prescoring runs in a batch pipeline, with the results written to elasticsearch. The<strong> </strong>Prescoring step assigns initial score for all inventory before filtering.<strong> </strong>Prescoring runs in a batch pipeline, with the results written to Elasticsearch. The scores will be used in selecting candidates to rank combined with various filters related to user selection. scores will be used in selecting candidates to rank combined with various filters related to user selection.</li><li><strong>Rescoring: </strong>Rescoring builds the final ranked list after filtering</li></ul><h3>Features in the Ranking Pipeline</h3><p>On a high level our structure looks like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/0*zrW-j4hFYcL29FGM" /></figure><p>In the past, features in the ranking pipeline at HomeToGo were broadly categorised into two groups:</p><p><strong>Offline Features</strong></p><ul><li><strong>Definition:</strong> These features change slowly and can be computed at regular intervals, typically daily, within the data warehouse (DWH) before being exported to the live ranking service.</li><li><strong>Examples:</strong> Offer features, provider-level features, and derived features computed over multi-week time windows.</li></ul><p><strong>Request time features:</strong></p><ul><li><strong>Definition:</strong> These features are available only at request time within the search service.</li><li><strong>Examples:</strong> User search parameters such as desired check-in durations, locations, and number of bedrooms. Additionally, transformations based on these parameters can be created.</li></ul><p>However, this classification revealed a significant gap between offline and request time features. This gap pertains to live features.</p><p><strong>Live Features</strong></p><ul><li><strong>Definition:</strong> Features that depend on recent history, ranging from a few seconds to a couple of hours.</li><li><strong>Challenges:</strong> These features were previously troublesome to handle due to their intermediate nature, yet they are crucial for personalizing the user experience and identifying high-value users.</li><li><strong>Importance:</strong> They play a vital role in enhancing personalization and improving the overall user experience by offering more timely and relevant data points.</li></ul><p>By addressing this gap with our current technology stack, including Tecton and Snowbridge, we can now efficiently manage and utilise these live features, ensuring a more responsive and personalised service for our users.</p><h3>Tecton setup:</h3><p>To establish our feature platform, we utilized <strong>Tecton Rift</strong>, Tecton’s managed Python compute engine. This setup allowed us to manage the features entirely in Python, eliminating the need for a Spark backend. Additionally, <a href="https://docs.tecton.ai/docs/defining-features/data-sources/creating-a-data-source/creating-and-testing-a-batch-data-source">Tecton’s integration with Snowflake</a>, available since the end of last year, further simplified the process of incorporating Tecton into our existing stack.</p><p><strong>Snowflake</strong> serves as our data warehouse (DWH), providing all offline data sources for Tecton, while Tecton efficiently manages and serves these data sources, ensuring point-in-time correctness and seamless data access.</p><p>Snowplow’s <strong>Snowbridge</strong> allows us to stream parts of our live event-tracking data directly to Tecton using the stream ingest API. This involves a small amount of JavaScript code to select the events to be streamed to Tecton, however all feature transformations are written in Python within Tecton.</p><p>By leveraging Tecton Rift and Snowbridge, we streamline our feature management pipeline, enhancing the real-time capabilities and overall efficiency of our machine learning infrastructure.</p><h3>Example feature: Clicks_by_user_24h:</h3><p>After giving a high level overview of our setup, we want to use this and walk through a short (fictional) example of setting up a single feature, total clicks by a given user over the last 24 hours.</p><h4>Ingestion setup</h4><p><em>Batch Source</em></p><p>Therefore we start by defining two data sources, a <em>batch</em> and a <em>streaming source</em> to combine them into a single feature.</p><p>We start with the BatchSource: This is a straightforward Snowflake connection, defining access information as well as the query to retrieve the click information we are interested in.</p><pre>from tecton import BatchSource,SnowflakeConfig<br><br># Configure BatchSource with the Snowflake Config<br># SDK Reference: https://docs.tecton.ai/docs/beta/sdk-reference/data-sources/tecton.BatchSource<br>click_batch_source_config = SnowflakeConfig(<br>     url=&quot;https://xyz.snowflakecomputing.com/&quot;,<br>     database=&quot;TECTON_SERVICE&quot;,<br>     role=&quot;TECTON_SERVICE&quot;,<br>     schema=&quot;TEST&quot;,<br>     warehouse=&quot;SERVE&quot;,<br>     query=(&quot;SELECT EVENT_ID, EVENT_TIMESTAMP, USER_ID FROM TECTON_SERVICE.TECTON_INGEST.CLICK_BATCH&quot;),<br>        timestamp_field=&quot;EVENT_TIMESTAMP&quot;<br>)<br>clicks_batch_source = BatchSource(<br>    name=&quot;clicks_batch&quot;,<br>    description=&quot;Returns click events.&quot;,<br>    batch_config=click_batch_source_config,<br>    owner=&quot;example@example.com&quot;<br>)</pre><p><em>Live Source</em></p><p>To define our live source, we leverage Tecton’s <a href="https://docs.tecton.ai/docs/defining-features/data-sources/creating-a-data-source/creating-and-testing-a-push-source"><strong>Stream ingest API</strong></a>.</p><p>Stream ingestion API really simplifies data ingestion as it provides you HTTPs endpoint where you can submit your data in json format, this opens many integration options.</p><pre>from tecton import PushSource<br>from tecton.types import String, Timestamp, Field, Float64<br>from snowflake import clicks_batch_source, click_batch_source_config<br><br>input_schema = [<br>    Field(name=&quot;EVENT_ID&quot;, dtype=String),<br>    Field(name=&quot;EVENT_TIMESTAMP&quot;, dtype=Timestamp),<br>    Field(name=&quot;USER_ID&quot;, dtype=String),<br>]<br><br>clicks_event_source = PushSource(<br>    batch_config=click_batch_source_config,<br>    name=&quot;click_event_source&quot;,<br>    schema=input_schema,<br>    description=&quot;A push source for synchronous, online ingestion of click events.&quot;<br>)</pre><p><strong>Snowbridge configuration</strong></p><p>In the Snowbridge configuration we will use HTTP endpoint output connected to the user behavior stream in kinesis. It will send user events to Tecton push source.</p><p>Full configuration documentation can be found <a href="https://docs.snowplow.io/docs/destinations/forwarding-events/snowbridge/configuration/">here</a>.</p><pre>source {<br>  use &quot;kinesis&quot; {<br>    stream_name       = &quot;enriched-user-events&quot;<br>    region            = &quot;us-west-1&quot;<br>    app_name          = &quot;snowbridge-tecton&quot;<br>    start_timestamp   = &quot;2020-01-01 10:00:00&quot;<br>  }<br>}<br># Use only conversion events from snowplow in this stream<br>transform {<br>  use &quot;spEnrichedFilter&quot; {<br>    atomic_field = &quot;event_name&quot;<br>    regex = &quot;^(event-conversion)$&quot;<br>    filter_action = &quot;keep&quot;<br>  }<br>}<br># Send events to HTTP endpoint<br>target {<br>  use &quot;http&quot; {<br>    url = &quot;${env.TECTON_ENDPOINT_URL}&quot;<br>    content_type = &quot;application/json&quot;<br>    headers = &quot;{\&quot;Authorization\&quot;: \&quot;Tecton-key ${env.TECTON_API_KEY}\&quot;}&quot;<br>  }<br>}<br># For transformation and second level filtering we will use javascript<br>transform {<br>  use &quot;js&quot; {<br>    script_path = env.JS_SCRIPT_PATH<br>    snowplow_mode = true<br>  }<br>}</pre><p>And in order to transform the event to the Tecton push source accepted format, we need a filter.js:</p><pre>function main(input) {<br>    // Validate input and check for required event type<br>    if (!input?.Data || input.Data.event !== &quot;unstruct&quot;) {<br>        return { FilterOut: true };<br>    }<br>    // Extract click event details<br>    const clickEvent = extractclickEvent(input.Data);<br>    if (!clickEvent) {<br>        return { FilterOut: true };<br>    }<br>    // Create and return the new record acording to schema<br>    return {<br>        Data: {<br>            workspace_name: &quot;prod&quot;,<br>            dry_run: false,<br>            records: {<br>                click_event_source: [<br>                    {<br>                        record: {<br>                            TIMESTAMP: input.Data.collector_tstamp || null,<br>                            EVENT_ID: input.Data.event_id || null,<br>                            USER_ID: input.Data.userid<br>                        }<br>                    }<br>                ]<br>            }<br>        }<br>    };<br>}</pre><p>In addition to this real time configuration, you also will need to route the same events to the Snowflake table mentioned above in the batch source — but we will skip how to do that in this example.</p><h4>How to define a feature</h4><p>This code defines how to construct the feature value, any <a href="https://docs.tecton.ai/docs/defining-features/feature-views/aggregation-engine/aggregation-functions">aggregation</a> or simple transformation can be defined in function in pure python. <a href="https://docs.tecton.ai/docs/defining-features/entities">Entity</a> will be used to define what join keys feature will use.</p><pre>from datetime import datetime, timedelta<br>from tecton.types import Timestamp, String, Field<br>from tecton import Entity<br>from tecton import stream_feature_view, Aggregation<br> <br>user = Entity(<br>    name=&quot;user&quot;,<br>    join_keys=[&quot;USER_ID&quot;],<br>)<br><br>output_schema = [<br>    Field(name=&quot;EVENT_TIMESTAMP&quot;, dtype=Timestamp),<br>    Field(name=&quot;EVENT_ID&quot;, dtype=String),<br>    Field(name=&quot;USER_ID&quot;, dtype=String),<br>]<br><br><br>@stream_feature_view(<br>    name=&quot;user_clicks&quot;,<br>    source=clicks_event_source,<br>    entities=[user],<br>    schema=output_schema,<br>    alert_email=&quot;example@example.com&quot;,<br>    aggregations=[<br>        Aggregation(<br>            column=&quot;EVENT_ID&quot;,<br>            function=&quot;count&quot;,<br>            time_window=timedelta(days=7),<br>            name=&quot;clicks_24h_count&quot;,<br>        ),<br>    ]<br>)<br>def user_clicks(df):<br>    return df</pre><p>Final step is using <a href="https://docs.tecton.ai/docs/sdk-reference/feature-services/FeatureService">FeatureService</a> to expose API endpoint for our feature view. Note:you can have multiple feature views in one service.</p><pre>from tecton import FeatureService<br><br>service = FeatureService(<br>  name=&quot;user_clicks_service&quot;,<br>  features=[user_clicks]<br>)</pre><p>And now a similar workflow to the terraform: we just need to run the command tecton plan to see if the changes made in Tecton are what we expect and apply them.</p><pre>$ tecton plan<br><br>Using workspace &quot;prod&quot; on cluster https://xyz.tecton.ai<br>✅ Imported 1 Python module from the feature repository<br>✅ Imported 1 Python module from the feature repository<br>⚠  Running Tests: No tests found.<br>✅ Collecting local feature declarations<br>✅ Performing server-side feature validation: Initializing.<br> ↓↓↓↓↓↓↓↓↓↓↓↓ Plan Start ↓↓↓↓↓↓↓↓↓↓<br><br>  + Create Batch Data Source<br>    name:           clicks_batch<br>    owner:          example@example.com<br>    description:    Returns click events.<br><br>  + Create Stream Data Source<br>    name:           click_event_source<br>    description:    A push source for synchronous, online ingestion of click events.<br><br>  + Create Entity<br>    name:           user<br><br>  + Create Transformation<br>    name:           user_clicks<br><br>  + Create Stream Feature View<br>    name:           user_clicks<br><br>  + Create Feature Service<br>    name:           user_clicks_service<br><br> ↑↑↑↑↑↑↑↑↑↑↑↑ Plan End ↑↑↑↑↑↑↑↑↑↑↑↑<br> Generated plan ID is 047f7116739a4f2685bb466360ea4e40<br> View your plan in the Web UI: <br> https://xyz.tecton.ai/app/prod/plan-summary/047f7116739a4f2685bb466360ea4e40<br><br>$ tecton applyUsing workspace “prod” on cluster https://xyz.tecton.ai</pre><p>After deployment in the web UI, we can see the whole flow of data visualised.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kM2Uq2uAvL6m13GD" /></figure><p>Next we need to wait for the <a href="https://docs.tecton.ai/docs/materializing-features">materialisation</a> to complete, so we can retrieve them.</p><p>And now, we can retrieve our clicks count from our new feature service endpoint by providing a join key for the user.</p><pre>curl -X POST https://xyz.tecton.ai/api/v1/feature-service/get-features \<br>    -H &quot;Authorization: Tecton-key $TECTON_API_KEY&quot; -d\<br>&#39;{<br>  &quot;params&quot;: {<br>    &quot;feature_service_name&quot;: &quot;user_clicks_service&quot;,<br>    &quot;join_key_map&quot;: {<br>      &quot;USER_ID&quot;: &quot;7b521a14-e2a2-4cb3-a798-efe34e99077a&quot;<br>    },<br>    &quot;workspace_name&quot;: &quot;prod&quot;<br>  }<br>}&#39;</pre><p>Wondering how to get features for our model training? In our training notebook, we will use get historical features</p><pre>import tecton<br>from xgboost import XGBClassifier<br>from sklearn.model_selection import train_test_split<br>from sklearn.metrics import accuracy_score<br><br>workspace = tecton.get_workspace(&quot;prod&quot;)<br>service = workspace.get_feature_service(&quot;user_clicks_service&quot;)<br><br><br>records = [<br>    {<br>      &quot;USER_ID&quot;: test_user_id,<br>      &quot;TIMESTAMP&quot;: base_timestamp,<br>   }<br>]<br><br># Spine is on what we will join the features it shoud contain columns for timestamp and the join keys<br>spine = pd.DataFrame(records)<br>training_df = service.get_features_for_events(spine).to_pandas()<br><br># Now you can use dataframe as usual<br>X = dataset[:,0:1]<br>Y = dataset[:,1]<br>X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.3, random_state=32)<br>model = XGBClassifier()<br>model.fit(X_train, y_train)<br>y_pred = model.predict(X_test)from xgboost import XGBClassifier</pre><h3>Conclusion</h3><p>The implementation of a feature store using Tecton marks an important step forward for HomeToGo’s ranking system. This technology enhances our ability to integrate live data into machine learning models, which helps us improve the accuracy and timeliness of our recommendations. As we continue to develop this system, we expect to make notable progress in delivering more personalised, real-time results — thereby improving user engagement and satisfaction.</p><p>The integration of Tecton with our existing tools, like Snowplow and Snowflake, has allowed us to efficiently set up this feature platform without requiring extensive resources in terms of engineering hours. By leveraging these existing systems, we were able to quickly start developing and refining our machine learning models, allowing our Data Science and Engineering teams to focus on creating more innovative solutions for vacation rental recommendations.</p><p>Looking ahead, Tecton provides a great foundation for scaling and refining our services. As HomeToGo continues on our impressive growth journey, the ability to quickly integrate new features into our models will be crucial for staying competitive in a fast-changing market.</p><p>A big shoutout goes to Audrius Rudalevicius and Stephan Kaltenstadler for setting up the feature platform and for writing this article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c7ae60f063e" width="1" height="1" alt=""><hr><p><a href="https://engineering.hometogo.com/how-tectons-feature-platform-supercharged-hometogos-ranking-5c7ae60f063e">How Tecton’s Feature Platform Supercharged HomeToGo’s Ranking</a> was originally published in <a href="https://engineering.hometogo.com/">HomeToGo Data &amp; Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HomeToGo’s North Star Metric for our Data Domain]]></title>
            <link>https://engineering.hometogo.com/hometogos-north-star-metric-for-our-data-domain-7f0f5fb96e30?source=rss-59fd88a5b400------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f0f5fb96e30</guid>
            <category><![CDATA[superset]]></category>
            <category><![CDATA[dbt]]></category>
            <category><![CDATA[north-star-metric]]></category>
            <dc:creator><![CDATA[Stephan Claus]]></dc:creator>
            <pubDate>Tue, 17 Sep 2024 11:33:36 GMT</pubDate>
            <atom:updated>2024-09-17T12:00:41.713Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*jRnoDpSQWVLHr2d_v1wK3w.jpeg" /><figcaption>a purple north star that is related to data…and flowers…;)</figcaption></figure><h3>Introduction</h3><blockquote>“Look, if you had one shot or one opportunity<br>To seize everything you ever wanted in one moment metric<br>Would you capture it or just let it slip?”</blockquote><p>You know the author had a hard time coming up with a proper introduction when the article starts with an Eminem song text. Indeed, talking about <em>the</em> single metric for the broad space of data is a very hard thing to do — and still, here we are! In this article, I aim to walk you through our attempt to design a metric that:</p><ul><li>Indicates the overall health and productivity of the whole data domain at HomeToGo</li><li>Is easy to understand</li><li>And ultimately, is actionable</li></ul><p>So, let’s snap back to reality — here’s our approach to defining our North Star data metric.</p><h3>Why are you even trying?</h3><p>At HomeToGo, every larger business domain has its internal overarching metric that can help us move in the right direction in the long term and is independent from quarterly goals — you can call it a domain-specific North Star metric that comes with a respective driver tree and observability elements. While data itself is a core enabler for all of these businesses, we were asked to participate in this model. Sometimes, this opportunity comes once in a lifetime, so here we go — this is our shot.</p><h3>So, what’s the actual problem?</h3><h4>Domain diversity</h4><p>While it sounds simple to define a metric for the whole data function — which is kind of our everyday job — it gets complicated when you see the breadth of roles and functions you usually have in the data domain.</p><ul><li><strong>Data and Machine Learning Platform</strong> would naturally fall back to platform metrics like overall system uptime, incident response times, cost, technical debt, or customer satisfaction</li><li><strong>Analytical and Data Engineering</strong> will focus on metrics like pipeline reliability, technical debt, and time to insight provision</li><li><strong>Data Analytics and Data Science</strong> will emphasise insight accuracy, analytical coverage, and ultimately business impact and actionability</li></ul><p>If you try to put all of this together converging into one metric, the level of abstraction will be high, and you will likely end up with some vanity metric — something we need to avoid under all circumstances.</p><h4>Transaction cost overhead</h4><p>One solution businesses often propose (and there are endless articles about how you could try and why you would fail anyway): just map your efforts to revenue impact. While this is tempting, whenever it comes to monetary metrics, naturally there will be fights around the nitty-gritty details on how this should work (everyone who once implemented a more innovative marketing attribution model will nod in pain and silence). While we should never shy away from a proper discussion with our peers, we did not want to put this as the base for our metric — these discussion times are hard, and they’re getting even harder, so thank you, but no.</p><h4>How did you solve it?</h4><p>After walking through all these options, we decided to go back to the lab again and look for a metric that would rather describe the productivity and efficiency of the data function.</p><p>Piggybacking on the definition of a data product — and its holistic definition as outlined below — and evaluating our impact by usage and cost will equip us with the certainty of well-spent resources in enabling our business:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fddmaYmeJYmB7S9B" /></figure><p><em>(Source:</em><a href="https://www.dataception.com/Data-Product-Pyramid.html"><em> Data Product Pyramid</em></a><em>)</em></p><p>We came up with the following:</p><p><strong>Share of Used Data Products or Data Product Usage Rate</strong></p><p>The metric is very simple and intuitive to understand: what is the percentage of data products — be it a dashboard, table, or model — that gets used? The metric is easily expandable to make it more specific and time-bound, e.g. the share of data products used within the last 7 days. This metric is still very easy to grasp and leaves little room for different interpretations. It can easily be compared by time frames (7 days vs. 30 days), types of products (dashboards vs. tables) or domains (e.g., product vs. marketing).</p><p>Our initial goal for this metric was to achieve a 95% usage rate by the end of 2024 and never drop below 90% across the year for a 30-day rolling window.</p><p>We are now able to find a home for all our roles, functions, and domains in the analytical lifecycle:</p><ul><li><strong>The Data and ML Platform Team</strong> provides foundational <strong>data services</strong> to enable the domain teams to most effectively get their work done. At the moment, we have around 30 of these core services and capabilities (and we will provide a follow-up to our initial Data Tech Stack article soon [1])</li><li><strong>Analytical Engineers</strong> can manage their pipelines and dbt models (and as the end result, a table with data) as <strong>information products</strong></li><li><strong>Analysts</strong> can apply this to a) dashboard assets and b) analytical components like testing frameworks (e.g., A/B testing, geo split methodologies) or revenue attributions.They focus on creating <strong>contextual knowledge products</strong></li><li><strong>Data Scientists</strong> build <strong>predictive</strong> and <strong>prescriptive products</strong> in the form of models</li></ul><p>This together makes the metric very actionable, as specific (SMART [2]) goals can be specified across functions and actions can be executed the moment a product negatively influences the metric (e.g., remove the dashboard or dbt model if it’s no longer in use). This not only leads to less clutter which focuses attention on products that have proven to provide value, it also lowers cost as these can be directly associated to specific data products.</p><h3>Disclaimers</h3><p>First and foremost, there are valid points of critique with this metric:</p><ul><li>While the metric enables us to specify SMART goals, especially concerning achievability, its success ultimately depends on our customers using the data products we build. However, having this metric equips us with data to initiate discussions and understand why certain products are not in use. This enables us to take action, such as improving the product or reducing data debt by decommissioning unused assets</li><li>The metric doesn’t directly tell us whether we are focusing our efforts on the highest business value items, which is a fair concern. Nevertheless, this risk is mitigated because we operate under the assumption that:</li><li>We have a company-wide understanding of value derived from the company’s strategy, which is reflected in our quarterly planning and a NOW, NEXT, LATER framework</li><li>The straightforward logic: if it is used, it is valuable</li></ul><p>Success is our only option — failure’s not — so we assume that if it’s used, it’s valuable for decision-making. In the end, data supports business functions and aids in making decisions. For many advanced use cases, measuring the impact of decisions is challenging, so the strongest indicator we have is that people use our tools because they help them make data-informed decisions — which is the essence of our value proposition.</p><h3>How do you implement this?</h3><p>Okay, sounds good so far, but let’s be honest: the challenge is not in the definition itself but rather in implementing the tracking to allow for easy slicing and dicing, automated reporting, and monitoring.</p><p>Some input will still be manual, e.g., the Data and ML Platform Services, similar to the analytical components or the Data Science models, but some of them can and should be derived from metadata like dbt artifacts or Superset assets in an automated way.</p><p>Luckily, our dbt governance was quite strong already (as we connect every model run with the Snowflake internal metadata tables). What we built on top in Q1 2024 was the same ability for our Superset environment. If you are curious about how we approached this, give the great article [3] from Boris, Analytical Engineer at HomeToGo, a read.</p><h3>What about results?</h3><p>When we launched the MVP of this in Q1 2024, we first wanted to see where we were without any optimisation effort — and we had this distribution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/0*Z2h3vZHM1Qluxd2F" /></figure><p>This was already decent, as the main driver for low utilisation was, as expected, Superset, where we allow our users full freedom of self-service (which usually ends up in messiness). (Yes, dashboards are dead, but still pretty useful every now and then…)</p><p>After we rolled out our governance, we quickly hit our internal SLA of 95% utilisation rate in the last 30 days within one month. Since then, we keep an eye on the metric stability in our day-to-day.</p><p>On top of that, we gain useful insights and clean-up suggestions:</p><ul><li><strong>Let’s talk:</strong> If we see that a recently added data product is not used by our stakeholders, we have a perfect opportunity to discuss why and what we need to change to make it more insightful</li><li>The metric and the ability to break it down to an individual data product allow us to keep our turf nice and tidy:</li><li>Keep costs at a minimum, not only for the creation cost but also for maintenance</li><li>Makes assets more easily discoverable</li></ul><h3>And what’s next?</h3><p>There are many ways you can extend this idea further by exploring these directions:</p><h3>Getting more granular</h3><p>Why only go to dashboards and not to charts, you might ask? Or why did we exclude dbt tests — aren’t they a data asset as well? Could we add more sub-elements for an asset (e.g., only give the dbt model a count if all columns are documented)? Or why did we decide on 30 days and not shorter time frames? What can you see when you compare 30 vs. 14 vs. 7 days?</p><p>Feel free to explore — this metric allows for it. We decided against increased granularity for the first version as it would most likely only inflate the data asset base and not necessarily add more actionability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MnK7i5Y6pztUHApL" /></figure><h3>Getting more serious — COGS anyone?</h3><p>While dbt, Superset, and Data Platform data products are more easily connected to running costs, usually you do not have an automated way to add in the initial creation costs from your human resource efforts. However, with some proper labeling and automated exports in your ticketing system, you can weave this information into the equation.</p><h3>Extending automated governance</h3><p>A tempting (but to be handled with caution) direction is to automate certain actions once we identify missing utilisation:</p><ul><li><strong>Hard governance style:</strong> Nobody used the Superset dashboard for more than 60 days? Great, let’s archive it automatically using the Superset API, inform the dashboard owner on Slack, and see who raises concerns afterward.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d3cFOb1fnLYknhD9" /></figure><ul><li><strong>Soft governance style:</strong> The dbt model was not accessed in the last 30 days, either from user or service accounts? Inform the team on Slack (using Superset 😎) and let them first reduce the scheduling frequency and ultimately archive the model.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IkSNAlgr_T787LFO" /></figure><h3>Adding weights and attributions</h3><p>Naturally, some data assets are more important than others; for example, a Data Science capability usually involves more work and provides more potential downstream applications than, let’s say, a single dashboard. On top of that, some assets have a larger downstream impact than others — e.g., our session table is used in more than 50 dashboards, so it should be reflected somehow (proper lineage as a prerequisite, of course).</p><p>While this sounds tempting and “fairer,” it comes with the natural price of transaction costs in aligning the weights across the different domains, and it would negatively impact the simplicity and intuitiveness of the metric itself.</p><p>As always, we’ll walk this road together, through the storm, whatever weather, cold or warm. So a big thank you goes out to all our data team members for their efforts to keep us lean and focused on providing an environment for data-informed decision-making.</p><p>Way to go, high five everyone.</p><h3>Literature references</h3><ol><li><a href="https://engineering.hometogo.com/the-evolution-of-our-data-tech-stack-59ce757f5060">The Evolution of Our Data Tech Stack</a></li><li><a href="https://en.wikipedia.org/wiki/SMART_criteria">SMART Criteria</a></li><li><a href="https://engineering.hometogo.com/how-hometogo-improved-our-superset-monitoring-framework-60eb98e1a650">How HomeToGo improved our Superset Monitoring Framework</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f0f5fb96e30" width="1" height="1" alt=""><hr><p><a href="https://engineering.hometogo.com/hometogos-north-star-metric-for-our-data-domain-7f0f5fb96e30">HomeToGo’s North Star Metric for our Data Domain</a> was originally published in <a href="https://engineering.hometogo.com/">HomeToGo Data &amp; Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monitor Superset usage via Superset]]></title>
            <link>https://engineering.hometogo.com/monitor-superset-usage-via-superset-c7f9fba79525?source=rss-59fd88a5b400------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7f9fba79525</guid>
            <category><![CDATA[superset-tutorials]]></category>
            <category><![CDATA[apache-superset]]></category>
            <category><![CDATA[dashboard]]></category>
            <dc:creator><![CDATA[Stephan Claus]]></dc:creator>
            <pubDate>Mon, 21 Feb 2022 10:26:57 GMT</pubDate>
            <atom:updated>2022-02-21T10:26:57.855Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>This article walks you through a potential approach to monitor your Superset usage directly within Superset leveraging the internal metadata database.</p><p>At HomeToGo, we are always looking for opportunities to further streamline our Data Tech Stack. Naturally, one of the most important components is the reporting environment that allows our teams to easily explore, interact and create insights of our data. Historically, we were using multiple tools for this purpose, namely Tableau, redash and QlikView which:</p><ul><li>have different usage workflows and pre-requirements, i.e. for redash, one needs to be able to write SQL to produce the initial data to explore as for Tableau, the workflow is more user-friendly for non-technical users. However, it is not as easily maintainable with a programmatic approach on a more flexible and granular level</li><li>cause an overhead to manage and keep the environments aligned</li></ul><p>Over the summer of 2021, we looked at different solutions to unify these environments and ended up running a Proof of Concept with Apache Superset. We ultimately decided to use it as our main reporting tool.</p><p>If you monitor the reporting space closely, you have probably already heard of <a href="https://superset.apache.org/">Apache Superset</a>. If you haven’t, we highly recommend checking out the <a href="https://preset.io/blog/">preset.io blog</a> to see how it <a href="https://preset.io/blog/2021-visual-recap-superset/">matured in 2021</a>. While there is still areas for improvement the below Superset advantages stood out for us:</p><ul><li>The data exploring process is more visual for non-technical users but also provides capability for custom SQL (via SQLLab)</li><li>All business logic is available in SQL</li><li><a href="https://superset.apache.org/docs/rest-api">API first approach</a> to manage most object types (datasets, metrics, access, etc.)</li><li>A <a href="https://en.wikipedia.org/wiki/Role-based_access_control">RBAC model</a> for granular data access</li><li>Open source license with active community and experience in building strong OSS</li><li>Advanced chart types with option to easily contribute with own developed charts</li><li>Advanced chart functionality, e.g. time sliders, date grain selector out of the box YoY calculations</li><li>python post processing like facebook prophet forecasting, advanced filters and jinja templating functionality</li></ul><p>Two weeks ago, we made our Superset environment (self hosted) public to our stakeholders and started our migration from redash.</p><p>To closely monitor our user adoption rate and general usage patterns of Superset, we made this a project for our monthly hackathon events and looked into Supersets’ internal PostGreSQL metadata database.</p><p>Keep reading for our step by step approach and what we’ve learned so far. On top, we released all the bits and bytes you need to replicate the results of this article here:</p><p><a href="https://github.com/hometogo/hometogo-data-code-snippets">https://github.com/hometogo/hometogo-data-code-snippets</a></p><h3>Step 1 — Connect to the PostGreSQL metadata base</h3><p>For the sake of the hackathon, we went with a simple approach by connecting the Superset metadata base directly to Superset — reporting in real time has never been easier. 🙂 And of course, *insert your favorite inception joke here*.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4bM6tWkzsCngzns-" /><figcaption>waiting for it</figcaption></figure><p>Fun aside, there are other ways to integrate the metadata into Superset, especially if you want to:</p><ul><li>Avoid exposing the production database to Superset directly</li><li>Connect it to other data sources (i.e. the query performance statistics that is provided by your DWH)</li><li>Start parsing out information from the json fields in the different tables</li></ul><p>A more reliable solution could incorporate the following steps:</p><ol><li>Import the content of the metadata database via <a href="https://airbyte.com/">airbyte</a> into your data warehouse</li><li>Create your <a href="https://www.getdbt.com/">dbt</a> model(s)</li><li>Add the datasets via your usual data warehouse connection</li></ol><h3>Step 2 — Explore the data model</h3><p>Once connected, you are welcomed by 55 tables that are (more or less) used by Superset internally. As there is not much documentation around this topic (yet), we started to explore and “reverse engineer” our way into a better understanding by drawing an <a href="https://github.com/hometogo/hometogo-data-code-snippets/blob/main/superset/usage_dashboard/superset_1.3.1_metadata_database_uml.pdf">UML diagram first</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Gih07TQPWtfeZ3LOdGDHw.png" /></figure><p>From there it was quite easy to derive the tables that are of interest for our use case, namely:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LJfXxpQGhG0jmHr-TO35TQ.png" /></figure><p>As you can see, we created two custom datasets on top that are:</p><ol><li>Connecting master data from dashboards, charts, etc. to the log data itself</li><li>Aggregating different master data into one view</li></ol><p>For reference, you can find the SQL code for the virtualized data sets at the bottom of this article or <a href="https://github.com/hometogo/hometogo-data-code-snippets">in this repository</a>.</p><h3>Step 3 — Know what you want to accomplish</h3><p>After gaining a good understanding of the base tables, we developed the areas where we wanted to derive insights. For the scope of the hackathon, we therefore focused on the following questions:</p><h4>User Adoption Rate</h4><p>We treat our internal stakeholders as customers — we are always interested in master data (e.g. how many registered users do we have) but are more focused on:</p><ul><li>How many <em>active</em> users we have</li><li>Which dashboards/datasets <em>are used the most</em></li></ul><p>To surface these findings, we had to connect the master data to the log table, which we accomplished with a virtualized dataset. The reasons for this are manyfold — just envision a view of dashboards/datasets which are _not_ used at all and could provide valuable feedback for the data owners.</p><h4>Chart Types</h4><p>Knowing which chart types are used the most provides insights into:</p><ul><li>If we need special testing before updating Superset in case the chart type was changed</li><li>Encouraging users to use certain chart types for feature parity (e.g. use the echarts time series line chart instead of the simple line chart)</li></ul><h4>Entity Naming Conventions</h4><p>Unfortunately, Superset does not support proper tagging of elements like datasets, charts or dashboards. In our opinion, this causes struggles in navigating the content when &gt; 50 users are producing content. To avoid this, we ask our users to follow a very simple naming convention that makes their content easily searchable and allows us to parse tags going forward:</p><p>[tag1_tag2_…_tagn].[element name]</p><p>Where the tag section would follow the snake_case guidelines. Examples are marketing_sem.Performance Dashboard or monitoring.Superset Dashboard</p><p>As <a href="https://martinfowler.com/bliki/TwoHardThings.html">naming things is hard</a>, we wanted to build a simple monitor showing us the naming convention adoption rate. We are now able to give a friendly ping to users whom we don’t see following the naming convention. 😉</p><h4>Development of Virtualized Datasets</h4><p>Virtualized datasets are a great way to allow customers to connect different data sources and build customisations. However, we want to be mindful about what are valid use cases as extensive use could potentially clutter our provided datasets that are coming out of dbt.</p><p>Valid use cases for virtualized datasets would include joins, unions and more complex logics with window functions that are not available via Charts directly.</p><p>Use cases we want to learn from are when people only use one data set with additional case when or renaming columns. This feedback loop will allow us to improve our dbt data models directly and keep our environments tidy.</p><h3>Step 4 — Build the Dashboard</h3><p>Now on to the fun part! Once the datasets were ready for action, we jumped directly into creating charts and gathering them into a dashboard with minimal filter settings (only for Time Range, Time Grain, Dashboard Status). If you want to follow our approach, you can download our exported dashboard soon here. (Link updated in CW 8), otherwise you can find some impression examples below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ac7VB1BexCZx7rVHnyIEQ.png" /><figcaption>User development and user activity</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1i-0SE79tgRSdZXbc6lwHg.png" /><figcaption>Datasets development and showing users with the most virtualized datasets</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tMsK7tLTwh-aIlSRYPefSQ.png" /><figcaption>Chart development and most prominent selection (using a treemap to make it look fancy ;))</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7dkfFA-9263XPfA0OH7aWg.png" /><figcaption>Our internal naming conventions check — the gauge chart is a great way to incentivize</figcaption></figure><h3>What is next</h3><p>While we are already pleased with the insights we derived by the first iteration of the dashboard, there are a couple of topics we want to continue working on:</p><h4>Further Classification of activity</h4><p>There is definitely room for improvement in classifying the events that are logged in the action column to get the most of the logs table. At the moment, there are 104 different actions defined in our db including things like:</p><ul><li>welcome (logged when a user sees the front page)</li><li>annotation* (if users are working with annotation layers)</li><li>several get/list API calls</li><li>Internal actions like explore_json</li></ul><p>There are also several other actions you may not want to count overall (as they are happening indirectly in the background) compared to things like creation/changing/viewing of superset elements such as</p><ul><li>queries (if a query was executed from SQLLab)</li><li>ChartRestApi.data (if data was loaded by a chart component)</li><li>count (if a dashboard got viewed)</li></ul><p>We assume that parsing the json entries for action =&#39;log’ will provide you with even more granular information for further action classification.</p><h4>Add Performance Perspective</h4><p>As of now, we have not found a great way to create a performance view that includes query execution time as well as the impact of the internal Superset cache. While the first can be derived by parsing the Data Warehouse tables (e.g. on Snowflake via SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY) this does not include the cache perspective. We experimented with the column duration_ms of the log table but frankly we are not sure about the reliability.</p><p>If you have more detailed knowledge on the above topics, or simply want to join us on this effort to build the next iterations of this dashboard, please reach out directly in the Superset Slack Community.</p><p>A big thank you goes out to our Superset team <em>Agustin Figueroa</em> and <em>Donatas Jocas</em>, as well as <em>Ilayda Tangor</em> and <em>Sung Pham</em>, for working on this as their hackathon project. In case you are interested in other areas we are working on, you can find more data tech stack related articles in our <a href="https://engineering.hometogo.com/">Hometogo publication</a>.</p><h3>Appendix</h3><p>SQL code for monitoring.superset_action_log dataset:</p><pre><strong>select</strong><br>date_trunc(&#39;day&#39;, l.dttm) <strong>as</strong> action_date,<br><strong>case</strong> <br> <strong>when</strong> <strong>lower</strong>(l.<strong>action</strong>) = &#39;queries&#39; <strong>then</strong> &#39;query from sqllab&#39;<br> <strong>when</strong> <strong>lower</strong>(l.<strong>action</strong>) = &#39;chartrestapi.data&#39; <strong>then</strong> &#39;query from charts&#39;<br> <strong>when</strong> <strong>lower</strong>(l.<strong>action</strong>) = &#39;count&#39; <strong>then</strong> &#39;dashboard view&#39;<br> <strong>when</strong> <strong>lower</strong>(l.<strong>action</strong>) <strong>like</strong> &#39;annotation%&#39; <strong>then</strong> &#39;annotations&#39;<br> <strong>when</strong> <strong>lower</strong>(l.<strong>action</strong>) <strong>like</strong> &#39;css%&#39; <strong>then</strong> &#39;css&#39;<br> <strong>else</strong> <strong>lower</strong>(l.<strong>action</strong>)<br><strong>end</strong> <strong>as</strong> <strong>action</strong>,<br>l.user_id,<br>u.user_name,<br>u.created_on <strong>as</strong> user_registration_date,<br>l.dashboard_id,<br>d.dashboard_title,<br><strong>case</strong> <br> <strong>when</strong> d.published = <strong>true</strong> <strong>then</strong> &#39;published&#39;<br> <strong>else</strong> &#39;draft&#39;<br><strong>end</strong> <strong>as</strong> dashboard_status,<br>l.slice_id,<br>s.slice_name,<br>s.datasource_type,<br>s.datasource_name,<br>s.datasource_id,<br><strong>count</strong>(1) <strong>as</strong> action_count<br><strong>from</strong> <strong>logs</strong> <strong>as</strong> l<br><strong>left</strong> <strong>join</strong> ab_user <strong>as</strong> u <strong>on</strong> u.id = l.user_id<br><strong>left</strong> <strong>join</strong> dashboards <strong>as</strong> d <strong>on</strong> d.id = l.dashboard_id<br><strong>left</strong> <strong>join</strong> slices <strong>as</strong> s <strong>on</strong> s.id = l.slice_id<br><strong>where</strong> 1=1<br><strong>and</strong> l.<strong>action</strong> != &#39;log&#39;<br><strong>group</strong> <strong>by</strong> 1,2,3,4,5,6,7,8,9,10,11,12,13</pre><p>SQL code for monitoring.superset_naming_conventions dataset:</p><pre>with cte_names as (<br> <strong>select</strong><br> table_name <strong>as</strong> <strong>name</strong>,<br> &#39;virtualized dataset&#39; <strong>as</strong> <strong>source</strong>,<br> &#39;published&#39; <strong>as</strong> <strong>status</strong>,<br> created_by_fk <strong>as</strong> created_by_user_id<br> <strong>from</strong> <strong>tables</strong><br> <strong>where</strong> 1=1<br> <strong>and</strong> is_sqllab_view = <strong>true</strong><br> <br> <strong>union</strong> <br> <br> <strong>select</strong><br> dashboard_title <strong>as</strong> <strong>name</strong>,<br> &#39;dashboard&#39; <strong>as</strong> <strong>source</strong>,<br> <strong>case</strong> <br> <strong>when</strong> d.published = <strong>true</strong> <strong>then</strong> &#39;published&#39;<br> <strong>else</strong> &#39;draft&#39;<br> <strong>end</strong> <strong>as</strong> <strong>status</strong>,<br> du.user_id <strong>as</strong> created_by_user_id<br> <strong>from</strong> dashboards <strong>as</strong> d<br> <strong>left</strong> <strong>join</strong> dashboard_user <strong>as</strong> du <strong>on</strong> d.id=du.dashboard_id <br> <br> <strong>union</strong><br> <br> <strong>select</strong><br> slice_name <strong>as</strong> <strong>name</strong>,<br> &#39;charts&#39; <strong>as</strong> <strong>source</strong>,<br> &#39;published&#39; <strong>as</strong> <strong>status</strong>,<br> su.user_id <strong>as</strong> created_by_user_id<br> <strong>from</strong> slices <strong>as</strong> s<br> <strong>left</strong> <strong>join</strong> slice_user <strong>as</strong> su <strong>on</strong> s.id=su.slice_id <br>),</pre><pre>cte_names_with_properties <strong>as</strong> (<br><strong>select</strong> <br><strong>name</strong>,<br><strong>source</strong>,<br>u.username <strong>as</strong> owner,<br><strong>status</strong>,<br><strong>case</strong> <br> <strong>when</strong> <strong>lower</strong>(split_part(<strong>name</strong>,&#39;.&#39;, 1)) = split_part(<strong>name</strong>,&#39;.&#39;, 1) <strong>then</strong> <strong>true</strong><br> <strong>else</strong> <strong>false</strong><br><strong>end</strong> <strong>as</strong> domain_is_lowercase,<br><strong>case</strong> <br> <strong>when</strong> <strong>lower</strong>(<strong>name</strong>) <strong>like</strong> &#39;%.%&#39; <strong>then</strong> <strong>true</strong><br> <strong>else</strong> <strong>false</strong><br><strong>end</strong> <strong>as</strong> has_dot,<br><strong>case</strong> <br> <strong>when</strong> <strong>lower</strong>(<strong>name</strong>) <strong>like</strong> &#39;archived%&#39; <strong>then</strong> <strong>true</strong><br> <strong>else</strong> <strong>false</strong><br><strong>end</strong> <strong>as</strong> is_archived,<br>split_part(<strong>name</strong>,’.’, 1) <strong>as</strong> domains,<br><strong>case</strong> <br> <strong>when</strong> <strong>lower</strong>(<strong>name</strong>) <strong>like</strong> &#39;%untitled%&#39; <strong>then</strong> <strong>true</strong><br> <strong>when</strong> <strong>lower</strong>(<strong>name</strong>) ~ &#39;\d{2}\/\d{2}\/\d{4}&#39; <strong>then</strong> <strong>true</strong><br> <strong>else</strong> <strong>false</strong><br><strong>end</strong> <strong>as</strong> has_bad_phrases<br><strong>from</strong> cte_names <strong>as</strong> tmp<br><strong>left</strong> <strong>join</strong> ab_user <strong>as</strong> u <strong>on</strong> tmp.created_by_user_id = u.id<br>)</pre><pre><strong>select</strong> <br>*,<br><strong>case</strong> <br> <strong>when</strong> domain_is_lowercase <strong>is</strong> <strong>true <br> and</strong> has_dot <strong>is</strong> <strong>true <br> and</strong> has_bad_phrases <strong>is</strong> <strong>false <br> and</strong> is_archived <strong>is</strong> <strong>false<br> then</strong> <strong>true</strong><br> <strong>else</strong> <strong>false</strong><br><strong>end</strong> <strong>as</strong> is_valid<br><strong>from</strong> cte_names_with_properties</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7f9fba79525" width="1" height="1" alt=""><hr><p><a href="https://engineering.hometogo.com/monitor-superset-usage-via-superset-c7f9fba79525">Monitor Superset usage via Superset</a> was originally published in <a href="https://engineering.hometogo.com/">HomeToGo Data &amp; Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monitoring Data Quality at HomeToGo]]></title>
            <link>https://engineering.hometogo.com/monitoring-data-quality-at-hometogo-8e57a8c5889?source=rss-59fd88a5b400------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e57a8c5889</guid>
            <category><![CDATA[data-monitoring]]></category>
            <category><![CDATA[data-quality]]></category>
            <category><![CDATA[data-quality-tool]]></category>
            <dc:creator><![CDATA[Stephan Claus]]></dc:creator>
            <pubDate>Tue, 16 Nov 2021 21:36:46 GMT</pubDate>
            <atom:updated>2021-11-16T21:36:46.601Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>“You can have all of the fancy tools, but if [your] data quality is not good, you’re nowhere.” </strong>Veda Bawo, Director of Data Governance, Raymond James</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s8k69bw9axEAX3MW8vhJ_A.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@herosordinaires?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Regis F</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>HomeToGo is a marketplace with the world’s largest selection of vacation rentals, listing millions of offers from thousands of trusted partners.We collect a tremendous amount of data and use it to ensure our guests have great experiences, our partners are successful and our platform operates smoothly. Ensuring the highest quality data is paramount to our success.</p><p>This article will share how we implemented Data Quality Monitoring as a critical component in our <a href="https://engineering.hometogo.com/the-evolution-of-our-data-tech-stack-59ce757f5060">Data Tech Stack</a>.</p><h3>Table of Contents</h3><p>1) Why data quality is critical<br>2) The data quality architecture of HomeToGo<br>3) Our vendor selection process<br>4) Why we chose Anomalo<br>5) Quick data quality successes<br>6) What is next<br>7) Further reading recommendations</p><h3>Why data quality is critical</h3><p>The modern Data Stack enables companies to manage data on massive scales. At the same time, data meshes(1) decentralise data ownership and allow stakeholders to include data into their processes and decision-making right from the start. The combination of these two trends makes maintaining high-quality data essential for data teams.</p><p>At HomeToGo, establishing trust in our data is one of our core priorities. Whether sitting in business or tech teams, our data consumers want to work with our data without being concerned about its quality. When they have confidence in the data, their decision-making and product development cycles become faster and more effective.</p><p>Trust in data is easily lost but is very hard to regain. Establishing data quality measures should not be a stop-and-go effort but needs to be deeply baked into the day-to-day work of our data teams. Data quality has a high impact on our business initiatives overall success, so while there are several reasons people deflect inconvenient data(2), data trust should not be one of them.</p><p>Historically, setting up data tests and data monitoring have been (very) tedious processes. Most data quality frameworks use rule-based static data tests that require manual implementation and frequent maintenance. This burden adds significant overhead to the teams responsible for data observability and causes additional ad hoc work and ultimately frustration. No one likes to be accountable for sustaining a defragmented and static component in a dynamic context.</p><p>Fortunately, the data community has identified this gap, and we see multiple efforts to address these challenges. There are open-source frameworks like <a href="https://greatexpectations.io/">great_expectations</a>, <a href="https://github.com/awslabs/deequ">AWS DeeQu</a>, or <a href="https://griffin.apache.org/">Apache griffin</a>. There is also an increasing number of data quality vendors providing dynamic data quality monitoring as a service and the community is evolving its thinking on topics ranging from the concept of data observability(3), useful metrics to measure(4) efforts, the idea of data downtime(5) and the overall costs associated with poor data quality(6).</p><h3>The data quality architecture of HomeToGo</h3><p>Back in spring 2021, motivated by an insightful article series(7) from AirBnB on the topic, our data engineers and analysts sat down and created a vision on how we would like to see our data quality and monitoring efforts come together.</p><p>Our core objectives were to:</p><ol><li>Implement automated <a href="https://blog.anomalo.com/dynamic-data-testing-f831435dba90">dynamic data tests</a> as much as possible, leveraging time series and machine learning techniques with user feedback loops to optimise the signal-to-noise ratio.</li><li>Share ownership of setup and maintenance of data monitoring within the organisation (engineering + business) as a self-service — little to no coding experience should be required to work with the service.</li><li>Set up alerts in a centralised way where all stakeholders can troubleshoot and resolve them via dedicated slack channels.</li></ol><p>Keeping these considerations in mind, we came up with the following framework:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3NdXNFlKK93CqLKveR3RbQ.png" /></figure><h4>Data Accuracy</h4><p><em>Breaking pipeline changes.</em></p><p>The core contributors to data accuracy are data and analytics engineers. Therefore we can rely on code-heavy tools here. We use a dbt package called <a href="https://github.com/calogica/dbt-expectations">dbt_expectations</a> as these alerts should not contain any false positives. We are very restrictive — whenever one of these checks fails, we force our pipelines to break(8). This means that the engineers who maintain the pipelines must act on these alerts, and this dependency forces us to think carefully about which kind of alerts should break a pipeline.</p><h4>Data Observability</h4><p><em>Timeliness, freshness, and completeness of data.</em></p><p>For data observability, in addition to the data team, we also wanted to allow configuration by a broader user group of engineers and data analysts. We do not stop our pipelines for these issues, but instead, we flag the anomalies, investigate their cause, and kick off our pipelines again after it is resolved. Because our team reviews the alerts, the setup of these alerts can be more automated as some false positives are acceptable.</p><h4>Data Monitoring</h4><p><em>Metric and table anomalies.</em></p><p>Our data monitors should allow everyone to configure their checks focusing on data drift and metric anomalies regardless of the domain. Given that the data is accurate and complete, we want to enable anyone to monitor their metrics of interest. There shouldn’t be a blocker on someone from the data team to set up an alert. People from the business have the most context about what matters here. Again, we would not stop pipelines but investigate the root cause first before taking further action.</p><h4>Data Alerting</h4><p><em>Central unification of results.</em></p><p>All tests and their results are brought together in one metadata schema. On top of this schema, we can build generic dashboards showing what kind of tests we run on specific models from different tools. Our reports provide an end-to-end perspective on our data quality efforts to set proper SLAs and share status reports with our stakeholders.</p><h3>Our vendor selection process</h3><p>Once we outlined our expectations in the framework above, we started researching the market of vendors who could help us achieve our vision and conducted demo sessions with ten vendors.</p><p>To make this process as efficient as possible (we called it data quality speed dating), we sent each vendor an extensive pre-read about our current Data Tech Stack.</p><p>After each vendor demo, we prepared an internal scorecard covering topics like:</p><ul><li>Level of maturity of automatisation support (API or SDK, integration in existing tech stack like dbt/airflow/slack/etc., access to logging data)</li><li>Flexibility and comprehensiveness of configuration</li><li>Ease of use for non-technical users</li><li>Level of maturity for dynamic data tests</li><li>Scalability for large data sources</li><li>Support for batch/stream data sources</li><li>Pricing model</li></ul><p>While we were impressed by all the vendors and their approaches to tackling the data observability challenge, we ultimately decided to run our Proof of Concept with <a href="https://www.anomalo.com/">Anomalo</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OvGfU_diCo0lwz-OSMvTlA.png" /></figure><h3>Why we chose Anomalo</h3><p>While Anomalo is a relatively new startup, we were delighted with the functionality they provided and their approach to monitoring matched our essential requirements.</p><p>In particular, we liked that Anomalo is:</p><ol><li><strong>Secure <br></strong>It can be deployed fully in our on-premise infrastructure, which is great considering the data governance (e.g., GDPR, CCPA) perspective — none of your data will leave our Virtual Private Cloud.</li><li><strong>Easy</strong> <br>The set up of data observability checks in Anomalo is an easy one-click experience for each table. In addition, their very well-designed slack integration allows us to define notification channels on a per-table level as well.</li><li><strong>Comprehensive<br></strong>Their UI provides an extensive range of rule, time series, and ML-based data checks. Automated machine learning anomaly detection runs on every table, allowing for cross column checks of data distributions and the quick identification of underlying drivers (Anomalo calls this <a href="https://blog.anomalo.com/root-causing-data-failures-4ac0095b9456">root cause analysis</a>), and thus ultimately reducing MTTR(9).</li><li><strong>Programmable<br></strong>Their API first mentality and pip installable Python SDK enables a programmatic approach to configuring your monitoring and alerts.</li><li><strong>Self-Service</strong><br>Anomalo allows data and business users to use their no-code editor to set up their alerts (self-service approach). The Anomalo pricing model also scales with the number of tables monitored (with an unlimited amount of alerts) rather than with the number of users or alerts itself.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VKUmkrZw2O2VYsEnHHTBLw.png" /><figcaption><em>A typical Anomalo Data Quality dashboard on table level provides a quick summary of the overall health of the table.</em></figcaption></figure><p>Anomalo recommended a trial duration of two months, and they did not restrict our usage to a limited number of tables. This setup provided us with sufficient time to test the service at its core.</p><p>After signing the obligatory NDA and Master Service Agreement, the deployment on an EC2 instance was straightforward — constant support was provided by documented step-by-step guidelines, a shared slack channel, a dedicated customer success engineer and regular weekly office hours.</p><p>Overall the end-to-end process took us only <em>two weeks</em> to be ready for the trial.</p><p>We then started our PoC with the following setup:</p><ol><li>Set up slack alert channels for each data domain in our business (e.g., growth, operations, finance, etc.)</li><li>Provide training to a core group of data engineers, scientists, analysts, and data-heavy business stakeholders.</li><li>Asked our users to set up their alerts on their table of interests and check the dedicated slack channel daily and troubleshoot any alert</li><li>Revisit the alert set up in the first weeks if the signal to noise ratio seemed too low</li></ol><h3>Quick data quality successes</h3><p>Overall, the feedback from our test group was very positive. Users especially mentioned Anomalo’s root cause functionality, which dramatically cut down on investigation time.</p><p>The interaction between engineers, analysts and business teams democratised access to these alerts and improved communication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*isI8nbfOvKfVzKN8WQiG1Q.png" /><figcaption>Detailed information about a specific alert and its history</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*O3ityqFaP7e-R4Cv4eN7yw.png" /><figcaption><em>The root cause analysis functionality provides more details around the alert for faster troubleshooting.</em></figcaption></figure><p><strong>Examples where Anomalo added immediate value:</strong></p><p>We immediately get notified when data arrives late, thus keeping us honest on our agreed data SLAs. The shared alerting in Slack makes it easier to communicate across the organisation and update stakeholders about issue resolution. We encountered these situations twice as some clickstream data became stuck in our Snowplow collector and we missed loading data when switching between time zones (summer vs. winter time)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LupeJJUmcDawk1A4mEVw5w.png" /><figcaption>Slack alert on missing data load</figcaption></figure><p>We received a couple of alerts one day that showed data all moving in the same direction.</p><ol><li>We saw a spike increase in our direct traffic</li><li>We saw decreasing values on our engagement metrics on the site</li><li>We saw high counts of new user agents</li></ol><p>These alerts gave us enough clues to check for unexpected bot traffic, which turned out to be the case. The overall investigation took us around half an hour, and we updated our bot filters and reran our pipelines.</p><p>Our finance team is always interested in unusually high booking values. A simple misbooking of a customer can cause these, or they could be due to misconfigurations on the commercial partner parameters. Identifying these is now as easy and convenient as possible — whenever we see overall booking transactions value exceeding a certain threshold, we receive a slack alert, and all associated teams are informed and can troubleshoot together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*rirqmaOpwYy9N_UGaUdmRw.png" /><figcaption>automatic monitoring of high booking values</figcaption></figure><h3>What is next</h3><p>While we are quite satisfied with the progress towards ensuring data trust in our key tables, there is always room for improvement. We hope on extending our capabilities in the following areas:</p><ol><li>Support and integration for <a href="https://www.avaitla16.com/column-level-lineage-and-implementations">column level lineage</a> + the processing of DWH and Airflow logs for even more nuanced troubleshooting and issue resolution, i.e., in case multiple alerts are thrown based on one upstream issue</li><li>Use the Anomalo API to add alert and monitoring information and history to DataHub</li></ol><p>Thank you for reading! We would be happy to get your opinion — feedback in the comments section is very much appreciated.</p><p>Last but not least, this was a cross-team effort and a big shoutout goes to all who made these developments possible, especially <em>Mindaugas Nižauskas</em>, <em>Gijs de Kruif</em>, <em>Aurimas Griciūnas</em> and all the beta testers who provided feedback that shaped the direction of our Data Quality Service at HomeToGo.</p><h3>Further Reading Recommendations</h3><ol><li><a href="https://martinfowler.com/articles/data-monolith-to-mesh.html">https://martinfowler.com/articles/data-monolith-to-mesh.html</a></li><li><a href="https://www.holistics.io/blog/the-six-ways-people-deflect-inconvenient-data/">https://www.holistics.io/blog/the-six-ways-people-deflect-inconvenient-data/</a></li><li><a href="https://towardsdatascience.com/what-is-data-observability-40b337971e3e">https://towardsdatascience.com/what-is-data-observability-40b337971e3e</a></li><li><a href="https://towardsdatascience.com/how-to-measure-data-quality-815076010b37">https://towardsdatascience.com/how-to-measure-data-quality-815076010b37</a></li><li><a href="https://towardsdatascience.com/the-rise-of-data-downtime-841650cedfd5">https://towardsdatascience.com/the-rise-of-data-downtime-841650cedfd5</a></li><li><a href="https://towardsdatascience.com/how-to-calculate-the-cost-of-data-downtime-c0a48733b6f0">https://towardsdatascience.com/how-to-calculate-the-cost-of-data-downtime-c0a48733b6f0</a></li><li><a href="https://medium.com/airbnb-engineering/data-quality-at-airbnb-e582465f3ef7">https://medium.com/airbnb-engineering/data-quality-at-airbnb-e582465f3ef7</a></li><li><a href="https://medium.com/wrong-ml/taming-data-quality-with-circuit-breakers-dbe550d3ca78">https://medium.com/wrong-ml/taming-data-quality-with-circuit-breakers-dbe550d3ca78</a></li><li><a href="https://www.atlassian.com/incident-management/kpis/common-metrics">https://www.atlassian.com/incident-management/kpis/common-metrics</a></li></ol><p>Are you interested in joining the HomeToGo Data Teams? Check out our open roles here: <a href="https://www.hometogo.com/careers/data-analytics/">https://www.hometogo.com/careers/data-analytics/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e57a8c5889" width="1" height="1" alt=""><hr><p><a href="https://engineering.hometogo.com/monitoring-data-quality-at-hometogo-8e57a8c5889">Monitoring Data Quality at HomeToGo</a> was originally published in <a href="https://engineering.hometogo.com/">HomeToGo Data &amp; Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The evolution of our Data Tech Stack]]></title>
            <link>https://engineering.hometogo.com/the-evolution-of-our-data-tech-stack-59ce757f5060?source=rss-59fd88a5b400------2</link>
            <guid isPermaLink="false">https://medium.com/p/59ce757f5060</guid>
            <category><![CDATA[change-management]]></category>
            <category><![CDATA[tech-stack]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Stephan Claus]]></dc:creator>
            <pubDate>Wed, 22 Sep 2021 13:31:50 GMT</pubDate>
            <atom:updated>2022-10-21T05:11:43.275Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Just another journey of how to evolve a Data Tech Stack when your company outgrows the startup stage and begins to focus on setting up scalable tooling, teams and processes.</blockquote><h3>Introduction</h3><p>Hello and welcome to the introduction article for our blog series on the evolution of our Data Tech Stack! We know that the modern Data Tech Stack is currently a hot topic and there are a huge number of articles (see <a href="https://blog.getdbt.com/future-of-the-modern-data-stack/">here</a>, <a href="https://blog.picnic.nl/picnics-lakeless-data-warehouse-8ec02801d50b">here</a> or <a href="https://www.datafold.com/blog/the-modern-data-stack-open-source-edition">here</a>) covering nearly every aspect of it — which is a great situation to be in when redesigning your own setup.</p><p>As we all know, one barely ever starts on an empty playground when moving to new architectural patterns, but has to evolve and change from an existing setup to the desired final state (if that even exists). As we are in the middle of a bigger redesign ourselves, we want to contribute to these discussions by focusing on how we manage the change around our components and frameworks.</p><p>We evaluate all our decisions by looking at the following concepts:</p><p><strong>Open Source:</strong> If possible, we prefer open source solutions over paid services — it allows us to join a larger development community, benefit from other companies solving similar problems, contribute back to the community and ultimately reduce vendor lock-in</p><p><strong>Modularity: </strong>While it was quite usual to look for the<em> Jack of all Trades</em> 10 years ago (think about Tableau) and still today (hey Looker), in our eyes a good Tech Stack should be as modular as possible — let’s pick the best tool for the job and keep the components as loosely coupled as possible. This is a clear pattern borrowed from engineering as you can see in the micro-service architecture patterns. More and more Open Source Frameworks are following them and provide an API-first approach that allows for programmatic change. This makes managing change so much easier.</p><p><strong>Self Service</strong>: Although there is no definition of self service that covers all the various domains in data, we aim to use tools that have a <em>low cognitive load footprint </em>that allow a larger stakeholder group to use our tooling without extensive specialisation on the topic itself. This creates unity around processes and workflows, as well as a reduced amount of touch points and handovers between teams for fast flow of work and development</p><p><strong>Support of development best practices</strong>: as research has shown, establishing an environment allowing for</p><ul><li>lean development principles,</li><li>test and deployment automation,</li><li>version control, continuous integration &amp; delivery and</li><li>ability to monitor key process metrics</li></ul><p>has a significant impact on team autonomy, doing less rework and contributing to overall organisational performance.</p><h3>Our current data tech stack</h3><p>Without further talk, lets jump directly to where the meat is — our current data tech stack in all its beauty:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4rLcyhVarFFis52nhnSR1Q.png" /></figure><p>We’ve cut out our tooling along the Data Supply Chain into three different domains a) ingest, b) process and c) serve. On the one end we have multiple sources from which we ingest data, both internal as external sources, streaming and batch, and various teams responsible for it all. In general we follow an ELT approach, contrary to an ETL one, which enables us to quickly adept to ever changing requirements on datasets we serve to our stakeholders.</p><p>Once loaded in our main Redshift (RS) cluster, Data Engineers together with Data Analysts, are responsible for all the transformations we run. Once transformed, the datasets which are exposed to visualisation tools like Tableau/Redash, are first moved to another RS cluster to improve query execution times. Additionally reduces the impact of analytical queries on our ELT processes.</p><p>We know that it’s tempting to go directly to the comments section to list out potential improvements — <em>but before you abuse, criticise and accuse, walk a mile in our shoes. </em>(<a href="https://www.youtube.com/watch?v=z-NgDbK9N6g">Elvis Presley, anyone</a>?)</p><p>Remember: this data tech stack is the product of the last six years of rapid development at HomeToGo, moving from a single data person to a small team and beyond, with focus on time to delivery for the largest business impact. In addition, don’t get caught up in your own hindsight bias — think about:</p><ul><li>the maturity of Apache Airflow in 2015,</li><li>the open (and partly still ongoing) discussion around Python and R or</li><li>that Tableau still had a buzz in the early days as it allowed business stakeholders to interact with data directly (as data amount was still small)</li><li>the challenge to balance keeping existing stakeholders happy with old solutions, while at the same moment finding the time to migrate to new scalable solutions.</li></ul><p>Parts of this setup served us very well historically as it provided a huge degree of flexibility and fast delivery, but with an increasing amount of team members, stakeholders, data volume and advanced requirements on our data products, now is the time to adapt our systems to allow for scale.</p><p>In the next articles you will see the components for which we identified room for improvement and how we tackled the transition from the status quo to our target picture.</p><h3>Update 2022</h3><p>Time is flying and we are happy to share the progress we made over the last year:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*r8fKiu2Cpk5MS5_Ewsx5cw.png" /></figure><p>Overall, we are very happy with the progress as</p><ul><li>we successfully migrated from Redshift to Snowflake</li><li>decommissioned DRUID, redash and the majority of Tableau workloads (only used for email reporting as superset is lacking a proper PDF feature yet)</li><li>removed all R workloads and updated our python loader framework</li><li>an extension for event based data sharing for our engineering teams via our BIEvents streaming solution and leveraging airbyte for small to medium sized data integrations</li></ul><h3>Continue reading</h3><p>Without further ado — lets jump into the more detailed articles posted on a weekly basis. We’re very eager to hear your thoughts, so please ask questions and post comments. Thanks for reading, and we appreciate your feedback!</p><p><strong>Coming soon:</strong></p><ol><li><a href="https://engineering.hometogo.com/apache-airflow-at-hometogo-8f97a12b2be5">Apache Airflow at HomeToGo</a></li><li><a href="https://engineering.hometogo.com/dbt-at-hometogo-ece067987267">dbt at HomeToGo</a></li><li><a href="https://engineering.hometogo.com/augmented-analytics-at-hometogo-29da983f09a8">Augmented analytics at HomeToGo</a></li><li><a href="https://engineering.hometogo.com/monitoring-data-quality-at-hometogo-8e57a8c5889">Data Quality Monitoring at HomeToGo</a></li><li><a href="https://engineering.hometogo.com/monitor-superset-usage-via-superset-c7f9fba79525">Superset Monitoring at HomeToGo</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59ce757f5060" width="1" height="1" alt=""><hr><p><a href="https://engineering.hometogo.com/the-evolution-of-our-data-tech-stack-59ce757f5060">The evolution of our Data Tech Stack</a> was originally published in <a href="https://engineering.hometogo.com/">HomeToGo Data &amp; Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>