<?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 Kseniia Tomak on Medium]]></title>
        <description><![CDATA[Stories by Kseniia Tomak on Medium]]></description>
        <link>https://medium.com/@tomak.kseniia?source=rss-fe684bdc9e61------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NqnvIKJosKPGVHPmhe-IqA.png</url>
            <title>Stories by Kseniia Tomak on Medium</title>
            <link>https://medium.com/@tomak.kseniia?source=rss-fe684bdc9e61------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 01:46:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tomak.kseniia/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[Performance tests for Data Lake query engine: Practical approach]]></title>
            <link>https://engineering.hellofresh.com/performance-tests-for-data-lake-query-engine-practical-approach-3c97f01bbab6?source=rss-fe684bdc9e61------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c97f01bbab6</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[hellotech]]></category>
            <category><![CDATA[hellofresh]]></category>
            <category><![CDATA[engine]]></category>
            <dc:creator><![CDATA[Kseniia Tomak]]></dc:creator>
            <pubDate>Thu, 20 Jul 2023 15:09:25 GMT</pubDate>
            <atom:updated>2023-07-20T15:40:50.759Z</atom:updated>
            <content:encoded><![CDATA[<h3>Preface</h3><p>In HelloFresh we have a Data Lake at the core of our Data Platform. To reduce time to insights we have to enable our users with querying this Data Lake directly without any serving pipelines.</p><p>At HelloFresh, we have been using Impala and a combination of other query engines for this kind of analytics. None of the solutions is capable enough to be used as a single query engine across the organization. So we’ve done the evaluation of several query engines to find the only one Query Engine for Data Lake — scalable, performant, and maintainable. That’s how this article appeared.</p><h3>We need a query engine. Ok, what’s next?</h3><p>I would like to believe that thoughts like “Query engine is simply something that reads files from the disk” were gone. But I know that they weren’t. Even now when clouds can suggest powerful PaaS and SaaS solutions for any need. And query engines have become more user-friendly, having more and more user-oriented features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uRBIommy09tWZbOht3gMzg.jpeg" /></figure><p>So when we need a query engine, what are we supposed to have? What requirements do we have? Forget about performance for a second. Let’s imagine.</p><p>From the end user’s perspective:</p><ul><li>Do we need a query history? Query plans displayed as graphs?</li><li>Do we need UDFs?</li><li>Which databases/data formats/meta stores do we need to support?</li></ul><p>From an infrastructure perspective:</p><ul><li>Is your data/infra team mature enough, and, most importantly, does it have the capacity to manage a query engine on its own, or do you need managed service?</li><li>Do we need terraform templates, or is the UI enough?</li><li>Do we have the ability to switch off instances on idle?</li><li>What is your team structure? Do you need powerful security settings? RBAC?</li><li>Do you want to separate instances between users?</li></ul><p>From a costs perspective:</p><ul><li>Costs model: per query, per data scans, etc.</li><li>Costs evaluation: how expensive the query engine is (just write if you want to see cost modeling parts in the future).</li><li>Don’t forget that we have both a query engine and operational costs. So how easy is it to migrate?</li></ul><p>It’s just a small piece of our company’s needs. You will have your own. Just write down all the points and prioritize them. You can see that some requirements can save your company even more time and money than performance, which can be 2x times better than other alternatives.</p><p>I wanted to focus your attention on the other sides of a query engine before we go for the performance. Yet, suddenly, performance is the subject of this article.</p><h3>How do we want to test performance?</h3><p>It depends on what you want. If you can rely on tests on synthetic data and synthetic queries, then you can go to <a href="https://www.vldb.org/conf/2007/papers/industrial/p1138-poess.pdf">TPC-DS</a> or <a href="https://www.tpc.org/tpch/">TPC-H</a> (or <a href="https://www.tpc.org/tpc_documents_current_versions/current_specifications5.asp">other TPC-*</a>). You can save a lot of time.</p><p>In our use case, we wanted to get a real performance picture with our real data and our real queries. Because sometimes it’s specific query patterns, and sometimes it’s specific data schema. Plus we needed more process controllability.<br>So we had our own data + our own performance test automation.</p><p>The performance testing consisted of 5 stages:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*32Y1LAD9TLudQfhn" /></figure><p>Let’s go through it.</p><h3>Choose the queries and underlying data</h3><p>The best thing you can have in this step is query history. At least for one week. And it’s also nice to have query history for special days, like the first day of the month (or any other day when you have a reporting spike).</p><p>In general, it means that you need to understand the usage pattern of the query engine:</p><ul><li>Min/max query running time and its distribution. I don’t like to use AVG here because you can have different query profiles, so you need to test performance on groups of these profiles.</li><li>Min/max count of parallel running queries and their distribution by the time of the day/day of the month — you will need them to test parallelism and autoscaling, and also for cost calculations.</li><li>Max/avg memory peaks — to find highload queries for future testing.</li><li>An overall number of users.</li><li>The type of loads: ad-hoc via UI (with a limited number of rows) or Tableau loadings (when you’re loading the whole table), or hard ETL jobs producing one row.</li><li>If you have the same query repetitions.</li></ul><p>You will need this information for the first time to understand what type of query engine is a better fit for you. It can also help with future performance results analysis and cost modeling.</p><p>What we’ve added for our tests:</p><ul><li>simple queries with dimension scans</li><li>filter dimension or fact by non-partition column</li><li>“group by” queries</li><li>queries with CTEs</li><li>joins: dimension-fact, fact-fact, joins with wrong order of tables</li><li>simple queries with partition column filter</li><li>partition group by queries</li><li>several memory-intensive queries (when someone reads all table data not using partition or it’s a quite complicated query with memory peaks &gt; total worker nods memory)</li><li>compute-intensive query</li><li>the query for the biggest partitioned table</li><li>several quite frequent query patterns on our previous query engine</li><li>also, we’ve tried to make small tests for different data formats</li></ul><p>We’ve collected ~22 queries from ourselves and ~15 from our users. We’ve asked them to share the worst query scenarios they want to test on the new engine. User queries also were very helpful.</p><h4>Notes about underlying data</h4><p>Data for tests should not change a lot. Ideally, it should stay the same because we can compare queries that run against the same data schema and the same volumes, otherwise, your experiments will be incomparable. Most likely, you will need several iterations with each query engine, and this point means that to compare iteration results, you need to have the same (or almost the same) underlying data.</p><p>So here we have several options:</p><ul><li>Copy all the data for tests to a different location to freeze it. It’s the best option, but sometimes it’s quite resource-consuming.</li><li>Run tests on all engines at the same time. It’s quite easy if you have an automation tool for testing. But if you do several iterations of tests, then results can vary between these iterations. But again, it depends on the data. We’re not testing operational workloads, and if your data doesn’t change schema and volume a lot from day to day, maybe it’s your scenario.</li><li>Do nothing and rely on the fact that your data changes are not so significant. But again, remember this point when you will compare the results.</li></ul><h4>Notes about reality</h4><ul><li>When you start testing and start sharing the results, there will also be a desire to improve them. Yes, there are many great settings like results caching, intermediate data caching, tuning broadcast limits, etc. But all these things are settings. To tune them is a really good idea. What if you want to go further?<br>You need to keep in mind the picture of the average user. If you understand that you can add hints to have 10x performance during the tests, but your users don’t even know what a hint is, you don’t have to do it. It won’t be a clear test.</li><li>If anyone suggests you use another data format or another data schema, you need to keep in mind what is the real-world scenario. If you’re at the start of building a Data Platform or totally renovating your Data Lake, then yes, it’s important to know how it is better to lay out data to get the most out of your new query engine. But if you have a mature Data Lake with ~1000 tables, then it’s a bad idea to do tests only on “well-prepared data” because, in real life, you don’t have such data.</li></ul><h3>Choose the query engines and their configurations</h3><p>I suppose that you already have candidates; at least you can write down all “must haves” for your query engine and filter these candidates a little bit. Here I want to focus mostly on cluster testing configurations.</p><p>All we know is that we should run performance tests for query engines in equal physical environments.</p><p>In an on-premise world, you always know all cluster’s underlying hardware characteristics. But what about the cloud world?</p><p>Of course, in most cases, you can go to cloud cluster configuration, and check master and workers for different query engine providers. But what if we have serverless candidates, and instead of cluster sizes, we have sizes like S, M, L, etc.?</p><p>Or if we want to check a SaaS query engine, where we don’t even have any cluster size because we have no dedicated cluster?</p><p>Then things that you DO can compare are costs and parallelism. Money becomes your hardware.</p><p>Here is an example of our configurations (all candidates are cloud-native):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9sSRGL_yOnj483obkhMAVg.jpeg" /></figure><p>And don’t forget to include your baseline — current query engine. Because if you want to change something, you have to know how it will affect the end-to-end user experience.</p><h3>Define methodology</h3><p>We’ve chosen data, and we’ve chosen configurations.</p><p>How do we want to make tests? Interface, algorithm, results schema.</p><p>Firstly, <strong>Interface</strong>. Do we want to run queries using Rest API? Do we want to write a small program to run queries using JDBC? Or maybe we want to run manually using querying UI tools?</p><p>I suppose it mostly depends on your core use cases. And also on chosen query engine’s interfaces.</p><p>We’ve chosen automation by running queries through JDBC connectors. Why? Because most of our users use the same connectors in other tools and IDE’s to query the data. Also, we wanted to automate tests. Because:</p><ul><li>We will definitely need multiple iterations between query engine configuration settings</li><li>We will have multiple query engines and ~40 queries</li><li>We want to run test iterations without humans: when you’re testing analytical queries it can take years time.</li><li>We wanted to collect not only time statistics (read the <em>Results schema</em><strong> </strong><em>section</em><strong> </strong>for other parameters we measure).</li></ul><p><strong>Algorithm. </strong>Here, again, we can suggest an algorithm based on our use case scenario.</p><p>In our use case, we have these incomes:</p><ul><li>We need to know how bad the performance will be after the engine restart because we planned to stop clusters after working hours.</li><li>We need to know how queries will work with parallel execution.</li><li>We need to know how queries will work when data is already in the cache (if the engine has one).</li></ul><p>Our test modes looked like this:</p><ul><li>Cold autotests mode: to show how QE will work after restart or without caching.<br>QE should be restarted before each query’s run to exclude any caching features.</li><li>Warm autotests mode: to show how QE will work with caching feature<br>Every testing QE should be already switched on and the query should run one time before final query measurements.</li><li>Parallel tests mode: We should run queries in multiple threads, continuously raising the query count between runs.</li><li>Manual tests: to know how user experience in UI will look from a performance perspective.<br>Tests should be run from the query engine native editor. The query engine should already be switched on. In the end, we’ve tested it also for several other widespread IDEs in our company, and yes, results can vary <strong>a lot</strong></li></ul><p>Also, we had the option to limit result sets to 1000 rows. Because our ad-hoc users mostly use DataGrip where paging is enabled by default. But of course, you need to check several queries with unlimited results set to cover all use cases. Just make sure that your test PC/server has enough memory to receive it.</p><p>So finally, we have the following test suite structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lUkX6R4u_arfHQjK" /></figure><p>Each query run should be done in 2+ iterations to measure the average because there is always room for spikes. But don’t forget about caching issues.</p><p><strong>Results schema</strong>. We need to decide what data we want to measure during each query run in each iteration for each mode.</p><p>Do you want to measure only query run time? But there are other metrics to track as well. Sometimes you need to track data IO because it reflects on costs also. Sometimes it’s a good idea to track memory and cache reads (not for costs but mostly for resolving issues).</p><p>We suggest that we should have several statistics fields:</p><ul><li>Query total time — end-to-end time, which your user will see. We included it in our list to measure the final user experience.</li><li>Query execution time — time spent executing the query (without waiting in the queue and sending results back to the client).</li><li>Scanned data. We included it in our list to measure the final user experience.</li><li>Memory [optional, if possible]</li><li>CPU [optional, if possible]. In most cases, it can be CPU time — the total time spent on all CPUs involved in the query.</li><li>Also, it’s a good idea to have a data dag field to put all stats object here. Because you will never know what you will need for understanding, so just keep this data to prevent additional test suit runs.</li></ul><p>But of course, the field “Error message” is also vital.</p><h3>Do testing</h3><p>As you might guess, running ~40 queries between different modes, and different engines is not so easy. So we decided to automate it.</p><p>We’ve written the Python program to do these tests. We’ve synced all results in CSV files, one file for each test iteration. And then you can open it and analyze it in Google Sheets.</p><p>I want to mention here a very obvious thing: Think about failure handling. When you wake up in the morning and understand that your suite failed on a second query because of a small network issue, you would not be happy. So just do logging and continue. Sometimes you can find very interesting errors that are also important to clarify future user experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xQLdXVqaZQV8Krwc" /></figure><h3>Average is not mean. Or results’ comparison</h3><blockquote>You might be right, you might be wrong, but you had to choose, knowing that the rightness or wrongness might never be clear or even that you were deciding between two sorts of wrong, that there was no right anywhere.</blockquote><blockquote>Terry Pratchett</blockquote><p>I think that this is the hardest part.</p><p>Firstly, because you will likely go crazy after several days of Google Sheets and numbers.</p><p>Secondly, it’s more about situation modeling and analytics.</p><p>Now you have a query’s performance results but how do you compare them?</p><p>This part certainly deserves a separate article, which I’m going to write. So let’s keep in touch.</p><h3>Some words in the end</h3><p>If you need more examples, more details about different requirements, more detailed results comparison or maybe you’re interested in the source code of the performance testing suite, please, write a comment or contact me directly through <a href="https://www.linkedin.com/in/ksenia-tomak/">LinkedIn</a>.</p><p>Or maybe you’re interested in our final choice. Then I will say that we’re already live and will share our real experience after users’ feedback.</p><h3>What to read for inspiration</h3><ul><li><a href="https://www.vldb.org/conf/2007/papers/industrial/p1138-poess.pdf">Why You Should Run TPC-DS: A Workload Analysis</a></li><li><a href="https://repository.tudelft.nl/islandora/object/uuid%3A62bee645-b8a0-40c6-be48-28ebbb541c42">Performance Evaluation of Distributed SQL Query Engines and Query Time Predictors</a> (Chapter 3)</li><li><a href="https://dl.acm.org/doi/10.1145/2668930.2688053">An Empirical Performance Evaluation of Distributed SQL Query Engines</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c97f01bbab6" width="1" height="1" alt=""><hr><p><a href="https://engineering.hellofresh.com/performance-tests-for-data-lake-query-engine-practical-approach-3c97f01bbab6">Performance tests for Data Lake query engine: Practical approach</a> was originally published in <a href="https://engineering.hellofresh.com/">HelloTech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>