<?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 Ferenc Bodon, PhD on Medium]]></title>
        <description><![CDATA[Stories by Ferenc Bodon, PhD on Medium]]></description>
        <link>https://medium.com/@bodonferenc?source=rss-6437b4668b35------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hWhL9sEMuEyZm136-1GIgQ.jpeg</url>
            <title>Stories by Ferenc Bodon, PhD on Medium</title>
            <link>https://medium.com/@bodonferenc?source=rss-6437b4668b35------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 00:23:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bodonferenc/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[Variadic functions in q]]></title>
            <link>https://medium.com/kx-systems/variadic-functions-in-q-7cc34b64e8a7?source=rss-6437b4668b35------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cc34b64e8a7</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[kdb-x]]></category>
            <category><![CDATA[kdb]]></category>
            <dc:creator><![CDATA[Ferenc Bodon, PhD]]></dc:creator>
            <pubDate>Fri, 15 May 2026 07:13:52 GMT</pubDate>
            <atom:updated>2026-05-15T07:13:52.640Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HTnZn9ePyQ6ZRfDrnmtygg.png" /></figure><p>Variadic functions — those that accept a variable number of arguments — are among the most underutilized features in q. This is largely due to sparse documentation and a historical lack of idiomatic examples.</p><p>However, when paired with kdb+ 4.1 features like <a href="https://code.kx.com/q/basics/pattern/#type-check">type checking</a> and <a href="https://code.kx.com/q/basics/pattern/#filter-function">filter functions</a>, variadic functions provide a robust, readable, and scalable approach to argument validation. This is particularly valuable when developing <a href="https://code.kx.com/kdb-x/modules/module-index.html">kdb-x modules</a>, where maintaining a clean and user-friendly API is paramount.</p><h3>The Variadic Pattern</h3><p>In q, <a href="https://code.kx.com/kdb-x/ref/enlist.html">enlist</a> is the only built-in function that natively accepts a variable number of arguments — and the only one that supports more than 8 parameters:</p><pre>q)enlist[1;2]<br>1 2<br>q)enlist[1;2;3;4;5;6;7;8;9;10]<br>1 2 3 4 5 6 7 8 9 10</pre><p>To create custom variadic behavior, we leverage function composition. Composition — — is expressed using the compose operator (<a href="https://code.kx.com/kdb-x/ref/compose.html">&#39;</a>). For example:</p><pre>q)f: {2*x}<br>q)g: {x+1}<br>q)&#39;[f;g] 3  / 2*(3+1)<br>8</pre><p>The composition must be wrapped in parentheses for the parser to handle assignment correctly:</p><pre>q)c: (&#39;[f;g])<br>q)c 3<br>8</pre><p>By using enlist as the second parameter in a composition, we create a function that captures all passed arguments into a single list before passing them to the primary logic:</p><pre>variadicFn: (&#39;[{ ... }; enlist])</pre><p>As a concrete example, consider a function that calculates the future value of an investment:</p><p>In this model, the compounding frequency () typically defaults to 12 (monthly), but users may need to override it.</p><pre>futval: (&#39;[{[params]<br>    (p; r; y): 3#params;<br>    n: $[3 = count params; 12; last params];<br><br>    p * (1 + r % n) xexp (n * y)<br>  };enlist])</pre><p>The function can now be called with either three or four parameters:</p><pre>q)futval[100; 0.07; 30]         / Uses default n=12<br>811.6497<br>q)futval[100; 0.002; 30; 365]   / Overrides n=365<br>106.1836</pre><h3>The Factory Pattern</h3><p>To streamline development, we can define a factory function that wraps any lambda into an assignable variadic function:</p><pre>makeVariadic: (&#39;[; enlist])</pre><p>This abstracts the composition logic, making the intent clearer:</p><pre>futval: makeVariadic {[params]<br>    (p; r; y): 3#params;<br>    n: $[3 = count params; 12; last params];<br><br>    p * (1 + r % n) xexp (n * y)<br>  }</pre><h3>Enhanced Type Checking</h3><p>Leveraging the type-checking syntax introduced in kdb+ 4.1, we can enforce strict validation on both the number and types of parameters:</p><pre>futval: makeVariadic {[params]<br>    / Validate argument count<br>    if[not count[params] in 3 4;<br>        &#39;&quot;Function futval accepts 3 or 4 parameters, but received &quot;, string count params];    / Type checking via assignment<br><br>    (p:`j; r:`f; y:`j): 3#params;<br>    n: 12;<br>    if[4=count params;<br>        (n:`j): last params];       / type checking<br><br>    p * (1 + r % n) xexp (n * y)<br>  }</pre><p>This triggers immediate, descriptive errors:</p><pre>q)futval[10]<br>&#39;Function futval accepts 3 or 4 parameters, but received 1<br>  [0]  futval[10]<br>       ^<br>q)futval[100; 0.07; 30; 365.]    / passing a float instead of a long<br>&#39;type<br>  [1]  /Users/kx/dev/variadic.q:7:<br>    if[4=count params;        (n:`j): last params];<br>          ^</pre><h3>Leveraging Filter Functions</h3><p>Filter functions help validate function parameters in a consistent, reusable way. They allow us to normalize inputs and separate preprocessing logic from core implementation. As an example, consider a function fn that accepts a kdb+ database root directory.</p><pre>getFSym: {hsym $[10h~type x;`$;] x}<br><br>fn: {[db:getFSym] 0N!db;}</pre><p>Internally, the function works with a file symbol, but callers are free to pass a string, symbol, or file symbol.</p><pre>q)fn &quot;/tmp/kdbdb&quot;<br>`:/tmp/kdbdb<br>q)fn `:/tmp/kdbdb<br>`:/tmp/kdbdb</pre><p>Filter functions can also be applied within the function body. In our future value example, the optional parameter must be a positive integer — accepting a short, int, or long.</p><pre>positiveNumber: {[name:`C; v]<br>    if[not 0&lt;x; &#39;name, &quot; must be a positive number&quot;];<br>    if[not .Q.ty[x] in &quot;HIJ&quot;; &#39;name, &quot; must be either a short, int or long&quot;];<br>    x<br> }</pre><pre>futval: makeVariadic {[params]<br>    if[not count[params] in 3 4;<br>        &#39;&quot;Function futval accepts 3 or 4 parameters, but received &quot;, string count params];<br>    (p:`j; r:`f; y:`j): 3#params;<br>    n: 3;<br>    if[4=count params;<br>        (n:positiveNumber[&quot;fourth parameter&quot;]): last params];<br><br>  p * (1 + r % n) xexp (n * y)<br>  }</pre><p>Example usage:</p><pre>q)futval[100; 0.07; 30; -1]<br>&#39;fourth parameter must be a positive number<br>  [2]  /Users/kx/dev/variadic.q:3: positiveInteger:{[name:`C; v]<br>    if[not 0&lt;v; &#39;name, &quot; must be a positive number&quot;];<br>                ^<br>    if[not .Q.ty[v] in &quot;HIJ&quot;; &#39;name, &quot; must be either a short, int or long&quot;];<br>  [1]  /Users/kx/dev/variadic.q:14:<br>    if[4=count params;<br>        (n:positiveInteger[&quot;fourth parameter&quot;]): last params];</pre><h3>Scaling with Optional Parameters</h3><p>For functions with extensive configuration options, passing a dictionary is the most scalable approach. This avoids “parameter bloat” and makes the API easier to maintain as it evolves. This approach scales naturally as the module evolves and new options are added. For example, buildPersistedDB from the <a href="https://code.kx.com/kdb-x/modules/datagen/overview.html">Datagen module</a> has one mandatory parameter and eleven optional ones. The <a href="https://code.kx.com/kdb-x/how_to/basics/data_structures/dictionaries.html#dictionary-literal-syntax">dictionary literal syntax</a> introduced in kdb+ version 4.1 comes in handy. Let us see a complex example of a “production” code:</p><pre>DEFAULTS: ([<br>  tradesPerDay: 1000;   / nr of trades per day<br>  exchopen: 09:30;      / exchange open time<br>  exchclose: 16:00;     / exchange close time<br>  quotesPerTrade: 10;   / number of quotes per trade<br>  nbboPerTrade: 3       / nr of nbbo per trade<br>  tbls: `trade`quote`nbbo`daily;    / tables to generate<br>  mastertype: `flat;    / type of the master table (flat or splayed)<br>  holidays: (&quot;01.01&quot;; &quot;01.19&quot;; &quot;02.16&quot;; &quot;05.25&quot;; &quot;06.19&quot;; &quot;07.03&quot;; &quot;09.07&quot;; &quot;10.12&quot;; &quot;11.11&quot;; &quot;11.26&quot;; &quot;12.25&quot;);<br>  segmentNr: 0;         / nr of segments<br>  segmentPattern: &quot;/tmp/mnt/ssd{}/testdata&quot;;    / segment pattern<br>  linked: 0b])          / 1b to generate linked columns</pre><p>A dedicated helper function to process optional parameters — or the full parameter list — keeps the main function clean and focused.</p><pre>processOptParam:{[allowedKeys; optparam]<br>  if[not 99h = type optparam;<br>    &#39;&quot;A numeric or a dictionary is expected as optional parameter&quot;];<br><br>  unknownParams: (key optparam) except allowedKeys;<br>  if[count unknownParams; &#39;&quot;Unknown parameter(s): &quot;, &quot;,&quot; sv string unknownParams];<br><br>  if[`tbls in key optparam;<br>    optparam: (`tbls _ optparam), ([tbls: $[count optparam `tbls; (), optparam `tbls; `$()]]); / a  symbol or a general empty list are also accepted<br>    unknownTbls: optparam[`tbls] except `trade`quote`nbbo`daily;<br>    if[count unknownTbls; &#39;&quot;Unknown table(s) in tbls parameter: &quot;, &quot;,&quot; sv string unknownTbls]];<br><br>  if[`mastertype in key optparam;<br>    if[not p[`mastertype] in `flat`splayed;<br>      &#39;&quot;Invalid mastertype parameter, expected `flat or `splayed&quot;]];<br>  optparam<br>  }</pre><p>The main function</p><pre>buildPersistedDB: (&#39;[{[params]<br>  if[2&lt;count params; &#39;&quot;Too many parameters passed to buildPersistedDB&quot;];<br>  if[(::) ~ first params;<br>    &#39;&quot;Destination directory must be provided as first parameter to buildPersistedDB&quot;];<br>  (dst: getFSym): first params;<br>  p: DEFAULTS;<br>  if[1 &lt; count params;<br>    p,: processOptParam[key p; last params]];<br>  ...<br>  };enlist])</pre><h3>Summary</h3><p>By combining variadic compositions, 4.1 type checking, and filter functions, you can build q APIs that are both flexible and “fail-fast.” Separating parameter validation from the core implementation results in code that is easier to test, document, and extend.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7cc34b64e8a7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kx-systems/variadic-functions-in-q-7cc34b64e8a7">Variadic functions in q</a> was originally published in <a href="https://medium.com/kx-systems">KX Systems</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Benchmarking KDB-X vs QuestDB, ClickHouse, TimescaleDB and InfluxDB with TSBS]]></title>
            <link>https://medium.com/kx-systems/benchmarking-kdb-x-vs-questdb-clickhouse-timescaledb-and-influxdb-with-tsbs-2090f4533be0?source=rss-6437b4668b35------2</link>
            <guid isPermaLink="false">https://medium.com/p/2090f4533be0</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[benchmarking]]></category>
            <category><![CDATA[query-optimization]]></category>
            <category><![CDATA[kdb-x]]></category>
            <category><![CDATA[timeseries-database]]></category>
            <dc:creator><![CDATA[Ferenc Bodon, PhD]]></dc:creator>
            <pubDate>Wed, 26 Nov 2025 19:04:22 GMT</pubDate>
            <atom:updated>2025-11-26T19:04:22.541Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*PS7N3p-4uXJAG3vt2UbUnA.png" /></figure><h3>Key Takeaways</h3><ol><li>Each system ingested the same dataset and executed identical query definitions from the TSBS DevOps workload. All tests were run on the same hardware under identical conditions.</li><li>All competitors were significantly slower on average than KDB-X. The closest was QuestDB, with an average slowdown factor of 3.36.</li><li>It’s important to note that KDB-X achieved these results using only a fraction of the available resources.</li><li>In some cases, users would wait 20x longer with QuestDB or 1100x longer with ClickHouse compared to KDB-X.</li></ol><h3><strong>Background</strong></h3><p>We recently ran a series of benchmarking tests to evaluate how KDB-X performs compared to several open-source databases on standard analytical workloads, including aggregation, filtering, and group-by queries.</p><p>Each system ingested the same dataset and executed identical query definitions from the TSBS DevOps workload. All tests were run on the same hardware under identical conditions.</p><p>KDB-X was configured using its community setup — a single q process limited to 16GB of memory and four execution threads — while the other databases ran with their default open-source configurations and had access to the full hardware resources. In this benchmark, a single client issued hundreds of queries sequentially. We’ll explore KDB-X’s architecture for enterprise-grade workloads, including multi-client and parallel query scenarios, in a follow-up article.</p><p>The full configuration details, dataset generator, and query scripts are available in <a href="https://github.com/KxSystems/tsbs">our public GitHub repository</a>. You can reproduce every test run, review the parameters, and adapt the setup to suit your own environment.</p><h3>A brief history of TSBS</h3><p>TSBS was initially developed by engineers at InfluxDB to benchmark various time-series databases, including their own. However, their benchmarks were often criticized for favoring InfluxDB’s architecture.</p><p>The project was later forked and significantly improved by TimescaleDB engineers, who made it more flexible, extensible, and vendor-agnostic. Their goal was to create a standardized framework adaptable to various use cases (e.g., DevOps, IoT). TSBS eventually became the de facto community standard for benchmarking time-series databases.</p><p>Unfortunately, pull requests to the TimescaleDB repository are no longer being merged, leaving valuable contributions pending. QuestDB also forked the TimescaleDB repo, applied fixes, and uses TSBS in their performance-related blog posts. We followed a similar approach: forking the TimescaleDB repo and integrating QuestDB’s changes to ensure a fair comparison. For full transparency and reproducibility, we will make the repository publicly available in an upcoming announcement.</p><h3>Databases tested</h3><p>QuestDB, ClickHouse, TimescaleDB, and InfluxDB are well-known open-source time-series databases. Most of them use a columnar storage model and vectorized query execution, optimized for online analytical processing (OLAP).</p><p><strong>KDB-X</strong> is a modern data and analytics platform built on top of the latest generation of kdb+. kdb+ is a proprietary, high-performance, column-oriented time-series database system with a 30+ year pedigree in handling any volume of streaming, real-time, and historical data quickly and efficiently. It is widely used in high-frequency trading and financial services due to its in-memory processing capabilities and integration with the q programming language, which supports fast and concise data analysis. Tested version: 0.1.0 community edition (release date: 2025.06.25).</p><p><strong>QuestDB</strong> supports ingestion via the InfluxDB Line Protocol and extends standard SQL with time-series-specific constructs such as LATEST ON and SAMPLE BY. Its architecture is centered on the handling of chronological records, with a focus on ingestion and querying operations involving such data sets. The system was configured according to QuestDB’s recommendations, including setting the Linux virtual memory areas limit to 8388608 and the maximum number of open files to 1048576. Tested version: 9.0.0 (release date: 2025.07.11).</p><p><strong>InfluxDB</strong> is a purpose-built time-series database intended to handle large volumes of time-stamped data. It is widely used for monitoring, IoT, and real-time analytics. InfluxDB’s architecture includes a specialized Time-Series Index (TSI) for data retrieval and an open-source query language called Flux, the purpose of which is to offer a user-friendly experience for time-series data. Tested version: 2.7.11 (release date: 2024.12.02).</p><p><strong>TimescaleDB</strong> is engineered as an extension on top of PostgreSQL, which allows it to integrate with the broader ecosystem of tools and libraries associated with that database. A central aspect of its design is the automatic partitioning of data into segments called “chunks” based on time and, optionally, other key identifiers. This approach aims to manage the growth of time-series data, which often accumulates steadily over time. We ran timescaledb-tune after installation for optimal settings. Tested version: 2.20.2 (release date: 2025.06.02) over PostgreSQL 17.5 (released on 2025.05.08).</p><p><strong>ClickHouse</strong> is another open-source, column-oriented database management system designed for online analytical processing (OLAP). The system is structured to work on multiple servers in a shared-nothing cluster configuration, allowing it to scale across hardware resources. It employs a dialect of SQL as its primary query language, enabling users to perform aggregations and generate reports on large datasets. Tested version: 25.6.5.41 (release date: 2025.06.26).</p><p>We used a server with 256 cores and 2.2TB of physical memory. The free version of KDB-X could only <strong>use a fraction of the available resources</strong>. For example:</p><ul><li>Only 4 threads (1.5% of the total) were used</li><li>Only 16 GB of memory (8% of the total) was permitted</li></ul><p>All other solutions had full access to the hardware.</p><h3>Tests</h3><p>We ran the benchmark with three datasets. Since the focus of this testing was queries, we only generated the CPU table, as the other tables are used to test ingest speeds only. The scale and interval values below are parameters that determine the size of the input data used to populate the database. For convenience, we have included the file size and row counts.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FaFjyL%2F1%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2FaFjyL%2F1%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2FaFjyL%2Fplain-s.png%3Fv%3D1&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="311" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a176f0172aa623a3dcdc94c3aa83c51/href">https://medium.com/media/5a176f0172aa623a3dcdc94c3aa83c51/href</a></iframe><p>For all combinations of DBMS and scenario, we used a single client to send queries to simplify compliance with the terms of the free KDB-X community edition. The commercial version does not impose such resource limits. Stay tuned for future results using multiple clients.</p><h3>Results</h3><p>TSBS calculates the <strong>mean response time</strong> for each query. We compute the<strong> ratio</strong> relative to KDB-X’s mean response time. For example, a value of 2 means KDB-X executed the query twice as fast as the other product on average. The <strong>geometric mean</strong> of these ratios for each solution is shown below:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2Fc0t6r%2F1%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2Fc0t6r%2F1%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2Fc0t6r%2Fplain-s.png%3Fv%3D1&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="410" frameborder="0" scrolling="no"><a href="https://medium.com/media/5946f19178df20457e12e8425174dd36/href">https://medium.com/media/5946f19178df20457e12e8425174dd36/href</a></iframe><p>All competitors were significantly slower on average than KDB-X. The closest was QuestDB, with an average slowdown factor of 3.36.</p><p>It’s important to note that KDB-X achieved these results using only a fraction of the available resources.</p><p>The graph below shows how much slower each product was for the query that performed worst, compared to KDB-X:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2F3rSy5%2F2%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2F3rSy5%2F2%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2F3rSy5%2Fplain-s.png%3Fv%3D2&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="410" frameborder="0" scrolling="no"><a href="https://medium.com/media/28200cdae62717fabe6449453ec8440f/href">https://medium.com/media/28200cdae62717fabe6449453ec8440f/href</a></iframe><p>In some cases, users would wait 20x longer with QuestDB or 1100x longer with ClickHouse compared to KDB-X.</p><p>We further broke down the results by test scenarios:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FAOJxX%2F1%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2FAOJxX%2F1%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2FAOJxX%2Fplain-s.png%3Fv%3D1&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="506" frameborder="0" scrolling="no"><a href="https://medium.com/media/98c7f4064bb527af500cbde4c0b24f53/href">https://medium.com/media/98c7f4064bb527af500cbde4c0b24f53/href</a></iframe><h3>Detailed Results</h3><p>Below, we focus on the <em>1 year, low rate</em> performance ratios broken down by query type. This test includes the longest time span of data, closely resembling typical client datasets that often cover multiple years. Due to the extended time range, queries are more likely to access disk storage rather than benefit from page cache. To ensure consistency, we flushed the page cache before running the test. Each query was executed with 500 distinct parameter sets. You can find a brief description of each test in the <a href="https://github.com/timescale/tsbs/blob/master/README.md#devops--cpu-only">main document of TSBS</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2F3ASxz%2F1%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2F3ASxz%2F1%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2F3ASxz%2Fplain-s.png%3Fv%3D1&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="609" frameborder="0" scrolling="no"><a href="https://medium.com/media/db044dbacc736c0ed34cd79db262b404/href">https://medium.com/media/db044dbacc736c0ed34cd79db262b404/href</a></iframe><h3>Notable observations</h3><ul><li>Across 64 benchmark scenarios, <strong>KDB-X outperformed the competition</strong> in 58 cases, demonstrating consistent superiority in query performance.</li><li>InfluxDB<strong> crashed</strong> for the query groupby-orderby-limit.</li><li>ClickHouse was nearly <strong>four orders of magnitude slower</strong> on average than KDB-X for single-groupby-1-1-1.</li><li>TimescaleDB <strong>outperformed all others</strong> for groupby-orderby-limit but was <strong>more than 100x slower</strong> than KDB-X for a few queries.</li><li>QuestDB <strong>excelled</strong> in double-groupby-* and lastpoint queries. Considering all queries, it is <strong>4.2 times slower on average compared to KDB-X</strong>.</li></ul><h3>Hardware testbed</h3><p>We’re grateful to <a href="https://kx.com/blog/supercharge-hardware-evaluation-with-kx-nano/">AMD</a> for generously providing access to the hardware used in this benchmarking.</p><ul><li><strong>CPU:</strong> AMD EPYC 9755 (Turin), 2 sockets, 128 cores/sockets, 2 threads/core, 512 MB L3 cache, SMT off</li><li><strong>Memory:</strong> 2.2 TB, DDR5@ 6400 MT/s, 12 channels/socket</li><li><strong>Disk:</strong> SAMSUNG MZWLO3T8HCLS-00A07, 3.84 TB, PCIe 5.0 x4, 14,000 MB/s sequential read, 2.5M IOPS random read (4 KB)</li><li><strong>OS:</strong> RHEL 9.5, Kernel 5.14.0–503.11.1.el9_5.x86_64</li></ul><h3>Further readings</h3><p>As mentioned before, all configuration files, dataset generators, and query scripts used in this benchmark are available in <a href="https://github.com/KxSystems/tsbs">our public GitHub repository</a>. You can reproduce the tests, modify parameters such as dataset size or query mix, and run comparisons on your own hardware.</p><p>If you extend or adapt the benchmark — for example, by testing new workloads, ingestion profiles, or additional databases — we encourage you to share your findings through pull requests or issues in the repository. Contributions and replication studies help validate results and keep the dataset and tooling useful for the wider community.</p><p><strong>For discussion and feedback, join the conversation on the </strong><a href="https://forum.kx.com/">KX Developer Community forum</a><strong>, our </strong><a href="https://kx-community.slack.com/">community Slack channel</a><strong>, or open a thread in the repository’s Discussions tab.</strong></p><p><strong>To explore KDB-X hands-on, visit our Developer Center to start with the </strong><a href="https://developer.kx.com/products/kdb-x/install">KDB-X Community Edition</a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2090f4533be0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kx-systems/benchmarking-kdb-x-vs-questdb-clickhouse-timescaledb-and-influxdb-with-tsbs-2090f4533be0">Benchmarking KDB-X vs QuestDB, ClickHouse, TimescaleDB and InfluxDB with TSBS</a> was originally published in <a href="https://medium.com/kx-systems">KX Systems</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Choosing the Right File System for KDB-X/kdb+]]></title>
            <link>https://medium.com/kx-systems/choosing-the-right-file-system-for-kdb-x-kdb-d23180f431d3?source=rss-6437b4668b35------2</link>
            <guid isPermaLink="false">https://medium.com/p/d23180f431d3</guid>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[filesystem]]></category>
            <category><![CDATA[kdb]]></category>
            <category><![CDATA[kdb-x]]></category>
            <category><![CDATA[timeseries]]></category>
            <dc:creator><![CDATA[Ferenc Bodon, PhD]]></dc:creator>
            <pubDate>Tue, 30 Sep 2025 14:28:40 GMT</pubDate>
            <atom:updated>2025-10-17T06:59:19.131Z</atom:updated>
            <content:encoded><![CDATA[<h3>Choosing the Right File System for KDB-X/kdb+: A Case Study</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yHAtICroQuRbAEDpma5YLw.png" /></figure><p>In high-performance kdb+/KDB-X environments, storage throughput and latency are often the silent bottlenecks behind sluggish ingestion and delayed queries. While hardware specs get most of the attention, the file system — frequently overlooked — plays a pivotal role in shaping I/O performance. Using the <a href="https://github.com/KxSystems/nano">KX Nano</a> benchmarking utility, we conducted a rigorous comparison of file systems across two distinct Linux environments, revealing nuanced trade-offs that can dramatically impact real-world workloads.</p><p>The case study is now available at <a href="https://code.kx.com/q/kb/filesystemTestByNano/">https://code.kx.com/q/kb/filesystemTestByNano/</a></p><p><strong>Why File Systems Matter</strong></p><p>Whether you’re ingesting terabytes of tick data or querying historical HDBs, the file system mediates every read and write. Our tests spanned Red Hat Enterprise Linux 9 and Ubuntu 24.04, each paired with NVMe SSDs (PCIe 4.0 and 5.0, respectively), and evaluated ext4, XFS, Btrfs, F2FS and ZFS under diverse workloads.</p><p><strong>Key Findings</strong></p><p><strong>Write-Intensive Workloads: XFS Dominates</strong></p><p>For ingestion-heavy tasks — like EOD processing or appending large vectors — XFS consistently outperformed other file systems. On RHEL 9, XFS was almost <strong>6x faster</strong> than ext4 for set operations on large float vectors, and nearly 70<strong>x faster</strong> than ZFS.</p><p><strong>Read-Intensive Workloads: Context Is Everything</strong></p><p>Sequential reads from disk favored XFS on RHEL, but ext4 pulled ahead in parallel read scenarios with multiple kdb+ processes. On Ubuntu, <strong>F2FS demonstrated a performance margin</strong> in random reads from disk — especially when serving data directly from storage rather than page cache. However, its advantage vanished when data was cached in memory.</p><p><strong>Tiered Storage Strategy: Hybrid Wins</strong></p><p>For systems employing tiered architectures, we recommend:</p><ul><li><strong>Hot tier</strong>: Data is frequently queried and often resides in the page cache. For this tier, a read-optimized file system, such as ext4 or XFS, is effective.</li><li><strong>Mid tier</strong>: Data is queried less often, meaning reads are more likely to come directly from storage. In this scenario, F2FS’s stronger random read performance from storage provides some advantage.</li><li><strong>Cold tier</strong>: Data is typically compressed and stored on high-latency, cost-effective media like HDDs or object storage. While kdb+ has built-in compression support, file systems like Btrfs, F2FS, and ZFS also offer this feature. The performance implications of file-system-level compression warrant a separate, dedicated study.</li></ul><p><strong>Real-World Implications</strong></p><p>These results aren’t just academic. In production environments, choosing the right file system can mean the difference between meeting SLAs and missing them. For example, applying the p# attribute — a common operation in EOD workflows — was <strong>6.9x faster</strong> on XFS than ext4. When there is a short window to finish EOD work, the performance gains become transformative.</p><p><strong>Final Thoughts</strong></p><p>There’s no one-size-fits-all answer. Your optimal file system depends on workload characteristics, OS constraints, and hardware capabilities. That’s why we’ve included the full <a href="https://github.com/KxSystems/nano/tree/master/scripts/fsBenchmark">benchmarking suite</a> in the KX Nano GitHub repo — so you can replicate and tailor these tests to your own environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d23180f431d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kx-systems/choosing-the-right-file-system-for-kdb-x-kdb-d23180f431d3">Choosing the Right File System for KDB-X/kdb+</a> was originally published in <a href="https://medium.com/kx-systems">KX Systems</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>