<?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 Jove Zhong on Medium]]></title>
        <description><![CDATA[Stories by Jove Zhong on Medium]]></description>
        <link>https://medium.com/@jove?source=rss-773d7bcfa681------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*r_eqZZeFlNSyMpLRhW_tlw@2x.jpeg</url>
            <title>Stories by Jove Zhong on Medium</title>
            <link>https://medium.com/@jove?source=rss-773d7bcfa681------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 12:35:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jove/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[Announcing General Availability of Timeplus Enterprise v2.8]]></title>
            <link>https://medium.com/www-timeplus-com/announcing-general-availability-of-timeplus-enterprise-v2-8-0bbf84847e69?source=rss-773d7bcfa681------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bbf84847e69</guid>
            <category><![CDATA[flink]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[clickhouse]]></category>
            <category><![CDATA[spark]]></category>
            <dc:creator><![CDATA[Jove Zhong]]></dc:creator>
            <pubDate>Fri, 20 Jun 2025 17:52:10 GMT</pubDate>
            <atom:updated>2025-06-20T17:52:10.004Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Timeplus Enterprise v2.8 is now Generally Available! This release incorporates 3 key advancements:</strong></p><ul><li>Integration with Apache Iceberg</li><li>A novel compute node server role, facilitating the elastic execution of Materialized Views with S3 checkpoints</li><li>Tiered storage, optimizing data retention by allocating recent data to local SSDs while archiving older data in S3 for cost efficiency</li></ul><p>Powered by our lightweight, powerful, and efficient single-binary platform, Timeplus Enterprise offers flexible deployment options. Whether fully managed in the public cloud, self-hosted in your data center, running on your laptop, or even on edge devices, our platform adapts to diverse user needs and unblocks massive use cases, from handling large-scale workloads to operating in resource-contained edge environments, capturing real-time insights where data resides. Most importantly, Timeplus Enterprise drives down operational efforts and costs down with simplicity.</p><p>Our software has been rigorously tested and proven in a variety of industries and mission-critical use cases, including cybersecurity, algorithm-based trading, and real-time streaming pipeline and analytics.</p><p>In a recent case study, we explored how <a href="https://www.timeplus.com/post/customer-story-zyre">a leading cryptocurrency data platform</a> leveraged Timeplus Enterprise to streamline fragmented tooling, reduce analytics latency, and improve cost efficiency. While the use case centers on blockchain data, the lessons learned apply broadly to industries dealing with high-cardinality, mutable data and real-time analytics demands.</p><blockquote><em>“We tried countless tools and rewrote our pipeline multiple times. Timeplus was the first solution that let us index the full Ethereum chain — and now, any chain — in real-time. It’s transformed how we deliver data to our customers.”</em></blockquote><blockquote>— <a href="https://x.com/iNcizzle">Mathew Haji</a>, Founder at Zyre</blockquote><p>Today, we are excited to upgrade our offerings with the release of Timeplus Enterprise v2.8. This unified, enterprise-grade product can be installed on various infrastructures, including bare metal, Docker, and Kubernetes.</p><p>Check out our v2.8 launch video:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fqj7Xb1uZW4Y%3Fstart%3D6%26feature%3Doembed%26start%3D6&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dqj7Xb1uZW4Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fqj7Xb1uZW4Y%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7b3dee80985a4f47332991900db4e2a/href">https://medium.com/media/f7b3dee80985a4f47332991900db4e2a/href</a></iframe><h3>Read/Write data in Apache Iceberg Open Table Format</h3><p><a href="https://iceberg.apache.org/">Apache Iceberg</a> is an open table format for large-scale analytic datasets, designed for high performance and reliability. It provides an open, vendor-neutral solution that supports multiple engines, making it ideal for various analytics workloads. Initially, the Iceberg ecosystem was primarily built around Java, but with the increasing adoption of the REST catalog specification, Timeplus is among the first vendors to integrate with Iceberg purely in C++. This allows Timeplus users to stream data to Iceberg with a high performance, low memory footprint, and easy installation without relying on Java dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*0bPBhbGTmhKN6g3--2Snsw.png" /></figure><p>In this release, we provide native support for Apache Iceberg as a new database type. This allows you to read and write data using the Apache Iceberg open table format, with support for the Iceberg REST Catalog (IRC). In the initial release, we focused on writing data to Iceberg, with basic query optimization for reading data from Iceberg. The integration with Amazon S3, <a href="https://docs.aws.amazon.com/glue/latest/dg/connect-glu-iceberg-rest.html">AWS Glue’s Iceberg REST endpoint</a> and <a href="https://gravitino.apache.org/docs/0.8.0-incubating/iceberg-rest-service">the Apache Gravitino Iceberg REST Server</a> are validated. More REST catalog implementations are planned.</p><h3>Key Benefits for Timeplus Iceberg Integration</h3><ul><li>Using Timeplus materialized views, users can continuously process and transform streaming data (from Apache Kafka for example) and write to the cost-effective object storage in Apache Iceberg open table format.</li><li>Apache Iceberg’s open table format ensures you’re never locked into a single vendor or query engine</li><li>Query your Iceberg tables with multiple engines including Timeplus, Apache Spark, Apache Flink, ClickHouse, DuckDB, and AWS Athena</li><li>Future-proof your data architecture with broad industry support and an active open-source community</li></ul><h3>Example: AWS S3 Table REST Catalog</h3><p>The General Availability of AWS S3 Table offers a streamlined approach to leveraging Iceberg through a fully managed, serverless solution. To establish a connection with S3 Table, execute the following SQL statement within Timeplus.</p><pre>CREATE DATABASE demo<br>SETTINGS  type=&#39;iceberg&#39;,<br>          catalog_uri=&#39;https://glue.us-west-2.amazonaws.com/iceberg&#39;,<br>          catalog_type=&#39;rest&#39;,<br>          warehouse=&#39;(aws-12-id):s3tablescatalog/(bucket-name)&#39;,<br>          rest_catalog_sigv4_enabled=true,<br>          rest_catalog_signing_region=&#39;us-west-2&#39;,<br>          rest_catalog_signing_name=&#39;glue&#39;;</pre><p>Next, you can list existing Iceberg tables via:</p><pre>SHOW STREAMS FROM demo</pre><p>Or, you can query them via demo.table_name in Timeplus.</p><h3>Writing to Iceberg via a Materialized View</h3><p>You can run INSERT INTO statements to write data to Iceberg tables, or set up a materialized view to continuously write data to Iceberg tables.</p><pre>CREATE MATERIALIZED VIEW mv_write_iceberg INTO demo.transformed AS<br>SELECT now() AS timestamp, org_id, float_value,<br>       length(`array_of_records.a_num`) AS array_length,<br>       array_max(`array_of_records.a_num`) AS max_num,<br>       array_min(`array_of_records.a_num`) AS min_num<br>FROM msk_stream_read<br>SETTINGS s3_min_upload_file_size=1024;</pre><h3>Demo Video</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F2m6ehwmzOnc%3Fstart%3D1%26feature%3Doembed%26start%3D1&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2m6ehwmzOnc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2m6ehwmzOnc%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b456837fb72ffb6a232707bbb8b30c1/href">https://medium.com/media/3b456837fb72ffb6a232707bbb8b30c1/href</a></iframe><h3>Elastic Materialized Views with Auto-Scaling Compute Nodes</h3><p>Built for fault tolerance, auto-recovery, performance, and efficiency, materialized views are the key building blocks in Timeplus for real-time data pipelines.</p><p>Timeplus Enterprise 2.8 introduces Compute Nodes, a new type of server node that leverages AWS Spot Instances or Auto Scaling Group. This allows Timeplus clusters to dynamically add or remove nodes to schedule the materialized views on-demand, in response to changing workloads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yczH0zhNrOERL1Vd.png" /></figure><p>Materialized views configured with S3 disk-based checkpoints are scheduled on ephemeral compute nodes. These nodes read data from remote sources (e.g., Apache Kafka), process it locally, and send the results to downstream destinations (e.g., ClickHouse or another Kafka topic).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rfu5lqdf9kVz6BVk.png" /></figure><p>A new page has been created in Timeplus Console to visualize the dynamic nodes in the cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZIoiNtahcoJ8wwOZ.jpg" /></figure><p>To learn more, check out this intro and demo video by our Chief Architect, Ken Chen:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmAf3acE_5io%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmAf3acE_5io&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmAf3acE_5io%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7204bf66b89276f9e7caa353616f9fca/href">https://medium.com/media/7204bf66b89276f9e7caa353616f9fca/href</a></iframe><h3>S3 Tiered Storage</h3><p>Timeplus is designed to be both high-performance and user-friendly. You can deploy it in your data center without any additional dependencies. By utilizing high-performance NVMe SSD local disks, Timeplus can achieve the highest possible disk I/O and deliver the lowest latency streaming analytics.</p><p>To reduce local disk costs for scenarios where multiple terabytes or even petabytes of data are stored in a Timeplus cluster, Timeplus Enterprise v2.8 introduces Tiered Storage. This feature allows users to combine local and remote storage, storing hot data in local high-performance storage (like NVMe SSD) for quick access, and moving older data to object storage (like S3) for long-term retention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*doVGbQn-k5Olw8ONubmUvg.png" /></figure><p>To configure Tiered Storage, users define a storage policy that specifies the storage tiers and their priorities. The storage policy can then be applied to one or more streams.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M4yP4AL02ydLqgta.png" /></figure><p>In the example, a stream called “my_stream” is created with a Time-To-Live (TTL) policy that moves data older than 7 days to cold storage. The cold storage is within the “hcs” storage policy, which utilizes an S3 disk named “tiered_s3_volume.” Data can be continuously added to “my_stream” through materialized views, the ingestion API, or INSERT commands. The most recent seven days of data are stored on Timeplus cluster disks, while older data is automatically moved to the S3 bucket. Users can query both local and remote data using SQL within Timeplus.</p><h3>Other Enhancements</h3><ul><li>Direct read and write access to PostgreSQL tables, or data lookup via dictionaries, through PostgreSQL External Table.</li><li>New SQL command for renaming streams and columns.</li><li>JavaScript UDFs benefit from multiple V8 instances, improving concurrency and isolation.</li><li>Clean up cache when updating Protobuf schemas</li><li>New page providing detailed views for streams and materialized views.</li></ul><h3>Learn More</h3><p>Thank you for being a part of our journey. We look forward to your continued support and collaboration as we move towards a future powered by real-time streaming analytics.</p><p>To explore the capabilities of Timeplus Enterprise v2.8, please check out <a href="https://docs.timeplus.com/enterprise-v2.8">https://docs.timeplus.com/enterprise-v2.8</a> for the installation guide and change logs.</p><p>Ready to try Timeplus Enterprise? <a href="https://timeplus.com/download">Try for free for 30-days</a>.</p><p>Join our Timeplus Community! Connect with other users or get support in our <a href="https://timeplus.com/slack">Slack community</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bbf84847e69" width="1" height="1" alt=""><hr><p><a href="https://medium.com/www-timeplus-com/announcing-general-availability-of-timeplus-enterprise-v2-8-0bbf84847e69">Announcing General Availability of Timeplus Enterprise v2.8</a> was originally published in <a href="https://medium.com/www-timeplus-com">Timeplus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing General Availability of Timeplus Enterprise v2.7]]></title>
            <link>https://medium.com/www-timeplus-com/announcing-general-availability-of-timeplus-enterprise-v2-7-992b9dc059d4?source=rss-773d7bcfa681------2</link>
            <guid isPermaLink="false">https://medium.com/p/992b9dc059d4</guid>
            <category><![CDATA[flink]]></category>
            <category><![CDATA[stream-processing]]></category>
            <category><![CDATA[real-time-analytics]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[clickhouse]]></category>
            <dc:creator><![CDATA[Jove Zhong]]></dc:creator>
            <pubDate>Mon, 03 Mar 2025 19:55:15 GMT</pubDate>
            <atom:updated>2025-03-03T19:55:15.519Z</atom:updated>
            <content:encoded><![CDATA[<p>Timeplus Enterprise v2.7 is now Generally Available! In our second GA release of 2025, we significantly improved the data pipeline capabilities by supporting MySQL and S3 in the core engine, and introducing dictionaries for fast lookup in remote database tables or Timeplus streams. Other key features include high performance Python User-Defined-Function and new UI for cluster monitoring and materialized views troubleshooting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*yM_Qu26WS6Z4ZEZvesPE_g.png" /></figure><p>Powered by our lightweight, powerful, and efficient single-binary platform, Timeplus Enterprise offers flexible deployment options. Whether fully managed in the public cloud, self-hosted in your data center, running on your laptop, or even on edge devices, our platform adapts to diverse user needs and unblocks massive use cases, from handling large-scale workloads to operating in resource-contained edge environments, capturing real-time insights where data resides. Most importantly, Timeplus Enterprise drives down operational efforts and costs down with simplicity.</p><p>Our software has been rigorously tested and proven in a variety of industries and mission-critical use cases, including cybersecurity, algorithm-based trading, and real-time streaming pipeline and analytics. As we shared in a recent webinar, Timeplus partnered with Salla to improve the performance and stability of thousands of pipelines in their e-commerce business.</p><blockquote>“Timeplus enabled us to efficiently scale our data processing with <strong>minimal latency and maximum throughput</strong>, which lets us reduce bottlenecks and enhance service resilience.”</blockquote><blockquote>Salah Alkhwlani<strong> | </strong>CTO, Salla</blockquote><blockquote>“We constantly seek ways to accelerate analytics and reporting. However, handling multi-stream table JOINs on the fly is not ClickHouse’s strength. This is where <strong>Timeplus’ MULTI-JOIN on stream acts as a crucial solution</strong>, minimizing duplicate processing overhead.”</blockquote><blockquote>Ibrahim Bakhsh | Senior Cloud Data Engineer, Salla</blockquote><p>Today, we are excited to upgrade our offerings with the release of Timeplus Enterprise v2.7. This unified, enterprise-grade product can be installed on various infrastructures, including bare metal, Docker, and Kubernetes.</p><h3>Key Breakthroughs in Timeplus Enterprise v2.7</h3><p>The v2.7 release of Timeplus Enterprise introduces several groundbreaking features:</p><ul><li>External Tables for MySQL and S3</li><li>Data Lookup with Dictionaries</li><li>Python UDF</li><li>Troubleshooting UI</li></ul><h3>Built-in Support for MySQL and S3 Read and Write</h3><p>Amazon S3 is cloud object storage with industry-leading scalability, data availability, security, and performance.</p><p>In Timeplus Enterprise v2.7, we added the first-class integration for S3-compatible object storage systems, as <a href="https://docs.timeplus.com/s3-external">a new type of External Table</a>. You can read or write data in Amazon S3 or S3-compatible cloud or local storage.</p><p>To create an external table for S3, you can run the following DDL SQL:</p><pre>CREATE EXTERNAL TABLE [IF NOT EXISTS] name<br>    (&lt;col_name1&gt; &lt;col_type1&gt;, &lt;col_name2&gt; &lt;col_type2&gt;, ...)<br>PARTITION BY .. -- optional<br>SETTINGS<br>    type=&#39;s3&#39;, -- required<br>    use_environment_credentials=true|false, -- optional, default false<br>    access_key_id=&#39;..&#39;, -- optional<br>    secret_access_key=&#39;..&#39;, -- optional<br>    region=&#39;..&#39;, -- required<br>    bucket=&#39;..&#39;, -- required<br>    read_from=&#39;..&#39;, -- optional<br>    write_to=&#39;..&#39;, -- optional<br>    data_format=&#39;..&#39;, -- optional<br>    compression_method=&#39;..&#39;, -- optional<br>    config_file=&#39;..&#39;, -- optional<br>    endpoint=&#39;..&#39;, -- optional<br>    ...</pre><p>The credential of your AWS account can be put directly into the DDL, but you can also bind an IAM role with proper permissions if you deploy Timeplus Enterprise on an EC2 instance or Kubernetes pod. Alternatively, you can store the credentials as environment variables or a local file. The latter can be mounted by a security manager such as HashiCorp Vault. Please check the integration guide <a href="https://docs.timeplus.com/proton-kafka#config_file">here</a>. The new setting config_file is applicable to all external streams or external tables in Timeplus, such as Kafak, Pulsar, ClickHouse.</p><p>With the new S3 external tables, you can build data pipelines to read from AWS MSK and send the transformed data to S3 as Parquet files. This can significantly reduce the data storage cost in MSK. The files in S3 can be read by Timeplus, or other tools such as Athena or Spark. In the next month’s release, we will natively support Apache Iceberg open table format. Stay tuned for more information.</p><h3>External Data Lookup With Dictionaries</h3><p>In Timeplus Enterprise 2.7, you can create <a href="https://docs.timeplus.com/sql-create-dictionary">dictionaries</a> to look up data in MySQL, ClickHouse or other Timeplus deployment, cache them in the memory or as mutable streams. This works particularly well with streaming JOINs.</p><p>For example, you can create a dictionary to connect to a MySQL database:</p><pre>CREATE DICTIONARY mysql_products_dict<br>(<br>   `id` string,<br>   `name` string,<br>   …<br>)<br>PRIMARY KEY id<br>SOURCE(MYSQL(DB ‘test’ TABLE ‘products’ HOST ‘127.0.0.1’ PORT 3306 USER ‘admin’ PASSWORD ‘my’)<br>LAYOUT(complex_key_direct());</pre><p>You can look up the name based on the specified ID by calling the dict_get function.</p><pre>SELECT dict_get(‘mysql_products_dict’, ‘id’, ‘00005’);</pre><p>But more commonly, you can use the dictionary in a DIRECT JOIN, e.g.:</p><pre>SELECT * FROM orders_stream<br>JOIN mysql_products_dict AS products ON orders.product_id = products.id<br>SETTINGS join_algorithm = ‘direct’;</pre><p>In this example, no matter how many unique product IDs are, the streaming SQL will check the cached data in the dictionary to look up name by ID. If the id is not found, then query the MySQL database then put the data in cache. You can specify the TTL(Time-To-Live) settings to control how much data will be cached in the memory.</p><p>In Timeplus Enterprise 2.7, we also support using a mutable stream as the cache, so that customers can warm up the cache with frequently accessed dimensional data, and leverage CDC (Change Data Capture) technologies to update the cache proactively when the raw data in MySQL is updated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KV8CFBEvFFvPkaAArfum2w.gif" /></figure><h3>Python UDF</h3><p>Python is recognized as one of the most popular languages in the field of data science. Its flexibility as a scripting language, ease of use, and extensive range of statistical libraries make it an indispensable tool for data scientists and analysts.</p><p>Python excels in writing complex parsing and data transformation logic, especially in scenarios where SQL capabilities are insufficient. Python User-Defined Functions (UDFs) offer the flexibility to implement intricate data processing mechanisms. These include:</p><ul><li><strong>Custom Tokenization</strong>: Breaking down data into meaningful elements based on specific criteria.</li><li><strong>Data Masking</strong>: Concealing sensitive data elements to protect privacy.</li><li><strong>Data Editing</strong>: Modifying data values according to specific rules or requirements.</li><li><strong>Encryption Mechanisms</strong>: Applying encryption to data for security purposes.</li></ul><p>Timeplus Enterprise 2.7 is the first release with a public preview of the Python UDF for Linux x86_64 platforms. Unlike other databases who also support defining functions in Python, Timeplus core engine has the embedded CPython runtime to execute Python code directly without a bridge call to an external Python runtime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CMim6GtrCgCR46XcyNlzlQ.png" /></figure><p>This not only simplifies the deployment of Timeplus Enterprise, but also significantly improves the performance of Python UDF. For example, with the traditional bridge based solution to call a local Python process, we got the baseline as 2 million events per second. With the embedded CPython in Timeplus core engine, we achieved 12 million events per second with the same Python code.</p><p>With the rich ecosystem of Python, you can build new SQL functions to greatly extend Timeplus Enterprise. For example, the following SQL creates a Python UDF to call OpenAI to ask any questions.</p><pre>CREATE OR REPLACE FUNCTION ask_ai(question string) RETURNS string LANGUAGE PYTHON AS<br>$$<br>import os       <br>from openai import OpenAI<br>client = OpenAI(api_key=os.getenv(&quot;OPENAI_API_KEY&quot;))<br><br>def ask_ai(question):<br>   res = []<br>   for q in question:<br>       try:<br>           chat_completion = client.chat.completions.create(<br>               messages=[{<br>                   &quot;role&quot;: &quot;user&quot;,<br>                   &quot;content&quot;: q<br>               }],<br>               model=&quot;gpt-3.5-turbo&quot;)<br>           res.append(chat_completion.choices[0].message.content)<br>       except Exception as e:<br>           res.append(str(e))<br>   return res<br>$$</pre><h3>Troubleshooting UI</h3><p>Based on the feedback from Salla and other customers, we built an advanced state monitoring for materialized views and streams in Timeplus Enterprise 2.7. This greatly improved the productivity for the customers to manage thousands of streaming pipelines. With the new UI, the data team can intuitively understand which materialized views are facing high workloads and what is the Kafka offset or internal sequence number on each node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*isK5P5jD20RyKE-dp6cTww.png" /><figcaption>Materialized View details in side panel</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UZjkODXDk-zrInRTAIKqIA.png" /><figcaption>Advanced lagging and checkpoint replication statuses</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQIzEAKyoO5AjS5BalfKWg.png" /><figcaption>Status column in the Materialized Views list page</figcaption></figure><h3>Other Enhancements</h3><ul><li><strong>Support IAM authentication for accessing Amazon MSK: Avoid storing static credentials in Kafka external streams by setting sasl_mechanism to AWS_MSK_IAM.</strong></li><li><strong>Kafka metadata: </strong>read the header key/value pairs for Kafka messages.</li><li><strong>PostgreSQL and MySQL CDC via Redpanda Connect:</strong> Timeplus Enterprise now supports CDC (Change Data Capture) for PostgreSQL and MySQL databases via Redpanda Connect. This feature enables real-time data ingestion from these databases into Timeplus.</li><li><strong>Mutable stream delete:</strong> You can now delete data from mutable streams with the <a href="http://docs.timeplus.com/sql-delete">DELETE</a> SQL command.</li><li><strong>Historical data replay</strong>: Replay historical data in local streams or Kafka external streams with the replay_speed setting.</li><li><strong>Multiple database namespaces</strong>: in the web console, you can choose a non-default database and manage the streams and materialized views in that namespace.</li></ul><h3>Learn More</h3><p>To explore the capabilities of Timeplus Enterprise v2.7, please check out <a href="https://docs.timeplus.com/enterprise-v2.7">https://docs.timeplus.com/enterprise-v2.7</a> for installation guide as well as change logs.</p><p>Thank you for being a part of our journey. We look forward to your continued support and collaboration as we move towards a future powered by real-time streaming analytics.</p><p>Ready to try Timeplus Enterprise? <a href="https://timeplus.com/download">Try for free for 30-days</a>.</p><p>Join our Timeplus Community! Connect with other users or get support in our <a href="https://timeplus.com/slack">Slack community</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=992b9dc059d4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/www-timeplus-com/announcing-general-availability-of-timeplus-enterprise-v2-7-992b9dc059d4">Announcing General Availability of Timeplus Enterprise v2.7</a> was originally published in <a href="https://medium.com/www-timeplus-com">Timeplus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing General Availability of Timeplus Enterprise v2.6]]></title>
            <link>https://medium.com/www-timeplus-com/announcing-general-availability-of-timeplus-enterprise-v2-6-7fa3edf0b315?source=rss-773d7bcfa681------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fa3edf0b315</guid>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[real-time-analytics]]></category>
            <category><![CDATA[sql-database]]></category>
            <category><![CDATA[clickhouse]]></category>
            <category><![CDATA[flink]]></category>
            <dc:creator><![CDATA[Jove Zhong]]></dc:creator>
            <pubDate>Mon, 03 Mar 2025 19:45:25 GMT</pubDate>
            <atom:updated>2025-03-03T19:45:25.639Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Hear Timeplus Enterprise updates from our Co-Founder and user cases from our customer. See the full recording of our </em><a href="https://www.youtube.com/watch?v=j1GnkyNviYs&amp;ab_channel=Timeplus"><em>Timeplus Live monthly webinar</em></a><em>.</em></p><p>I am thrilled to announce that Timeplus Enterprise v2.6 is now Generally Available! This is the first GA release in 2025. In this release, we introduce a revolutionary Hybrid Hash Table to significantly reduce memory consumption for high cardinality data streams for joins and aggregations (for example, from 180GB to 20GB). This also enables more concurrent Materialized Views running in the Timeplus with reasonable costs. Other key enhancements include enhanced operational visibility, cross-deployment integration, as well as performance improvements and an enhanced user experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*lqXwh8Typ2teO_Z-H57rlw.png" /></figure><p>Powered by our lightweight, powerful, and efficient single-binary platform, Timeplus Enterprise offers flexible deployment options. Whether fully managed in the public cloud, self-hosted in your data center, running on your laptop, or even on edge devices, our platform adapts to diverse user needs and unblocks massive use cases, from handling large-scale workloads to operating in resource-contained edge environments, capturing real-time insights where data resides. Most importantly, Timeplus Enterprise drives down operational efforts and costs down with simplicity.</p><p>Our software has been rigorously tested and proven in a variety of industries and mission-critical use cases, including cybersecurity, algorithm-based trading, and real-time streaming pipeline and analytics. As we shared in a recent webinar, Timeplus partnered with RocNet Supply to monitor network telemetry data with SQL-based processes and Grafana visualization.</p><blockquote>“Using Timeplus and Grafana together has been awesome! Timeplus simplifies what was a delicate manual transform process into an automatic SQL-based process.”</blockquote><blockquote><strong>Jason Patterson | </strong>Director of Network Architecture, RocNet Supply</blockquote><p>Today, we are excited to upgrade our offerings with the release of Timeplus Enterprise v2.6. This unified, enterprise-grade product is available through our fully managed cloud service or can be installed on various infrastructures, including bare metal, Docker, and Kubernetes.</p><h3>Key Breakthroughs in Timeplus Enterprise v2.6</h3><p>The v2.6 release of Timeplus Enterprise introduces several groundbreaking features:</p><ul><li>Revolutionary hybrid hash table for join and aggregations</li><li>Enhanced operational visibility</li><li>Performance improvements</li><li>Improved data management</li><li>Enhanced user experience</li></ul><h3>Revolutionary Hybrid Hash Table</h3><p>Imagine that you are running an analytics workload for a large e-commerce platform, such as Shopifly. There can be hundreds of millions of product SKUs that change slowly. On the other hand, every second there are many new events in the orders transaction table. For each new order, you need to look up the products dimension table to enrich the data. This sounds easy but is a hard problem to solve: you don’t want to slow down the OTLP database, so the data should be replicated to an OLTP database or Kafka topics, but streaming JOINs with such high cardinality would easily lead to out-of-memory errors.</p><p>Another scenario is blockchain analysis. One of Timeplus’ customers, Zyre, offers a platform for end users to index and analyze blockchain data. There are 2.6 billion unique transactions, 1.9 billion transfers and 2.1 billion actions. When the data is revisioned during blockchain reorganization or any update to a single transaction, the platform needs to show the revised aggregation results within one or two seconds, instead of reprocessing billions of data records in the chain.</p><p>In such scenarios, the default in-memory hash table for table JOIN can easily consume a lot of system memory. For example, one of our customers observed 180GB memory consumption with 10 materialized views in Timeplus to process such a massive scale of data. With the new Hybrid Hash Table in Timeplus Enterprise 2.6, which uses both the memory and the local disk to store the internal state as a hash table, only 20GB of memory is consumed, while still showing real-time streaming aggregation results every second.</p><p>To learn more, check out our case study for Zyre:</p><p><a href="https://medium.com/www-timeplus-com/customer-story-zyre-5f9758e480a4">How Zyre Leverages Timeplus for Real-Time Blockchain Analytics at Scale</a></p><pre>SELECT account_id, sum(total) AS total <br>FROM transfers <br>GROUP BY account_id <br>EMIT PERIODIC 1s ON UPDATE SETTINGS default_hash_table=’hybrid’;</pre><h3>Enhanced Operational Visibility</h3><p>Gain complete transparency into your system’s performance through comprehensive monitoring of materialized views and streams. Track state changes, errors, and throughput metrics via <a href="http://system.stream/">system.stream</a><a href="https://docs.timeplus.com/system-stream-state-log">_state_log</a> and <a href="http://system.stream/">system.stream</a><a href="https://docs.timeplus.com/system-stream-metric-log">_metric_log</a>.</p><p>Those metrics are available as Prometheus endpoints, and you can also query them using SQL.</p><p>For example, the following SQL will show the read/write throughput for each data stream in Timeplus for the past 5 minutes.</p><pre>SELECT<br>    name,<br>    avg((read_bytes / elapsed_ms) * 1000) AS read_bps,<br>    avg((read_rows / elapsed_ms) * 1000) AS read_eps,<br>    avg((written_bytes / elapsed_ms) * 1000) AS written_bps,<br>    avg((written_rows / elapsed_ms) * 1000) AS written_eps<br>FROM table(system.stream_metric_log)<br>WHERE elapsed_ms &gt; 0 and _tp_time &gt; now()-5m<br>GROUP BY name;</pre><h3>Performance Improvements</h3><p>In this release, we pushed our unparalleled performance to a new level. One of our customers needs to write billions of rows to ClickHouse from Timeplus. This is done via a materialized view with a ClickHouse external table as the target, for example:</p><pre>--DDL in ClickHouse<br>CREATE TABLE default.product<br>(<br>    `i` Int32,<br>    `j` String,<br>    `_tp_time` DateTime64(3)<br>)<br>ENGINE = MergeTree<br>ORDER BY i<br>SETTINGS index_granularity = 8192;<br><br>--DDL in Timeplus<br>CREATE EXTERNAL TABLE ch_product_ext<br>SETTINGS type = &#39;clickhouse&#39;, address = &#39;clickhouse:9000&#39;, table = &#39;product&#39;;<br><br>CREATE MATERIALIZED VIEW mv INTO ch_product_ext AS<br>SELECT i, j, _tp_time FROM rand_data;</pre><p>With Timeplus Enterprise v2.5, the write throughput is approximately 3 million rows per second. This could be measured by running the following SQL in ClickHouse:</p><pre>clickhouse :) select count(1)/DateDiff(s,min(_tp_time),max(_tp_time)) from product;<br><br>SELECT count(1) / dateDiff(&#39;second&#39;, min(_tp_time), max(_tp_time))<br>FROM product<br><br>   ┌─divide(count(1), dateDiff(&#39;second&#39;, min(_tp_time), max(_tp_time)))─┐<br>1. │                                                 2971131.1861743913 │ -- 2.97 million<br>   └────────────────────────────────────────────────────────────────────┘<br><br>1 row in set. Elapsed: 3.268 sec. Processed 3.78 billion rows, 30.26 GB (1.16 billion rows/s., 9.26 GB/s.)</pre><p>As you can see, there are a total of 3.78 billion rows inserted into ClickHouse via Timeplus. By comparing the minimal and maximal event timestamp, we can figure out the write throughput is approximately 3 million per seconds.</p><p>In Timeplus Enterprise 2.6, we enhanced the connection pooling and other mechanisms. The same SQL pipeline can achieve 3.6 million per second throughput. We can further tune the insert block size and batching strategies, and make it 2 times faster, i.e. 6 million rows per second.</p><pre>CREATE MATERIALIZED VIEW new_mv INTO ch_products_ext AS<br>SELECT i, j, _tp_time FROM rand_data <br>SETTINGS max_insert_block_size=130000, max_insert_block_bytes=102400, insert_block_timeout_ms = 1;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jINSmujVpAR_KIoQrzv3DQ.png" /></figure><h3>Improved Data Management</h3><p>In this release, you can add new columns to an existing stream using:</p><pre>ALTER STREAM stream_name ADD COLUMN column_name data_type</pre><p>You can also truncate the data in a stream without recreating it:</p><pre>TRUNCATE STREAM stream_name</pre><p>Timeplus Enterprise 2.6 also supports multiple database namespaces. You can organize your streams, materialized views, and other objects in different databases:</p><pre>CREATE DATABASE IF NOT EXISTS my_database;<br><br>USE my_database;<br><br>CREATE STREAM my_stream (raw string);<br><br>INSERT INTO my_stream(raw) VALUES (&#39;hello&#39;);<br><br>SELECT * FROM table(my_stream);<br>--if you are using other databases<br>SELECT * FROM table(my_database.my_stream);</pre><p>Last but not least, you can create a materialized view and use <a href="https://docs.timeplus.com/timeplus-external-stream">Timeplus External Stream</a> as the target. This allows you to continuously write data to a remote Timeplus Enterprise or Timeplus Proton after stream processing.</p><h3>UI Improvements</h3><p>We start seeing some of our customers create thousands of materialized views or ClickHouse External Tables. In this version, we added a shortcut to quickly access any objects in Timeplus. It’s Command + K on macOS and Control+K on PC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LBphQvFVO2NQBuoURRCGgQ.gif" /></figure><p>We have also taken feedback from our community and redesigned the SQL Console. The updated layout allows you to write longer SQL statements and quickly access to the stream schemas, common functions, query history, or bookmarks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zouOQwHzBu0eSo6Nq2koeg.gif" /></figure><p>We have also added new UI wizards for Coinbase and Apache Pulsar integration.</p><p>The demo data generator is now powered by the native <a href="https://docs.timeplus.com/sql-create-random-stream">Timeplus Random Stream</a>. You can customize the SQL to adjust the events-per-second or customize the data generation logic.</p><h3>Enhancement for Grafana Plugin for Timeplus</h3><p>Grafana has long been one of the most popular tools for real-time monitoring and data visualization, helping organizations track metrics and analyze trends through a single, user-friendly interface.</p><p>Today, along with the release of Timeplus Enterprise v2.6, we’re thrilled to announce the release of <a href="https://github.com/timeplus-io/proton-grafana-source">Timeplus Grafana Plugin v2.1</a>, with the following enhancements:</p><ul><li>Show the SQL syntax error and recommendations for next step in the Grafana panel</li><li>Updated the batching strategies to improve performance of rendering large amounts of results via streaming queries.</li><li>Support query variables, annotations and alerts.</li></ul><p>Jason Patterson, Director of Network Architecture at RocNet Supply, demonstrates how he uses the latest Grafana plugin to apply network streaming telemetry. <a href="https://youtu.be/j1GnkyNviYs?t=260">Watch the webinar recording</a> to learn more.</p><h3>Learn More</h3><p>To explore the capabilities of Timeplus Enterprise v2.6, please check out <a href="https://docs.timeplus.com/enterprise-v2.6">https://docs.timeplus.com/enterprise-v2.6</a> for installation guide as well as change logs.</p><p>Thank you for being a part of our journey. We look forward to your continued support and collaboration as we move towards a future powered by real-time streaming analytics.</p><p>Ready to try Timeplus Enterprise? <a href="https://timeplus.com/download">Try for free for 30-days</a>.</p><p>Join our Timeplus Community! Connect with other users or get support in our <a href="https://timeplus.com/slack">Slack community</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fa3edf0b315" width="1" height="1" alt=""><hr><p><a href="https://medium.com/www-timeplus-com/announcing-general-availability-of-timeplus-enterprise-v2-6-7fa3edf0b315">Announcing General Availability of Timeplus Enterprise v2.6</a> was originally published in <a href="https://medium.com/www-timeplus-com">Timeplus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Zyre Leverages Timeplus for Real-Time Blockchain Analytics at Scale]]></title>
            <link>https://medium.com/www-timeplus-com/customer-story-zyre-5f9758e480a4?source=rss-773d7bcfa681------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f9758e480a4</guid>
            <category><![CDATA[sql-database]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[ethereum-blockchain]]></category>
            <category><![CDATA[data-streaming-platform]]></category>
            <dc:creator><![CDATA[Jove Zhong]]></dc:creator>
            <pubDate>Fri, 21 Feb 2025 18:15:08 GMT</pubDate>
            <atom:updated>2025-02-21T18:15:08.310Z</atom:updated>
            <content:encoded><![CDATA[<p>The cryptocurrency ecosystem generates vast amounts of high-velocity, mutable data. From Ethereum’s 2.7 billion transactions since 2015 to Solana’s 500TB of data and sub-second block times, the challenges of ingesting, processing, and querying this data are immense. Fragmented tooling, latency in analytics, and the need for cost efficiency plague organizations trying to derive real-time insights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*C6Yfs67anEK1SWwyBbIxnw.png" /></figure><p>In this case study, we explore how Zyre, a leading cryptocurrency data platform leveraged Timeplus Enterprise to overcome these challenges. While the use case centers on blockchain data, the lessons learned apply broadly to industries dealing with high-cardinality, mutable data and real-time analytics demands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*WqqNgv5_FfuTYxDy0hyYPg.png" /><figcaption>Timeplus for Cyrpto Data Engineering</figcaption></figure><blockquote>We tried countless tools and rewrote our pipeline multiple times. Timeplus was the first solution that let us index the full Ethereum chain — and now, any chain — in real-time. It’s transformed how we deliver data to our customers.</blockquote><p>— <a href="https://x.com/iNcizzle">Mathew Haji</a>, Founder at Zyre</p><h3>Why Crypto Data Engineering Is Hard</h3><p>If you’re a data engineer, you’re probably comfortable handling high-velocity data, managing complex ETL pipelines, and scaling infrastructure to meet demand. But crypto data? That’s a whole different beast. Unlike traditional financial data, blockchain data is decentralized, high-cardinality, constantly mutating, and often needs to be analyzed in real-time. If you’ve ever worked with a high-throughput transactional system, so-called “web scale”, imagine that — but at “chain scale.”</p><p>To put things in perspective, the Ethereum Mainnet alone has processed over 2.7 billion transactions since 2015, with blocks being added every 12 seconds. Faster chains like Arbitrum (250ms block times) and upcoming networks like MegaETH (10ms block times) generate even more data. The sheer volume, combined with the complexity of blockchain state changes, presents unique technical challenges:</p><h4>1. High Cardinality and Scale</h4><p>Public blockchains generate an immense amount of structured event data. Every transaction, smart contract execution, and token transfer gets recorded permanently.</p><p>Consider this:</p><ul><li><strong>Ethereum Mainnet: </strong>2.7 billion transactions, 2 billion accounts, 2.5 billion transfers.</li><li><strong>Solana: </strong>500TB of core data with sub-second block times.</li><li><strong>Base &amp; Arbitrum:</strong> Blocks produced as fast as 250ms, leading to terabytes of data growth.</li></ul><p>Storing, indexing, and querying this data efficiently without breaking the bank is a significant challenge. A single chain can require petabytes of storage, and maintaining full historical datasets means ongoing infrastructure costs in the range of $4,000–$10,000 per month per chain on cloud providers (<a href="https://read.cryptodatabytes.com/p/2025-annual-guide-crypto-data-engineering">source</a>).</p><h3>2. Fast Data Mutation</h3><p>Blockchain data isn’t just large — it’s complex. It contains high-cardinality attributes such as wallet addresses, transaction hashes, and smart contract interactions, making indexing and querying expensive. On top of that, the data isn’t static:</p><ul><li><strong>Frequent Reorganizations (Reorgs):</strong> Blocks can be invalidated and replaced, requiring real-time corrections to previously written data.</li><li><strong>Backfills of Massive Datasets: </strong>Loading 8 billion+ rows (e.g., Ethereum’s historical data) in a reasonable timeframe (e.g., 12 hours) is non-trivial.</li><li><strong>Fast Mutations &amp; Event-Driven Updates:</strong> Blockchains are constantly updating. Handling 100ms block times means ingesting, mutating, and making data queryable instantly.</li></ul><p>Traditional OLAP databases struggle with this level of real-time mutation, making incremental processing essential.</p><h3>3. Real-Time Incremental Analytics, Without Full Recomputations</h3><p>Unlike batch ETL systems where data is transformed in predefined intervals, crypto data requires continuous, incremental updates. Some critical use cases include:</p><ul><li><strong>Tracking Real-Time Asset Balances:</strong> A user’s wallet balance must be recalculated every time a transaction occurs — potentially millions of times per day.</li><li><strong>Aggregating Market Data (OLHC):</strong> Crypto trading platforms need real-time price updates based on high-frequency swaps.</li><li><strong>Detecting Anomalies &amp; Fraud: </strong>Identifying suspicious transactions requires immediate insights across billions of historical records.Running full table recomputations every few minutes isn’t feasible, which is why a streaming-first approach is required.</li></ul><h3>4. High-Performance Queries, with Great Flexibility</h3><p>Crypto applications like Zyre rely on both point queries and large-scale analytical queries. Some common ones include:</p><ul><li>Fetching specific transactions or NFT balances instantly (e.g., user 0x4838…5f97).</li><li>Aggregating trading volumes for specific assets over different timeframes (e.g. over the last 7 days).</li><li>Analyzing wallet activity trends over time.</li></ul><p>With high-cardinality datasets and constant updates, these queries must be optimized for performance — without requiring full table scans.</p><h3>Why Existing Solutions Fell Short</h3><p>Solving these challenges requires a specialized approach to database architecture.</p><p>Zyre evaluated several tools before choosing Timeplus and found limitations:</p><p><strong>Apache Flink</strong></p><ul><li>Batch-oriented workflows couldn’t support real-time updates</li><li>Large footprint and high operational overhead</li></ul><p><strong>RisingWave</strong></p><ul><li>Using S3 as the primary storage is much slower than NVMe SSD</li><li>Since the S3 was too slow and also too expensive, the team had to deploy its own MinIO cluster to achieve higher throughput (100K EPS). MinIO introduced extra cost and maintenance effort</li><li>RisingWave was hours behind the message queues during backfills</li><li>Missing real-time queries with customizable SQL for alerting</li></ul><p><strong>ClickHouse</strong></p><ul><li>Struggled with fast point queries</li><li>Struggled with fast range queries</li><li>Inefficient data mutation and update</li><li>Lack of streaming computation and real-time emit</li></ul><h3>Timeplus: A Unified Real-Time Platform</h3><p>After exploring various solutions, the Zyre team found that existing options couldn’t fully address the unique challenges of crypto data engineering. Through close collaboration with the Timeplus team, they built an innovative solution that effectively tackles the four major challenges outlined above.</p><h3>1. Mutable Streams for High-Cardinality, Fast-Mutating Data</h3><p>Since EVM and other modern chains are general-purpose computing platforms, they support many different applications, each with its own event structure (to learn more about this, check out this episode of our Streaming Caffeine podcast: <a href="https://youtu.be/Wm7TwoMqN60?si=SK5xHOzwsVxLfvgM&amp;t=2461">Streaming Caffeine E3: With Yaroslav (Goldsky) and Jove (Timeplus)</a>, to hear insights from Yaroslav, then Principal Software Engineer at Goldsky, a leading crypto data platform)</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWm7TwoMqN60%3Fstart%3D2461%26feature%3Doembed%26start%3D2461&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWm7TwoMqN60&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWm7TwoMqN60%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/108b37c5ed56643ef223770b7e06fa05/href">https://medium.com/media/108b37c5ed56643ef223770b7e06fa05/href</a></iframe><p>These applications require custom indexers to extract meaningful insights from raw blockchain data. Once indexed, events need to be streamed into Timeplus, where downstream tables are updated seamlessly.</p><p>The following diagram illustrates the data flow of the real-time pipelines:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iGtjCibb35cMgDhTWuXG9w.png" /></figure><p>Timeplus allows real-time pipelines to be reused for historical data backfills and reflows, making it easier to handle indexing errors or schema changes. Each <a href="https://docs.timeplus.com/proton-create-view#m_view">Materialized View</a> acts as a real-time pipeline, with a <a href="https://www.timeplus.com/post/introducing-mutable-streams">Mutable Stream</a> as the pipeline output.</p><p>Supporting multiple chains is a significant challenge, especially when full-chain indexing can take weeks. Timeplus accelerates this process, enabling support for new chains in hours instead of weeks.</p><h3>2. Secondary Indexes on Mutable Streams for High-Performance and Flexible Queries</h3><p>Crypto data needs to be queried from multiple angles without duplicating data. Each mutable stream has 1 or more columns as the primary key, serving as the primary index. To improve the query performance, secondary indexes can be defined on other columns. This can optimize lookups for high-cardinality attributes, such as:</p><ul><li>Fetching all actions for a specific contract or asset over the last 7 days</li><li>Retrieving all actions from a specific user within a given timeframe</li><li>Looking up actions by unique ID</li><li>Querying actions that occurred in a specific transaction</li></ul><h3>3. Changelog-based Incremental Aggregation</h3><p>Full table recomputations are inefficient for mutable blockchain data. Timeplus’ materialized views enable incremental aggregation, allowing new insights to be derived from existing data. When data changes (e.g., due to chain reorgs), all dependent tables update automatically, ensuring consistency without expensive recomputation.</p><h4>4. Hybrid Aggregation Powered by Hybrid Hash Tables</h4><p>High-cardinality data often requires significant memory overhead. Timeplus’ hybrid hash table architecture flushes aggregations to disk as needed, reducing memory usage by over 60% and making backfilling more efficient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*MaYM1n9__-f0VO5PqMa5yg.png" /></figure><h3>10x Cost Efficiency, Onboard New Chains in Hours vs Weeks</h3><p>For the first time, the company successfully indexed the entire Ethereum chain — something previous solutions failed to achieve. The team can now onboard new blockchains like Base and Arbitrum in hours instead of weeks. The peak indexing throughput is 700K EPS, much better than 100K EPS with RisingWave. Query performance has improved dramatically, delivering sub-second point queries and range aggregations in under 0.1 seconds. Additionally, infrastructure costs have been reduced by 50%, eliminating the penalties associated with S3 requests while using half the server resources compared to their previous setup with RisingWave.</p><h3>It’s Not Just for Crypto</h3><p>While this case study focuses on crypto, the lessons apply to any domain with high-velocity, mutable data:</p><ol><li><strong>Real-Time Reactivity</strong>: Handle data mutations (e.g., IoT sensor corrections, fraud detection rollbacks) without batch delays.</li><li><strong>Unified Analytics</strong>: Replace fragmented OLAP + key-value systems with a single platform.</li><li><strong>Cost Efficiency</strong>: Optimized storage and compute reduce TCO for petabyte-scale datasets.</li></ol><p>Zyre’s success underscores Timeplus Enterprise’s ability to unify real-time ingestion, mutable data handling, and flexible querying at scale. As data volumes grow and latency tolerances shrink, streaming databases are no longer a luxury — they’re a necessity.</p><p>Ready to try Timeplus Enterprise? <a href="https://timeplus.com/download">Try for free for 30-days</a>.</p><p>Join our Timeplus Community! Connect with other users or get support in our <a href="https://timeplus.com/slack">Slack community</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f9758e480a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/www-timeplus-com/customer-story-zyre-5f9758e480a4">How Zyre Leverages Timeplus for Real-Time Blockchain Analytics at Scale</a> was originally published in <a href="https://medium.com/www-timeplus-com">Timeplus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analyze Irregularly Distributed Data Points Using Time-Weighted Functions In Timeplus]]></title>
            <link>https://medium.com/www-timeplus-com/time-weighted-functions-ec3f6936e963?source=rss-773d7bcfa681------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec3f6936e963</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[sensors]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[real-time-analytics]]></category>
            <dc:creator><![CDATA[Jove Zhong]]></dc:creator>
            <pubDate>Fri, 03 Jan 2025 23:48:48 GMT</pubDate>
            <atom:updated>2025-01-03T23:48:48.276Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine you’re tracking the temperature in your house throughout the day. Your smart thermostat could record the temperature every minute, generating 1,440 measurements daily. But does it need to? What if it only recorded when the temperature changed for 0.1 degree? This is the kind of real-world challenge we’ll explore, using a battery monitoring system as our example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*fk3eWrZbj4skI6ugnGVssQ.png" /></figure><p>In this blog, we’ll introduce Timeplus’ new time-weighted functions, which help solve a common problem in data analysis: how to accurately analyze measurements with a minimal amount of data points.</p><p>For visual learners, please check out the following video:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F2EbguG_3M98%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2EbguG_3M98&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2EbguG_3M98%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a490b5f1de88b0ad1b6305326178c68c/href">https://medium.com/media/a490b5f1de88b0ad1b6305326178c68c/href</a></iframe><p>Let’s say we’re monitoring a battery’s health and performance. We want to know:</p><ul><li>Most of the time, at what voltage this battery is delivering?</li><li>What’s the average, medium or p90 (over 90% of time)?</li></ul><p>To answer these questions, we need to track the battery’s voltage over time. In our example, we’ll look at how a battery’s voltage drops from 5 volts to 3 volts during an hour of use.</p><p>Here’s a snapshot of our data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwIcnJ6XZl6-b_Xm7Q3Hug.png" /></figure><p>The data points can be visualized as follows. Each delta for of the timestamp of the data are even.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-85rVGTTiWppRWcvr5NMBw.png" /></figure><h3>The Traditional Approach: Why It Falls Short</h3><p>The simplest way to collect this data would be to take measurements at fixed intervals. Think of it like checking your watch every minute to write down the battery’s voltage. To get the average voltage, simply sum all data points and divide by their total count.</p><p>But there’s a catch. Batteries don’t discharge at a constant rate. Sometimes the voltage drops quickly, other times it stays steady. If we want to catch every significant change, we’d need to measure very frequently — in our case, every 7 seconds. This gives us 859 measurements over an hour, with many redundant readings during stable periods.</p><p>It’s like taking a photo every second of a sunset. During the most dramatic moments, you’ll want those frequent shots. But when the sky isn’t changing much, you’re just filling up your camera’s memory with nearly identical pictures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*7TljCQulC1h3pLwRo6lisA.png" /></figure><h3>A Smarter Way: Measuring What Matters</h3><p>Modern battery systems are smarter. Instead of checking the voltage every few seconds, they only record when they detect a meaningful change. This is much more efficient — in our example, we only need 22 measurements instead of 859.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G95TWTgsXHzfwCPS8TyPIA.png" /></figure><p>But this creates a new challenge. If we simply average these 22 measurements, we’ll get the wrong answer. Why? Because this method treats each measurement as equally important, regardless of how long that voltage level lasted.</p><p>Think of it this way: If you spend 45 minutes at 4.2 volts and 15 minutes at 3.8 volts, a simple average would undervalue the time spent at the higher voltage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zc0ywu7PXsYxNmFYIgk3OQ.png" /></figure><h3>The Solution: Introducing Time-Weighted Functions</h3><p>This is where Timeplus’s time-weighted functions come in. Instead of treating each measurement equally, these functions consider how long each value lasted. It’s like weighing each measurement by its duration. In the language of Math, the formula of calculating average value is changed from a simple sum(v) / count(v) to a time-aware sum(v * t) / sum(t)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R0aJ_gaeTe0Q_JpKDH-Dpg.png" /></figure><p>We offer two functions:</p><ul><li>avg_time_weighted: Calculates a time-aware average</li><li>median_time_weighted: Finds the middle value, considering time weights</li></ul><p>Using these functions is straightforward. Here’s how you’d calculate the time-weighted average voltage:</p><pre>SELECT avg_time_weighted(voltage, timestamp)<br>FROM battery</pre><p>For the median:</p><pre>SELECT median_time_weighted(voltage, timestamp)<br>FROM battery</pre><p>Each function needs at least two pieces of information:</p><ol><li>What you’re measuring (in our case, voltage)</li><li>When each measurement was taken (timestamp)</li></ol><p>Optionally, you can add a third parameter to specify an end time for your analysis period. When you omit the third parameter, the calculation excludes the last value. If provided, the end time must match the timestamp column’s data type, and the function uses the difference between the last time point and this end time as the weight for the final value.</p><p>Here’s the outcome for our battery example, using avg_time_weighted:</p><pre>SELECT avg_time_weighted(voltage, timestamp)<br>FROM battery</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mj5RjMw95HpmOlx-Ge3gRQ.png" /></figure><p>Apparently, using the avg_time_weighted function yields a more reasonable outcome than using the avg function directly. We’ll use a diagram to better illustrate this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zjMnuvwES9Uu7Ns3zV84QQ.png" /></figure><p>Similarly, if we want to calculate the median of these voltage data points, we can use median_time_weighted as well:</p><pre>SELECT median_time_weighted(voltage, timestamp)<br>FROM battery</pre><h3>The Benefits</h3><p>This approach offers several advantages:</p><ul><li>More accurate analysis that reflects how long each value persisted</li><li>Reduced data storage needs — only store significant changes</li><li>Less network traffic when sending data</li><li>Faster processing of your measurements</li></ul><h3>Real-World Applications</h3><p>While we’ve focused on battery monitoring, time-weighted functions are valuable in many scenarios:</p><ul><li>Temperature monitoring in industrial processes</li><li>Network traffic analysis</li><li>Environmental sensor readings</li><li>Financial market data analysis</li><li>Energy consumption monitoring</li></ul><h3>Summary</h3><p>Time-weighted functions are available in Timeplus Proton 1.6.6. Ready to try them out with your own data? Download Proton from <a href="https://github.com/timeplus-io/proton">our GitHub repo</a> and start exploring how these functions can improve your data analysis.</p><p>Whether you’re working with IoT devices, monitoring systems, or any time-series data that changes irregularly, time-weighted functions can help you get more accurate insights while using fewer resources.</p><p>Ready to try Timeplus Enterprise? <a href="https://timeplus.com/download">Try for free for 30-days</a>.</p><p>Join our Timeplus Community! Connect with other users or get support in our <a href="https://timeplus.com/slack">Slack community</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec3f6936e963" width="1" height="1" alt=""><hr><p><a href="https://medium.com/www-timeplus-com/time-weighted-functions-ec3f6936e963">Analyze Irregularly Distributed Data Points Using Time-Weighted Functions In Timeplus</a> was originally published in <a href="https://medium.com/www-timeplus-com">Timeplus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing General Availability of Timeplus Enterprise v2.5]]></title>
            <link>https://medium.com/www-timeplus-com/announcing-general-availability-of-timeplus-enterprise-v2-5-62e9257f110b?source=rss-773d7bcfa681------2</link>
            <guid isPermaLink="false">https://medium.com/p/62e9257f110b</guid>
            <category><![CDATA[data-stream-processing]]></category>
            <category><![CDATA[apache-pulsar]]></category>
            <category><![CDATA[data-streaming]]></category>
            <category><![CDATA[kakfa]]></category>
            <category><![CDATA[apache-kafka]]></category>
            <dc:creator><![CDATA[Jove Zhong]]></dc:creator>
            <pubDate>Mon, 09 Dec 2024 20:59:48 GMT</pubDate>
            <atom:updated>2024-12-09T20:59:48.476Z</atom:updated>
            <content:encoded><![CDATA[<p>I am thrilled to announce that Timeplus Enterprise v2.5 is now Generally Available! This milestone marks a significant leap forward for our Timeplus Enterprise v2 which was released earlier this year. In this release, we pushed our unparalleled performance to a new level, natively integrated with Redpanda Connect and Apache Pulsar to access a rich ecosystem of enterprise and AI applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5nbBu93W7rmGVJZB7eKEzA.png" /></figure><p>Powered by our lightweight, powerful, and efficient single-binary platform, Timeplus Enterprise offers flexible deployment options. Whether fully managed in the public cloud, self-hosted in your data center, running on your laptop, or even on edge devices, our platform adapts to diverse user needs and unblocks massive use cases, from handling large-scale workloads to operating in resource-contained edge environments, capturing real-time insights where data resides. Most importantly, Timeplus Enterprise drives down operational efforts and costs down with simplicity.</p><p>Our software has been rigorously tested and proven in a variety of industries and mission-critical use cases, including cybersecurity, algorithm-based trading, and real-time streaming pipeline and analytics.</p><p>For example, a Fortune 1000 company has successfully deployed Timeplus Enterprise v2 in production since the beginning of 2024, addressing their critical trading use cases that demand efficient, reliable and scalable streaming analytics. The use case runs 300+ continuous queries on raw incoming data of 100,000 messages per second with peaks lasting 5 hours.</p><p>Today, we are excited to upgrade our offerings with the release of Timeplus Enterprise v2.5. This unified, enterprise-grade product is available through our fully managed cloud service or can be installed on various infrastructures, including bare metal, Docker, and Kubernetes.</p><h3>Key Breakthroughs in Timeplus Enterprise v2.5</h3><p>The v2.5 release of Timeplus Enterprise introduces several groundbreaking features:</p><ul><li>Materialized Views Auto-Rebalancing</li><li>Performance Improvements</li><li>Enterprise-Grade Real-Time Data Integration with 200+ Connectors from Redpanda Connect</li><li>Pulsar External Stream to query or process data in Pulsar with SQL</li></ul><h3>Materialized Views Auto-Rebalancing</h3><p>Materialized views are key building blocks in Timeplus Enterprise, which continuously execute the streaming SQL queries in the background and “materialize” the results physically to the internal storage of the materialized view. These materialized views can be queried as tables via other SQL queries or serve as data sources for other materialized views.​</p><p>Alternatively, you can configure a target stream for the materialized view. The target can be an append-only stream in Timeplus, or a <a href="https://www.timeplus.com/post/introducing-mutable-streams">Mutable Stream</a> for UPSERT and fast OLAP queries, or an External Stream for writing data to Apache Kafka, Apache Pulsar, or <a href="https://www.timeplus.com/post/proton-clickhouse-integration">an External Table to write data to ClickHouse</a>. By utilizing this feature, materialized views act as intermediaries between upstream sources and downstream sources.</p><p>To learn more about the difference between Timeplus materialized views and ClickHouse materialized views, please refer to <a href="https://www.timeplus.com/timeplus-and-clickhouse">https://www.timeplus.com/timeplus-and-clickhouse</a>.</p><p>It’s common practice to define numerous materialized views in Timeplus for various computation and analysis. Some materialized views can be resource-intensive, requiring significant memory or CPU resources. In a cluster of Timeplus Enterprise with multiple nodes, each materialized view is executed on a single node, as all data is replicated across the cluster. Ideally, the workload distribution among nodes should be balanced, based on the CPU or memory consumption rather than the number of materialized views.</p><h4>Manual Load Balancing</h4><p>Since the release of Timeplus Enterprise v2.3, it has been possible to configure a materialized view with the optional memory_weight setting. This setting allows for memory-intensive materialized views to be prioritized on specific nodes within a cluster. For example:</p><pre>CREATE MATERIALIZED VIEW my_mv<br>SETTINGS memory_weight = 10<br>AS SELECT ..</pre><p>When a Timeplus cluster is initiated, materialized views are automatically scheduled to different nodes based on the user-defined memory_weight. This ensures that each node in the cluster experiences similar memory pressures, regardless of the number of materialized views running on it.</p><p>This mechanism effectively addresses customer requirements. However, setting the appropriate memory_weight can be challenging due to the complexity of materialized view queries, which may contain multiple subqueries and various SQL functions. Accurately estimating memory usage for each materialized view can be difficult. Consequently, most customers categorize their materialized views into light queries and heavy queries. They then assign the same memory_weight to materialized views within the same category.</p><h4>Auto Load Balancing</h4><p>Now in the Timeplus Enterprise v2.5, we have introduced auto-load-balancing for materialized views. This feature eliminates the guess work and ensures optimal resource utilization.</p><p>Within a cluster, Timeplus Enterprise monitors the memory consumption for each materialized view. Every 30 seconds (configurable via workload_rebalance_check_interval), the system checks whether there are any nodes with memory over 50% full. If such a node exists, Timeplus further checks if any materialized view on that node consumes 10% or more of its memory (configurable). When these conditions are met, Timeplus reschedules the materialized views to less busy nodes. During the rescheduling process, the materialized view on the previous node is paused, and its checkpoint is transferred to the target node. Subsequently, the materialized view on the target node resumes streaming SQL based on the checkpoint.</p><p>By default, auto-load balancing is enabled in Timeplus Enterprise, which significantly reduces maintenance efforts and enhances overall system efficiency. For further details, please refer to <a href="https://docs.timeplus.com/proton-create-view#auto-balancing">the documentation</a>.</p><h3>Performance Improvements</h3><p>In this release, we pushed our unparalleled performance to a new level.</p><p>For the <a href="https://docs.timeplus.com/ingest-api">Ingest REST API</a>, the new version of Timeplus Enterprise is up to 2x faster than the previous version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cYGyp2RsjnLRAZEI-6Gx-g.png" /><figcaption><strong>Ingestion Throughput in MB/s: The Higher, the Better</strong></figcaption></figure><p><em>Note: some tests failed in v2.4, such as 32 concurrent threads with 1024 records as the batch size</em></p><p>Another example is the <a href="https://docs.timeplus.com/query-syntax#emit_on_update">EMIT ON UPDATE</a> query processing, which generates stream processing results whenever the aggregation values are modified. In Timeplus Enterprise v2.5, we introduced a novel data structure and algorithm to attain a 0.1 millisecond end-to-end latency, even with 100 million unique keys. Previously, this process could take 8 milliseconds (for 1 million keys), 95 milliseconds (for 10 million keys), or 0.9 second (for 100 million keys).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mg3UK407LtDvG7LHrYYBkw.png" /><figcaption><strong>E2E Latency in μs: The Shorter, the Better</strong></figcaption></figure><p><em>Note: the y-axis scale is logarithmic, not linear</em></p><h3>Enterprise-Grade Real-Time Data Integration with 200+ Connectors from Redpanda</h3><p>Timeplus Enterprise now embeds Redpanda Connect with over 200+ connectors into its platform, dramatically expanding our customers’ ability to integrate streaming data across their entire technology stack and extract valuable insight while the data is fresh.</p><p>The partnership of Timeplus and Redpanda addresses the challenges of real-time data integration by:</p><ul><li><strong>Streamlining the development process with Redpanda Connect</strong>, a battle tested standardized connectivity framework while letting Timeplus Connector manage the lifecycle, recovery, and checkpointing of Redpanda Connect pipelines progress along with Timeplus streams</li><li><strong>Providing instant access to 200+ pre-built connectors</strong> for numerous data sources and destinations (e.g. Websocket, PostgreSQL, NATS, Amazon S3, Amazon SQS, Azure Blob Storage)</li><li><strong>Exposing flexible connector configuration APIs</strong> (via the versatile Bloblang DSL) allowing for customization of things like headers, authentication, and lightweight transforms</li><li><strong>Enabling rapid transformation</strong> (stateless or stateful) of data via Timeplus for consumption by popular enterprise systems, databases, cloud services, and alerting systems</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZrLsqudKaMo4Kc2BpLHFQ.png" /><figcaption>Timeplus Enterprise and Redpanda Connect</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2LoL-5BFVgSr5e2vQFsZVg.gif" /><figcaption>Redpanda Connect in Timeplus Enterprise</figcaption></figure><p>Timeplus also contributed back Timeplus connectors to the open source ecosystem for Redpanda Connect standalone users to integrate with Timeplus Enterprise or the open source Timeplus Proton.</p><p>Learn more about this in our blog: <a href="https://www.timeplus.com/post/timeplus-and-redpanda-connect">https://www.timeplus.com/post/timeplus-and-redpanda-connect</a></p><h3>Reading or writing data in Apache Pulsar or StreamNative via External Stream</h3><p>Congratulations to the Apache Pulsar community for the 4.0 LTS(Long-Term-Support) release recently. We’re thrilled to announce that in Timeplus Enterprise v2.5, a new type of External Stream is implemented in our C++ core engine. With a single binary, developers can read millions of events in Pulsar each second with streaming SQL, or write data to Pulsar topics in JSON, CSV, Protobuf or Avro format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zYwRvgZ1IsRz6q8bTMt11A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GkNVn4u7qAu1YY1-1jqqew.gif" /><figcaption>Pulsar integration in Timeplus Enterprise</figcaption></figure><p>Learn more about this in our blog: <a href="https://www.timeplus.com/post/introducing-pulsar-external-stream">https://www.timeplus.com/post/introducing-pulsar-external-stream</a></p><h3>Grafana Plugin for Timeplus is Production Ready</h3><p>Grafana has long been one of the most popular tools for real-time monitoring and data visualization, helping organizations track metrics and analyze trends through a single, user-friendly interface. In October 2023, we launched the first version of the <a href="https://github.com/timeplus-io/proton-grafana-source">Timeplus Grafana Plugin</a> — one of the pioneering <a href="https://grafana.com/developers/plugin-tools/tutorials/build-a-streaming-data-source-plugin">streaming data sources</a> in the Grafana ecosystem. This plugin was designed to leverage Grafana’s new <a href="https://grafana.com/docs/grafana/latest/setup-grafana/set-up-grafana-live/">Grafana Live</a> capability, allowing users to keep their SQL query results up-to-date without the need to refresh their dashboards. We received highly positive feedback, with users highlighting the plugin’s ease of integration and the unique value of real-time streaming insights within Grafana.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VPzxb9JaKE1XT5WzYtkEHg.gif" /></figure><p>Today, together with the release of Timeplus Enterprise v2.5, we’re thrilled to announce the release of Timeplus Grafana Plugin v2.0, which is production ready. It’s available now on <a href="https://github.com/timeplus-io/proton-grafana-source">our GitHub repository</a>. This latest version introduces significant improvements in both performance and stability. Whether you’re using Timeplus Enterprise or the open-source Timeplus Proton, this plugin allows you to seamlessly monitor real-time data through Grafana, utilizing both simple and complex analytics to track live data trends.</p><h3>Learn More</h3><p>To explore the capabilities of Timeplus Enterprise v2.5, please check out <a href="https://docs.timeplus.com/enterprise-v2.5">https://docs.timeplus.com/enterprise-v2.5</a> for installation guide as well as change logs.</p><p>Thank you for being a part of our journey. We look forward to your continued support and collaboration as we move towards a future powered by real-time streaming analytics.</p><p>Ready to try Timeplus Enterprise? <a href="https://timeplus.com/download">Try for free for 30-days</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62e9257f110b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/www-timeplus-com/announcing-general-availability-of-timeplus-enterprise-v2-5-62e9257f110b">Announcing General Availability of Timeplus Enterprise v2.5</a> was originally published in <a href="https://medium.com/www-timeplus-com">Timeplus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Query and Process Pulsar data with SQL: Introducing Pulsar External Stream]]></title>
            <link>https://medium.com/www-timeplus-com/query-and-process-pulsar-data-with-sql-introducing-pulsar-external-stream-77ae3352c14a?source=rss-773d7bcfa681------2</link>
            <guid isPermaLink="false">https://medium.com/p/77ae3352c14a</guid>
            <category><![CDATA[data-streaming]]></category>
            <category><![CDATA[pulsar]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[streaming-sql]]></category>
            <category><![CDATA[kafka-streams]]></category>
            <dc:creator><![CDATA[Jove Zhong]]></dc:creator>
            <pubDate>Thu, 05 Dec 2024 16:06:51 GMT</pubDate>
            <atom:updated>2024-12-05T16:06:51.859Z</atom:updated>
            <content:encoded><![CDATA[<p>Congratulations to the Apache Pulsar community on their recent <a href="https://pulsar.apache.org/blog/2024/10/24/announcing-apache-pulsar-4-0/">4.0 LTS</a> (Long-Term-Support) release! At Timeplus, we’re thrilled to announce that in Timeplus Enterprise v2.5, a new type of External Stream is implemented in our C++ core timeplusd engine. With a single binary, developers can read millions of events from Pulsar each second with streaming SQL, or write data to Pulsar topics in JSON, CSV, Protobuf, or Avro format.</p><p>Apache Pulsar is a multi-tenant, high-performance solution for server-to-server messaging. Originally developed by Yahoo, Pulsar is under the stewardship of the Apache Software Foundation.</p><p>Both Apache Kafka and Apache Pulsar are popular event streaming platforms. Compared to Apache Kafka, the key differences:</p><ul><li>Native support for multiple clusters in a Pulsar instance, with seamless geo-replication of messages across clusters.</li><li>Very low end-to-end latency.</li><li>Seamless scalability to over a million topics.</li><li>Multiple subscription types (exclusive, shared, and failover) for topics.</li><li>Guaranteed message delivery with persistent message storage provided by Apache BookKeeper.</li><li>Tiered Storage offloads data from hot/warm storage to cold/long-term storage (such as S3 and GCS) when the data is aging out.</li><li>Different queuing semantics other than simple append-only log.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*eMREfZo4hIO1ZZf2Fc5dYw.png" /></figure><p>Over 2 years ago, Timeplus added<a href="https://www.timeplus.com/post/pulsar"> the integration for Apache Pulsar</a>. We built a rich UI for users to easily setup connections to Apache Pulsar or StreamNative Cloud, preview messages and load them into Timeplus streams, then run streaming SQL. This integration was done via Redpanda Connect, formerly known as Benthos framework.</p><p>In Timeplus Enterprise v2.5, the new <a href="https://docs.timeplus.com/pulsar-external-stream">Pulsar External Stream</a> is available in the core engine, without any dependencies. By leveraging the <a href="https://pulsar.apache.org/docs/next/client-libraries-cpp/">Pulsar C++ Client</a>, Timeplus Core Engine (timeplusd) can interact with the Pulsar server at high performance and low latency. The External Stream feature of Timeplus also has the added bonus that it does not copy the full stream to Timeplus and only brings in the relevant data as needed by transformations and aggregations. This saves on latency as well as storage costs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GkNVn4u7qAu1YY1-1jqqew.gif" /></figure><h3>Why Timeplus + Pulsar ?</h3><p>For data teams who are using Apache Pulsar or StreamNative Cloud, choosing Timeplus Enterprise makes exploring real-time data in Pulsar easy and intuitive:</p><ul><li><strong>Rich web UI.</strong> No need to write Java code to connect to the Pulsar clusters or use command line interface to preview the raw messages. Your data team can use the Timeplus web UI to quickly load data from Pulsar to Timeplus, then use the purpose-built streaming tables and charts in Timeplus to view live data and understand their patterns.</li><li><strong>Powerful streaming analytics with SQL.</strong> Apache Flink can be a powerful and flexible tool; however, when building real-time analytics applications, it’s oftentimes not easy to integrate Apache Pulsar and Apache Flink. With Timeplus, a similar analytics workload can be implemented using just one-tenth of the time and cost. For example, a new hopping window analytics app with FlinkSQL may take upwards of 1–2 minutes while the Flink job submits and waits to return results. Writing and uploading Java libraries is also another added overhead with managing dependencies and vulnerability patching. In the Timeplus web UI, you can write ad-hoc streaming SQL, and get results in the next second, creating a seamless, fast experience. This also has the added benefit of not needing additional code packages to be uploaded and managed against the running cluster.</li><li><strong>Full SQL-based routing/transformation/alerting.</strong> With Pulsar as a natively supported external stream type in Timeplus, your data engineering team can use Timeplus as the tool to transform data among Pulsar topics, or migrate data from one message bus to another. Compared to the <a href="https://docs.streamnative.io/docs/pfsql-overview">pfSQL</a>, a new feature in StreamNative cloud for public preview, the streaming SQL in Timeplus supports Multi-JOINs, UDF, high-cardinality GROUP BY, and many other features.</li><li><strong>Queryable Materialized Views. </strong>Any intermediate or final transformations done within Timeplus produces queryable materialized views that are available for querying from your applications like normal database/data warehouse tables.</li></ul><p>Additional use cases for the Timeplus and Pulsar integration:</p><ul><li><strong>Internet-of-Things (IoT):</strong> ​​The explosive growth of connected remote devices is posing challenges for the centralized computing paradigm. Pulsar is cloud-native and can run in any cloud, on-premises, or Kubernetes environment. It supports multiple messaging protocols, including MQTT, AMQP, and JMS. By connecting Timeplus with Pulsar, the real-time data from IoT sensors can be easily processed with sub-second latency. Real-time visibility can be provided to the internal/external users to improve operational efficiency or customer satisfaction.</li><li><strong>Application monitoring and observability. </strong>With Pulsar’s built-in multi-tenant support, tier-storage, and the separation of computing and storage, it’s one of the most common tools to consolidate logs/metrics/tracing from various IT systems and applications. Timeplus provides a unified storage and processing engine for both historical and real-time data. With our high performance, low latency, and purpose-built streaming charts and alerts, your IT infrastructure team can gain real-time observability with much lower complexity and cost-of-ownership.</li></ul><p>Check out the short demo video for the new Pulsar integration in Timeplus:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHkyQjWaJCNQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHkyQjWaJCNQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FHkyQjWaJCNQ%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/09efd0e139bba7ecc00252e7fbbcf0ab/href">https://medium.com/media/09efd0e139bba7ecc00252e7fbbcf0ab/href</a></iframe><p>For more technical details, please check our documentation: <a href="https://docs.timeplus.com/pulsar-external-stream">https://docs.timeplus.com/pulsar-external-stream</a></p><p>Here’s how you can load your Pulsar data into Timeplus:</p><p>Select “Apache Pulsar” on the Data Collection page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F1O6SetoiU1RqYZzuzw7pg.png" /></figure><p>Enter the service URL, API key, and optionally enable any additional settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eUi4IHefgFHQNZ0Nqw3J7Q.png" /></figure><p>Choose your Pulsar topic and data format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*og-bWP5UAjePwlQWUPStvA.png" /></figure><p>Preview your data and confirm schema.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LRZ5DSsw7N5J5cewfDUMXw.png" /></figure><p>Enter a name for the external stream and take a look at the SQL to create it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jc7U9G6EfXyJBZgEZmYWMA.png" /></figure><p>This UI wizard will help you create a Pulsar external stream with SQL DDL in the following syntax. You can also customize the parameters in the SQL Console.</p><pre>CREATE EXTERNAL STREAM [IF NOT EXISTS] stream_name<br>    (&lt;col_name1&gt; &lt;col_type&gt;)<br>SETTINGS<br>    type=&#39;pulsar&#39;, -- required<br>    service_url=&#39;pulsar://host:port&#39;, -- required<br>    topic=&#39;..&#39;, -- required<br>    jwt=&#39;..&#39;,<br>    data_format=&#39;..&#39;,<br>    format_schema=&#39;..&#39;,<br>    one_message_per_row=..,<br>    skip_server_cert_check=..,<br>    validate_hostname=..,<br>    ca_cert=&#39;..&#39;,<br>    client_cert=&#39;..&#39;,<br>    client_key=&#39;..&#39;,<br>    connections_per_broker=..,<br>    memory_limit=..,<br>    io_threads=..</pre><p>Once the external stream is created, you can query it in SQL Console via our REST or SDK:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Veb-DN-3U4dfpPn5XCPgng.png" /></figure><p>Depending on the network connectivity between Timeplus and Pulsar servers, as well as number of partitions and other factors, you can use Timeplus to scan existing messages in the Pulsar topic. This can be helpful for “backtesting” while building trading algorithms. For example, with a single partition in StreamNative cloud, from my laptop, it can read data at tens of thousands per second.</p><pre>select count() from pulsar_ext_stream where _tp_time&gt;earliest_ts() EMIT PERIODIC 5s<br><br>┌─count()─┐<br>│   57900 │<br>└─────────┘<br>┌─count()─┐<br>│  114200 │<br>└─────────┘<br>↖ Progress: 155.40 thousand rows, 1.24 MB (10.79 thousand rows/s., 86.29 KB/s.) </pre><p>Want to learn how Timeplus can help you get powerful real-time insights with minimal set-up time? <a href="https://timeplus.com/download">Try Timeplus Enterprise for free for 30-days</a>.</p><p>Join our Timeplus Community! Connect with other users or get support in our <a href="https://timeplus.com/slack">Slack community</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77ae3352c14a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/www-timeplus-com/query-and-process-pulsar-data-with-sql-introducing-pulsar-external-stream-77ae3352c14a">Query and Process Pulsar data with SQL: Introducing Pulsar External Stream</a> was originally published in <a href="https://medium.com/www-timeplus-com">Timeplus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automate data streaming with TestContainers, Native Kafka and Timeplus]]></title>
            <link>https://medium.com/www-timeplus-com/automate-data-streaming-with-testcontainers-native-kafka-and-timeplus-eb8709bdfef2?source=rss-773d7bcfa681------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb8709bdfef2</guid>
            <category><![CDATA[testcontainer]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[data-streaming]]></category>
            <dc:creator><![CDATA[Jove Zhong]]></dc:creator>
            <pubDate>Fri, 11 Oct 2024 01:45:45 GMT</pubDate>
            <atom:updated>2024-10-11T01:45:45.518Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://github.com/testcontainers/testcontainers-java">Testcontainers</a> is a Java library that supports <a href="https://junit.org/">JUnit</a> tests, providing lightweight, throwaway instances of common databases (including Timeplus), message brokers, or anything else that can run in a Docker container. You don’t need to write docker-compose files, or call the Docker API, or mock the infrastructure by yourself. Simply run your test code, containers will be created and deleted automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VQJJFd2T1VAivLe_BkwlRg.png" /></figure><p>You can run any Docker images in Testcontainers. But starting from <a href="https://github.com/testcontainers/testcontainers-java/releases/tag/1.20.2">Testcontainers v1.20.2</a>, Timeplus module is supported out of the box. You can start an instance of Timeplus via:</p><pre>TimeplusContainer timeplus = new TimeplusContainer(&quot;timeplus/timeplusd:2.3.31&quot;;)<br>timeplus.start();</pre><p>Compared to a <a href="https://java.testcontainers.org/features/creating_container/">GenericContainer</a>, you can call various methods on <a href="https://github.com/testcontainers/testcontainers-java/blob/main/modules/timeplus/src/main/java/org/testcontainers/timeplus/TimeplusContainer.java">TimeplusContainer</a>, such as setting the username, password, or run SQL queries with the default JDBC driver.</p><p>In this tutorial, we will walk through how to setup Apache Kafka and Timeplus via Testcontainers for Java, create a few Kafka topics, generate data, and apply streaming ETL and routing, and finally tear down the services. With <a href="https://hub.docker.com/r/apache/kafka-native">the GraalVM based native Kafka image</a> and C++ based Timeplus, all of these operations can be done within 4 to 5 seconds.</p><p>The source code of the tutorial is available at <a href="https://github.com/timeplus-io/examples/tree/main/testcontainers">GitHub</a>. The data generator and demo scenario are inspired by Confluent’s blog: <a href="https://developer.confluent.io/confluent-tutorials/kafka-native-testcontainers/kafka/">How to integration test a Kafka application with a native (non-JVM) Kafka binary with Testcontainers</a>.</p><h3>Set up the dependencies<a href="https://docs.timeplus.com/tutorial-testcontainers-java#set-up-the-dependencies">​</a></h3><p>We will be using <a href="https://gradle.org/">Gradle</a>, a popular open source build system for Java ecosystems. In the build.gradle file, we load the required dependencies, namly:</p><pre>dependencies {<br>    implementation &#39;org.apache.kafka:kafka-clients:3.8.0&#39;<br>    testImplementation &#39;org.testcontainers:kafka:1.20.2&#39;<br>    testImplementation &#39;org.testcontainers:timeplus:1.20.2&#39;<br>    testRuntimeOnly &#39;com.timeplus:timeplus-native-jdbc:2.0.4&#39;<br>}</pre><p>Please load 1.20.2 or newer version of Testcontainers Kafka and Timeplus modules. If you need to run SQL to query Timeplus in your test code, please load the Timeplus JDBC driver via com.timeplus:timeplus-native-jdbc:2.0.4 .</p><h3>Write test code<a href="https://docs.timeplus.com/tutorial-testcontainers-java#write-test-code">​</a></h3><p>You don’t need to write any code in the src/main/java folder since this tutorial only focuses on test automation. Create a Java source code under src/test/java folder, and use org.junit.jupiter.api.Test annotation to mark one function as a test case.</p><pre>package com.timeplus.examples;<br><br>import org.junit.jupiter.api.Test;<br><br>public class KafkaPrimalityRouterTest {<br>    @Test<br>    public void testPrimalityRouter() {<br>        ..<br>    }</pre><h3>Start the Kafka container<a href="https://docs.timeplus.com/tutorial-testcontainers-java#start-the-kafka-container">​</a></h3><p>As one of the best practices, you can start the Kafka test container in a try block, so that the container will be teared down automatically.</p><pre>@Test<br>    public void testPrimalityRouter() {<br>        try (<br>            Network network = Network.newNetwork();<br>            KafkaContainer kafka = new KafkaContainer(<br>                &quot;apache/kafka-native:3.8.0&quot;<br>            )<br>                .withListener(&quot;kafka:19092&quot;)<br>                .withNetwork(network);<br>        ) {<br>            // Step 1: start Apache Kafka (we will start Timeplus container when data is ready)<br>            kafka.start();</pre><p>Please note, we create a network object and set a listener for the Kafka broker, so that our Timeplus instance can access to the Kafka broker without hardcoding the IP address.</p><h3>Create Kafka topics<a href="https://docs.timeplus.com/tutorial-testcontainers-java#create-kafka-topics">​</a></h3><p>We will be using multiple Kafka topics. One topic for the input, literally input-topic . If the number is a prime, put it in the primes topic. If the number is not a prime, put it in the composites topic. If the data is not a number, which is not supposed to happen, put the data in the dlq topic (Dead Letter Queue), which is a common practice to handle dirty data or retries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/1*GR-EuJq2YVckRIrRlcQXtw.png" /></figure><p>There could be many ways to create Kafka topics, such as using Shell command or using tools like kcat. Since we are writing Java code, the easiest solution will be using Kafka AdminClient to create the topics programmatically.</p><pre>            // Step 2: create topics<br>            try (<br>                var admin = AdminClient.create(<br>                    Map.of(<br>                        AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG,<br>                        kafka.getBootstrapServers()<br>                    )<br>                )<br>            ) {<br>                admin.createTopics(<br>                    List.of(<br>                        new NewTopic(INPUT_TOPIC, 1, (short) 1),<br>                        new NewTopic(PRIME_TOPIC, 1, (short) 1),<br>                        new NewTopic(COMPOSITE_TOPIC, 1, (short) 1),<br>                        new NewTopic(DLQ_TOPIC, 1, (short) 1)<br>                    )<br>                );<br>            }</pre><p>Since we are running the Kafka broker without authentication, you can retrieve the bootstrap URLs with Testcontainers kafka.getBootstrapServers() method, then use AdminClient to create 4 topics with 1 partition and 1 replica.</p><h3>Put 1..100 to the input topic<a href="https://docs.timeplus.com/tutorial-testcontainers-java#put-1100-to-the-input-topic">​</a></h3><p>For the happy path testing, we will generate numbers from 1 to 100 to the input topic.</p><pre>            // Step 3.1: produce 100 ints that should go to prime / composite topics<br>            try (<br>                final Producer&lt;Integer, Integer&gt; producer = buildProducer(<br>                    kafka.getBootstrapServers(),<br>                    StringSerializer.class<br>                )<br>            ) {<br>                for (int i = 1; i &lt;= 100; i++) {<br>                    ProducerRecord record = new ProducerRecord&lt;&gt;(<br>                        INPUT_TOPIC,<br>                        &quot;&quot; + i,<br>                        &quot;&quot; + i<br>                    );<br>                    producer.send(record);<br>                }<br>            }<br>            ...<br>    protected static Producer buildProducer(<br>        String bootstrapServers,<br>        Class serializerClass<br>    ) {<br>        final Properties producerProps = new Properties() {<br>            {<br>                put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);<br>                put(<br>                    ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,<br>                    serializerClass<br>                );<br>                put(<br>                    ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,<br>                    serializerClass<br>                );<br>            }<br>        };<br>   return new KafkaProducer(producerProps);<br>   }</pre><p>The number will be saved as a string as both key and value for the Kafka message.</p><h3>Put a dirty message in the input topic<a href="https://docs.timeplus.com/tutorial-testcontainers-java#put-a-dirty-message-in-the-input-topic">​</a></h3><p>We will also put our favorite hello world string in the input topic to test our error handling.</p><pre>            // Step 3.2: produce strings to test DLQ routing<br>            try (<br>                final Producer&lt;String, String&gt; producer = buildProducer(<br>                    kafka.getBootstrapServers(),<br>                    StringSerializer.class<br>                )<br>            ) {<br>                ProducerRecord record = new ProducerRecord&lt;&gt;(<br>                    INPUT_TOPIC,<br>                    &quot;hello&quot;,<br>                    &quot;world&quot;<br>                );<br>                producer.send(record);<br>            }</pre><h3>Start Timeplus container<a href="https://docs.timeplus.com/tutorial-testcontainers-java#start-timeplus-container">​</a></h3><p>Now let’s start the Timeplus container to process the data and validate the data pipeline.</p><pre>            // Step 4: start Timeplus container and run init.sql to create ETL pipelines<br>            TimeplusContainer timeplus = new TimeplusContainer(<br>                &quot;timeplus/timeplusd:2.3.31&quot;<br>            )<br>                .withNetwork(network)<br>                .withInitScript(&quot;init.sql&quot;); // inside src/test/resources<br>            timeplus.start();</pre><p>Please note</p><ol><li>timeplus/timeplusd:2.3.31 is the latest build as the time of writing. Feel free to change it to a newer version, if available.</li><li>We attach the same network to the Timeplus container, so that they can access to each other.</li><li>withInitScript method is called to setup Timeplus</li></ol><h3>Define stream processing logic in Timeplus<a href="https://docs.timeplus.com/tutorial-testcontainers-java#define-stream-processing-logic-in-timeplus">​</a></h3><p>We will create a init.sql file under src/test/resources, so that the file is available at runtime classpath.</p><h4>Create Kafka external streams<a href="https://docs.timeplus.com/tutorial-testcontainers-java#create-kafka-external-streams">​</a></h4><p>First we will create 4 <a href="https://docs.timeplus.com/proton-kafka">Kafka External Streams</a> so that we can read data and write data.</p><pre>CREATE EXTERNAL STREAM input(raw string)<br>SETTINGS type=&#39;kafka&#39;, brokers=&#39;kafka:19092&#39;,topic=&#39;input-topic&#39;;<br>CREATE EXTERNAL STREAM primes(raw string,_tp_message_key string default raw)<br>SETTINGS type=&#39;kafka&#39;, brokers=&#39;kafka:19092&#39;,topic=&#39;primes&#39;;<br>CREATE EXTERNAL STREAM composites(raw string,_tp_message_key string default raw)<br>SETTINGS type=&#39;kafka&#39;, brokers=&#39;kafka:19092&#39;,topic=&#39;composites&#39;;<br>CREATE EXTERNAL STREAM dlq(raw string)<br>SETTINGS type=&#39;kafka&#39;, brokers=&#39;kafka:19092&#39;,topic=&#39;dlq&#39;;</pre><p>Please note:</p><ol><li>brokers are set to &#39;kafka:19092&#39;, since Kafka and Timeplus containers are running in the same docker network.</li><li>Kafka External Stream in Timeplus is bi-directional. You can read Kafka data by SELECT.. FROM or write data to Kafka via INSERT INTO or Materialized View target stream.</li><li>For primes and composites external streams, we also defined the <a href="https://docs.timeplus.com/proton-kafka#_tp_message_key">_tp_message_key</a> virtual column to write the message key. The default key value is set to the message value.</li></ol><h4>Create a JavaScript UDF to check prime numbers<a href="https://docs.timeplus.com/tutorial-testcontainers-java#create-a-javascript-udf-to-check-prime-numbers">​</a></h4><p>There is no built-in SQL functions to determine whether a number is a prime or not. This can be done via defining a <a href="https://docs.timeplus.com/js-udf">JavaScript UDF</a> in Timeplus, as following:</p><pre>CREATE FUNCTION is_prime(values int8)<br>RETURNS bool<br>LANGUAGE JAVASCRIPT AS $$<br>    function _check_prime(num, limit){<br>        for (let start = 3; start &lt;= limit; start += 2) {<br>            if (0 === num % start) {<br>                return false;<br>            }<br>        }<br>        return num &gt; 1;<br>    };<br>    function is_prime(values) {<br>        var bools=[]<br>        for(let i=0;i&lt;values.length;i++) {<br>            var number=values[i];<br>            bools.push(number === 2 || number % 2 !== 0 &amp;&amp; _check_prime(number, Math.sqrt(number)));<br>        }<br>        return bools;<br>    }<br>$$;</pre><p>Please note:</p><ol><li>the input type is a int8 or a small int, since our test data will be from 1 to 100.</li><li>the return type is a bool, either true or false</li><li>To improve performance, Timeplus will batch the input values. That’s why in the is_prime method, the values is an array of int8. You can check whether they are prime and put the result as an array of bool.</li><li>The algorithm of how to check the prime is based on <a href="https://stackoverflow.com/questions/17389350/detecting-prime-numbers-in-javascript">the discussion on stackoverflow</a></li></ol><h4>Create materialized views to process data<a href="https://docs.timeplus.com/tutorial-testcontainers-java#create-materialized-views-to-process-data">​</a></h4><p>Materialized Views in Timeplus are long-running queries. It leverage the full power of streaming SQL reading from any number of sources, versus just acting on the block of data inserted into a source ClickHouse table.</p><p>Fist let’s handle the case if the input value is not a number, this can be done via the following SQL:</p><pre>CREATE MATERIALIZED VIEW mv_dlq INTO dlq AS<br>SELECT raw FROM input WHERE _tp_time&gt;earliest_ts() AND to_int8_or_zero(raw)=0;</pre><p>Please note:</p><ol><li>This materialized view reads data from input-topic via the input Kafka External Stream. We set _tp_time&gt;earliest_ts() in the WHERE clause so that all existing messages in the Kafka topic will be read.</li><li>to_int8_or_zero(string) is a built-in SQL function to parse the string as a int8. If it fails, the function will return 0. Then we put the data into the dlq topic.</li><li>INTO dlq informs the materialized view to send results to the specific target, instead of using the materialized view internal storage.</li></ol><p>Similarly, we can define other Materialized Views to check whether the numbers are prime or not, then send them to correspondingly topics.</p><pre>CREATE MATERIALIZED VIEW mv_prime INTO primes AS<br>SELECT raw FROM input WHERE _tp_time&gt;earliest_ts() AND to_int8_or_zero(raw)&gt;0 AND is_prime(to_int8_or_zero(raw));<br>CREATE MATERIALIZED VIEW mv_not_prime INTO composites AS<br>SELECT raw FROM input WHERE _tp_time&gt;earliest_ts() AND to_int8_or_zero(raw)&gt;0 AND NOT is_prime(to_int8_or_zero(raw));</pre><p>The is_prime UDF is called after making sure the input value is a number.</p><h3>Validate the processing logic<a href="https://docs.timeplus.com/tutorial-testcontainers-java#validate-the-processing-logic">​</a></h3><p>Now back to the test code. We will create a Kafka Java Consumer to read from both primes and composites topics, to make sure</p><ol><li>Each message in primes topic is a prime, etc.</li><li>Totally 100 messages in both primesandcomposites topics. No more, no less.</li><li>In the Dead Letter Queue topic, there is a hello world message.</li></ol><p>We will call the buildConsumer to set up a Kafka Java Consumer with StringDeserializer, and use JUnit assert.. methods to validate the results.</p><pre>            // Step 5: validate prime / composite routing<br>            try (<br>                final Consumer&lt;String, String&gt; consumer = buildConsumer(<br>                    kafka.getBootstrapServers(),<br>                    &quot;test-group-id&quot;,<br>                    StringDeserializer.class<br>                )<br>            ) {<br>                consumer.subscribe(List.of(PRIME_TOPIC, COMPOSITE_TOPIC));<br>               int numConsumed = 0;<br>                for (int i = 0; i &lt; 10 &amp;&amp; numConsumed &lt; 100; i++) {<br>                    final ConsumerRecords&lt;String, String&gt; consumerRecords =<br>                        consumer.poll(Duration.ofSeconds(5));<br>                    numConsumed += consumerRecords.count();<br>                    for (ConsumerRecord&lt;<br>                        String,<br>                        String<br>                    &gt; record : consumerRecords) {<br>                        int key = Integer.parseInt(record.key());<br>                        String expectedTopic = isPrime(key)<br>                            ? PRIME_TOPIC<br>                            : COMPOSITE_TOPIC;<br>                        assertEquals(expectedTopic, record.topic());<br>                    }<br>                }<br>                assertEquals(100, numConsumed);<br>                // make sure no more events show up in prime / composite topics<br>                assertEquals(0, consumer.poll(Duration.ofMillis(200)).count());<br>            }<br>            // valdate DLQ routing<br>            try (<br>                final Consumer&lt;String, String&gt; dlqConsumer = buildConsumer(<br>                    kafka.getBootstrapServers(),<br>                    &quot;test-group-id&quot;,<br>                    StringDeserializer.class<br>                )<br>            ) {<br>                dlqConsumer.subscribe(List.of(DLQ_TOPIC));<br>                int numConsumed = 0;<br>                for (int i = 0; i &lt; 10 &amp;&amp; numConsumed &lt; 1; i++) {<br>                    final ConsumerRecords&lt;String, String&gt; consumerRecords =<br>                        dlqConsumer.poll(Duration.ofSeconds(5));<br>                    numConsumed += consumerRecords.count();<br>                    for (ConsumerRecord&lt;<br>                        String,<br>                        String<br>                    &gt; record : consumerRecords) {<br>                        assertEquals(&quot;world&quot;, record.value());<br>                    }<br>                }<br>                assertEquals(1, numConsumed);<br>                // make sure no more events show up in DLQ topic<br>                assertEquals(<br>                    0,<br>                    dlqConsumer.poll(Duration.ofMillis(200)).count()<br>                );<br>            }</pre><h3>Tear down Kafka and Timeplus containers<a href="https://docs.timeplus.com/tutorial-testcontainers-java#tear-down-kafka-and-timeplus-containers">​</a></h3><p>At the end of the test code, tear down Timeplus first then Kafka.</p><pre>            timeplus.stop();<br>            kafka.stop();</pre><h3>Run the test<a href="https://docs.timeplus.com/tutorial-testcontainers-java#run-the-test">​</a></h3><p>Just run gradle test in the testcontainers folder, if you have the Gradle CLI configured.</p><pre>gradle test<br>&gt; Task :test<br>..<br>BUILD SUCCESSFUL in 4s<br>4 actionable tasks: 1 executed, 3 up-to-date</pre><p>It’s amazing that only 4 seconds are spent to start Kafka and Timeplus containers, create topics, send test data, setup &amp; verify the data pipeline, and tear down everything.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb8709bdfef2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/www-timeplus-com/automate-data-streaming-with-testcontainers-native-kafka-and-timeplus-eb8709bdfef2">Automate data streaming with TestContainers, Native Kafka and Timeplus</a> was originally published in <a href="https://medium.com/www-timeplus-com">Timeplus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Better Customer Experiences with Gen AI and Timeplus]]></title>
            <link>https://medium.com/www-timeplus-com/customer-experiences-with-gen-ai-30d8972549b8?source=rss-773d7bcfa681------2</link>
            <guid isPermaLink="false">https://medium.com/p/30d8972549b8</guid>
            <category><![CDATA[case-study]]></category>
            <category><![CDATA[data-streaming]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[contact-center]]></category>
            <dc:creator><![CDATA[Jove Zhong]]></dc:creator>
            <pubDate>Thu, 12 Sep 2024 22:07:41 GMT</pubDate>
            <atom:updated>2024-09-12T22:07:41.786Z</atom:updated>
            <content:encoded><![CDATA[<p>How quickly a support agent can retrieve the history and context of a customer when they report an issue directly impacts the customer experience. In addition, how quickly a knowledge base can be updated with common issues along with sharing current incidents in progress with support agents and customers can differentiate a great customer service center from a good one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*qrzGe7AS2Tl_F1Do_eoThQ.png" /><figcaption>Building Better Customer Experiences with Gen AI and Timeplus</figcaption></figure><p>The use of LLM and Stream processing to solve these problems is a game changer in dynamically assessing incidents and significantly lower mean time to resolution. The following is a case study of how Timeplus is helping a leading Contact Center Software provider do just that. The following describes how we construct a 360 degree customer view based on customer interaction events (when they joined, what products they use, when they last reported an issue), ensure all support ticket conversations are categorized via AI in real-time, and create a rich context to pass onto a conversational AI to make the process much smoother for a support resolution to be reached.</p><p>For any organization running a contact center, it’s common to rely on a range of IT systems — such as CRM, marketing, payment processing, and documentation tools — to manage various functions. When a customer calls, support engineers need to access as much relevant background information as possible. However, when this data is scattered across multiple databases, data warehouses, and SaaS applications, along other systems, it makes stitching together the right information that much harder. Retrieving information from these disparate sources can be slow and cumbersome when done at the point of need — some systems return data within seconds, while others only provide bulk updates on an hourly or daily basis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*Utqwa7xXT1QSCvIGfpbzmA.png" /><figcaption>Retrieving information from disparate sources</figcaption></figure><p>Some of these systems are not designed for low-latency interactive queries, and with point-to-point APIs, it’s difficult to achieve a unified, comprehensive view of the caller’s information. As a result, support agents often have to work with an incomplete picture and manually put together the context, leading to the frustrating experiences we’re all too familiar with.</p><p>This is where Timeplus comes in. By <a href="https://docs.timeplus.com/proton-kafka">integrating</a> source system data with streaming platforms such as Apache Kafka, Confluent or Redpanda, or alternatively Timeplus’ high-performance <a href="https://docs.timeplus.com/ingest-api">streaming ingestion API</a>, one can seamlessly correlate the data from these disparate systems in real-time as the data is produced. By tapping into real-time information feeds as data changes, Timeplus allows you to construct a unified, easily accessible view of each customer as things change for quick access later on. This key feature of being able to query a unified at low latency ensures that support engineers have the most up-to-date and comprehensive information at their fingertips when the incident is reported.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*GA4dVkdhhXDs6A9jJwdaNw.png" /><figcaption>Timeplus creates a view that’s tailored to various access patterns</figcaption></figure><p>The streams of source data typically contain raw information, and require refinement of the data into a more refined, user-friendly view. Timeplus offers robust stream processing capabilities that allow you to transform, filter, and aggregate individual streams, creating a view that’s tailored to various access patterns such as HTTP APIs or database drivers such as JDBC or ODBC. Additionally, Timeplus provides both row-based and column-based historical storage, enabling fast aggregation queries, key/value lookups, updates, and vector similarity searches. Unlike other traditional stream processors, Timeplus eliminates the need to send data back to a relational database, document store, or data lake for querying. Instead, Timeplus serves as a unified analytics platform for data consolidation, filtering, aggregation, and querying.</p><p>With the customer 360 data served as a unified view, the next step is to programmatically link that information to each customer interaction. The following diagram shows an architecture that supports the sourcing, enrichment, and categorization of data with a vector database to create a dynamically up to date customer 360 view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*33ocKPkut032L81p6cTdCQ.png" /><figcaption>In Context Learning</figcaption></figure><p>Once the customer 360 degree view is available, this can be leveraged alongside a conversational AI by the support agent to inject the customer information to the generic LLM to provide a much more fine tuned answer using all the available information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*ZSpsHeDBqlQ8262WhVZy2w.png" /><figcaption>Streaming ETL Pipeline to Provide Real-Time Context</figcaption></figure><p>When a customer contacts the call center, Timeplus can be queried with their ID, email, or phone number to build a real-time context that gathers all relevant information. This context isn’t just comprehensive — it’s always fresh, incorporating data as current as the web pages the customer is visiting right now or recent questions they’ve asked on user communities or social media.</p><p>Here is an example:</p><pre>You are Contact Center AI, assisting a support engineer in providing professional customer support for a caller named “Guest.” The caller may inquire about account creation, recent payments, or share product feedback. Please begin by greeting the caller warmly and professionally, then request any necessary identification details (e.g., account number, email) to locate their account.<br><br><br>The following information may be relevant to this inquiry:<br><br><br>- Account Creation: Guest created an account on [July 15, 2024] via the website using the email [guest@example.com]. The account was verified through an email confirmation sent at [10:15 AM].<br><br><br>- Recent Payment: Guest made a payment of $45.99 on [August 1, 2024] via credit card. The transaction ID is [TXN123456789].<br><br><br>- Social Media Activity: On [August 2, 2024], Guest posted on Twitter expressing satisfaction with the recent service received. The post garnered 25 likes and 5 replies, including responses from the community and the company’s official account.<br><br><br>- Web Analytics: Today, Guest visited 18 pages on docs.acme.com, focusing on setting up SAML Authentication.<br><br>  - 2 seconds ago: Visited docs.acme.com/get-help<br><br>  - 10:10-10:12 AM: Visited docs.acme.com/security/part1 and docs.acme.com/security/part2<br><br>  - 10:03 AM: Visited docs.acme.com/security/overview<br><br>  - 09:12 AM: Visited docs.acme.com/get-started</pre><p>With this up-to-date context, Timeplus generates a prompt that enables an LLM to summarize the information and provide actionable insights to the support agent, ensuring they have the most relevant details at their fingertips.</p><h3>What’s Next</h3><p>The above architectures showcase Timeplus’s powerful capabilities in Streaming ETL, CDC, JOIN, and both historical and streaming queries. However, this is only the beginning of our strategic partnership with the leading contact center solution provider. Looking ahead, we plan to leverage streaming-first machine learning to continually monitor recent customer inquiries, identify patterns, and generate optimal responses. Additionally, this approach will enable us to provide more accurate predictions for outage maintenance and software updates, further enhancing the efficiency and effectiveness of customer support.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*i5j1ttjktE3cAjJ45617MQ.png" /><figcaption>Timeplus as Real-time ML Feature Platform</figcaption></figure><p>Ready to try Timeplus Enterprise? <a href="https://www.timeplus.com/download">Try for free for 30-days.</a></p><p>Join our Timeplus Community! Connect with other users or get support in our<a href="https://timeplus.com/slack"> Slack community</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30d8972549b8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/www-timeplus-com/customer-experiences-with-gen-ai-30d8972549b8">Building Better Customer Experiences with Gen AI and Timeplus</a> was originally published in <a href="https://medium.com/www-timeplus-com">Timeplus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Mutable Streams]]></title>
            <link>https://medium.com/www-timeplus-com/introducing-mutable-streams-5bab88cb0934?source=rss-773d7bcfa681------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bab88cb0934</guid>
            <category><![CDATA[datastream]]></category>
            <category><![CDATA[oltp-vs-olap]]></category>
            <category><![CDATA[oltp]]></category>
            <category><![CDATA[olap]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Jove Zhong]]></dc:creator>
            <pubDate>Wed, 14 Aug 2024 00:38:39 GMT</pubDate>
            <atom:updated>2024-08-14T00:38:39.512Z</atom:updated>
            <content:encoded><![CDATA[<p>In the newly-released Timeplus Enterprise v2.4, we have introduced a new type of stream called “Mutable Stream”. As the name implies, data in such streams are mutable, with previous values being replaced by primary keys. In the early days when we implemented this feature, we called this “KV Stream” or “Key-Value Stream”. You probably heard of the “<a href="https://github.com/gunnarmorling/1brc">The 1 Billion Row Challenge</a>” (1brc). With the new mutable streams, Timeplus can handle data with millions or even billions of unique keys for high performance filter queries, as well as high throughput UPSERTs. Why did we introduce the mutable stream? How is this different from the default stream based on columnar storage? When should you choose row-based storage or columnar storage? Read on to find out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*evPMMN3kH8QUw9ngn_Ck8g.png" /></figure><h3>Append-Only Stream and Columnar Storage</h3><p>Most OLAP databases and streaming processors are optimized for append-only operations, because the main operation is acting on events arriving right away and transforming or calculating results on them. As such, an append-only data structure works well in these use cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1spC3sF_cvF86yEMQIPJ6w.png" /><figcaption>image credit: <a href="https://substack.com/@arriqaaq/p-98433630">https://substack.com/@arriqaaq/p-98433630</a></figcaption></figure><p>You can send new data one by one sequentially to the system. But <a href="https://clickhouse.com/blog/asynchronous-data-inserts-in-clickhouse#data-needs-to-be-batched-for-optimal-performance">more commonly</a>, data is batched together to optimize for higher throughput on the client side and improve resource utilization on the server side by avoiding merging of smaller files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ZVI1H2tGIvGqjHxHFHFwQ.png" /><figcaption>image credit: <a href="https://clickhouse.com/blog/common-getting-started-issues-with-clickhouse">https://clickhouse.com/blog/common-getting-started-issues-with-clickhouse</a></figcaption></figure><p>With the knowledge that the data is append-only and not requiring frequent updates or deletes, it is (relatively) easy to optimize the storage, to build indexes and to improve query performance for streaming use cases. For example, to optimize the query for SELECT COUNT(*) FROM t, an OLAP database can just maintain a file to track the number of rows. Whenever there is new data added, the number in such a file will be updated. Then the user asks how many rows in the table, the database can return the number in the file, without counting row numbers.</p><p>Many modern OLAP systems choose columnar formats in their file layout. Data from each column is stored independently and as such certain queries make the data access very efficient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lZjNvEOMYNpqIdTbgjE-WQ.png" /><figcaption>image credit: <a href="https://datacadamia.com/data/type/relation/structure/column_store">https://datacadamia.com/data/type/relation/structure/column_store</a></figcaption></figure><p>Imagine you built a table with 500 columns and run a query to get minimum and maximum values for 5 of those columns:</p><pre>SELECT min(c1), max(c2), avg(c3), sum(c4), count(c5) FROM t</pre><p>With the columnar storage, the database only needs to fetch 1% (5 columns vs. 500 columns) of the data from the file system. This is very quick and eliminates resource usage.</p><p>Another benefit of columnar-storage is to apply highly-optimized data compression for each column. For example, there is a string column: state to collect which state of the USA the person is living in, such as CA, WA. A columnar database can automatically convert those string values to an int8 internally. This could save more disk space compared to data with gzip or LZ4 compression.</p><p>There are other benefits for columnar-storage, such as leveraging modern CPUs’ SIMD (Single Instruction, Multiple Data) feature to process multiple columns’ data in parallel. When you run sum(col) for a large table with millions of rows, the database can start multiple threads to calculate the sum for the values of the column, and merge the intermediate results together to return the final value.</p><p>At Timeplus, we provide a unified data storage abstraction to support both stream processing and historical queries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BA-mpmoA9MLidb-Q3m4a7w.png" /></figure><ul><li>When you push data to Timeplus or Timeplus copies data from Kafka, data is internally put into the Write-Ahead-Log (WAL). Similar to Apache Kafka, the WAL is designed for append-only data. To improve performance, Timeplus converts raw data from outside (e.g. JSON) and into an internal format called TDF (Timeplus Data Format) to minimize the serialization and deserialization overhead for the data processing at different steps in memory and on disk.</li><li>From the WAL append-only storage, the data is written to the Columnar Storage automatically, by a background thread by Timeplus. Timeplus leverages the open source ClickHouse libraries for efficient columnar storage and indexes, and builds on top of it a performant stream processing and query engine.</li></ul><p>Timeplus supports both streaming queries and historical queries.</p><ul><li>When you run a streaming query (e.g. select .. from my_stream), the most recent new data is served from the streaming WAL and continues to be served until the query is terminated.</li><li>When you run a historical query (e.g. select .. from table(my_stream)), the query is a one-off query and as such leverages the columnar storage to filter and aggregate the data to calculate the result efficiently.</li><li>You can also run a streaming query with historical data backfill (e.g. select .. from my_stream where <em>tp</em>time&gt;now()-14d ). In that case, Timeplus will load data from the columnar storage, as well as the latest data in the WAL to serve up consistent results from the stream.</li></ul><p>This makes sense in principle and actually works rather well. However, there is a change in paradigm required from the usual patterns of access developers are accustomed to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qrEo_3XqNsMQVFojVBWziA.png" /></figure><h3>CRUD</h3><p>OLTP databases such as Postgres are specifically designed and optimized for transactional INSERT, UPDATE, DELETE, even READ (when one user is writing or updating a batch of new data, before that transaction is committed and reported successful, the other users are not supposed to read those data).</p><p>In the context of stream processing or real-time analytics, updating or deleting certain types of data (for example reference data) are not uncommon. For example, the Uber ride rates change during rush hour. For the stock or cryptocurrency markets, the symbol prices can also change multiple times a second based on bid and ask prices. If you want to get the current portfolio market value, you have to handle data updates or even deletes.</p><p>Like we just mentioned, most of OLAP databases and streaming processors are not optimized for mutable data. Taking <a href="https://clickhouse.com/docs/en/updating-data">ClickHouse</a> as an example, you have a few options to update or delete data, but each with caveats:</p><ul><li>ALTER TABLE .. UPDATE is a heavy operation and designed for infrequent use. It is asynchronous by default. This means that the update occurs in the background and you will not get an instant effect on the table.</li><li>If you run SET mutations_sync = 1 before ALTER TABLE .. UPDATE then the update query will wait for the update mutation to complete. It may <a href="https://clickhouse.com/blog/handling-updates-and-deletes-in-clickhouse#synchronous-updates">take a couple of seconds</a>.</li><li>In ClickHouse Cloud, a new <a href="https://clickhouse.com/docs/en/guides/developer/lightweight-update">Lightweight Update</a> feature has been introduced. You can run SET apply_mutations_on_fly = 1 before ALTER TABLE .. UPDATE which causes updated rows to be marked as updated immediately such that subsequent SELECT queries will return those values. However, update mutations are still running in the background. This is designed for updating a small amount of data and not for a streaming use case where a lot of data could be updated.</li><li>ClickHouse also provides data structures such as <a href="https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/collapsingmergetree">CollapsingMergeTree</a> and <a href="https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/replacingmergetree">ReplacingMergeTree</a> if you want to update individual rows frequently. However you have to set up extra columns and expressions. The deduplication runs in the background in order to save space, but it does not guarantee the absence of duplicates. Results may also be served based on stale data until the background compaction takes place.</li></ul><p>At Timeplus, we are well aware of the mutable data needs in certain use cases and the related technical challenges. <a href="https://docs.timeplus.com/public-beta-2#may-1-2023">More than 1 year ago</a>, we introduced the <a href="https://docs.timeplus.com/versioned-stream">Versioned Stream</a> and <a href="https://docs.timeplus.com/changelog-stream">Changelog Stream</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F6iplMdHJUMw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6iplMdHJUMw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F6iplMdHJUMw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/39539ff269c61b4f25674bd9f07f5bc8/href">https://medium.com/media/39539ff269c61b4f25674bd9f07f5bc8/href</a></iframe><p>We were happy with the positive user feedback for such advanced stream modes. However, similar to the <a href="https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/collapsingmergetree">CollapsingMergeTree</a> and <a href="https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/replacingmergetree">ReplacingMergeTree</a> in ClickHouse, those “mutable streams” in Timeplus require extra columns, for example _tp_delta (1 for new data, -1 for deleted data) and an optional version column. This adds significant complexity to the easy-of-use and challenges to integrate with systems like <a href="https://debezium.io/">Debezium</a>. Lastly, Versioned Stream and Changelog Stream were still backed by columnar storage. It’s a double-edged sword as while running aggregation queries on columnar storage is lightning fast, filtering data with a particular primary key, or a time range, or marking data as deleted did not meet our performance expectations.</p><p>With the increasing customer demand for high frequency data mutations and point/range queries, we kept pushing hard to see whether we could build something better with a much better user experience and performance. We bit the bullet and asked: why not just build a true Key-Value stream backed by a row-based historical storage format.</p><h3>Meet Mutable Stream, with Row-Based Storage</h3><p>After many iterations of development and user feedback, we built the new mutable stream in Timeplus Enterprise 2.4, using the popular <a href="https://rocksdb.org/">RocksDB</a> open-source C++ library. It is an LSM-tree based storage engine that provides key-value store APIs. It was originally developed by Facebook/Meta and was based on LevelDB. We will talk more about the design and implementation details of these two systems in a future blog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcIREXBMDJX4oeAyhobGog.png" /><figcaption>image credit: <a href="https://www.creativcoder.dev/blog/what-is-a-lsm-tree">https://www.creativcoder.dev/blog/what-is-a-lsm-tree</a></figcaption></figure><p>Compared to our previous <a href="https://docs.timeplus.com/versioned-stream">Versioned</a> and <a href="https://docs.timeplus.com/changelog-stream">Changelog Streams</a>, <a href="https://docs.timeplus.com/mutable-stream">Mutable Streams</a> are performant, cluster-ready and easy-to-use.</p><pre>CREATE MUTABLE STREAM device_metrics<br>(<br>  device_id string,<br>  timestamp datetime64(3),<br>  batch_id uint32,<br>  region string,<br>  city string,<br>  lat float32,<br>  lon float32,<br>  battery float32,<br>  humidity uint16,<br>  temperature float32<br>)<br>PRIMARY KEY (device_id, timestamp, batch_id)</pre><p>Note:</p><ol><li>The compound primary key is a combination of device_id, timestamp and the batch_id. Data inserted with exactly the same combination will be overridden.</li><li>Searching data with any prefix combinations in the primary key is very fast. For example, searching by device_id or device_id+timestamp will be very fast.</li><li>By default there is only 1 shard and no secondary index or optimization.</li></ol><p>To add new rows or update rows, one can simply insert data to the mutable stream. As long as the primary key(s) are identical, newer data will overwrite the previous data for the respective key.</p><p>For example, let’s use the following SQL to add 50 million rows, with some randomization to generate duplicate primary keys.</p><p>Creating a mutable stream can be as easy as using the following SQL:</p><pre>INSERT INTO device_metrics<br>SELECT<br>    &#39;device_&#39; || to_string(floor(rand_uniform(0, 2400))) AS device_id,<br>    now64(9) AS timestamp,<br>    floor(rand_uniform(0, 50)) AS batch_id,<br>    &#39;region_&#39;||to_string(rand()%5) AS region,<br>    &#39;city_&#39;||to_string(rand()%10) AS city,<br>    rand()%1000/10 AS lat,<br>    rand()%1000/10 AS lon,<br>    rand_uniform(0,100) AS battery,<br>    floor(rand_uniform(0,80)) AS humidity,<br>    rand_uniform(0,100) AS temperature,<br>    now64() AS _tp_time<br>FROM numbers(50_000_000)</pre><p>Depending on your hardware and server configuration, it may take a few seconds to add all data. In my case, it only took 11 seconds to process those 50 millions rows.</p><pre>0 rows in set. Elapsed: 11.532 sec. Processed 50.00 million rows, 400.00 MB (4.34 million rows/s., 34.69 MB/s.)</pre><p>When you query the mutable stream, Timeplus will read all historical data without any duplicated primary key.</p><pre>SELECT count() FROM table(device_metrics);<br>┌─count()─┐<br>│  120000 │<br>└─────────┘<br>1 row in set. Elapsed: 0.092 sec.</pre><p>You can filter data efficiently with any prefix of the primary key:</p><pre>SELECT count() FROM table(device_metrics) WHERE batch_id=5;<br>┌─count()─┐<br>│    2400 │<br>└─────────┘<br>1 row in set. Elapsed: 0.078 sec. Processed 120.00 thousand rows, 480.00 KB (1.54 million rows/s., 6.15 MB/s.)</pre><p>Another example:</p><pre>SELECT * FROM table(device_metrics) WHERE device_id=&#39;device_1&#39; AND timestamp&gt;now()-1h;<br>┌─device_id─┬───────────────timestamp─┬─batch_id─┬─region───┬─city───┬──lat─┬──lon─┬───battery─┬─humidity─┬─temperature─┬────────────────_tp_time─┐<br>│ device_1  │ 2024-07-10 11:38:14.878 │        0 │ region_1 │ city_1 │ 21.1 │ 21.1 │  81.35298 │       41 │    81.35298 │ 2024-07-10 11:38:14.880 │<br>│ device_1  │ 2024-07-10 11:38:14.878 │       49 │ region_3 │ city_3 │ 33.3 │ 33.3 │ 62.507397 │       79 │   62.507397 │ 2024-07-10 11:38:14.880 │<br>└───────────┴─────────────────────────┴──────────┴──────────┴────────┴──────┴──────┴───────────┴──────────┴─────────────┴─────────────────────────┘<br>50 rows in set. Elapsed: 0.015 sec.</pre><h3>Secondary Index</h3><p>For non-primary key columns, if they are frequently filtered, you can also define secondary indexes for them in the data definition for certain queries.</p><p>For example:</p><pre>CREATE MUTABLE STREAM device_metrics<br>(<br>  device_id string,<br>  timestamp datetime64(3),<br>  batch_id uint32,<br>  region string,<br>  city string,<br>  ..<br>  index sidx1 (region)<br>  index sidx2 (city)<br>)<br>PRIMARY KEY (device_id, timestamp, batch_id)</pre><p>When you query data with filters on those columns, Timeplus will automatically leverage the secondary indexes to improve query performance.</p><h3>Column Family</h3><p>For One-Big-Table (OBT) or extra wide tables with dozens or even hundreds of columns, it’s not recommended to retrieve all columns’ data via SELECT * FROM .. as this will require more disk usage and can be slow.</p><p>It is more common that users need to query a subset of the columns.. For those columns which are commonly queried together frequently, you can define column families to group them, so that data for those columns will be saved together and as such be quicker to retrieve in projection queries. Properly defining column families can optimize the disk i/o and avoid reading unnecessary data files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8qK5xJeMp66wEL0ai66Ag.png" /><figcaption>image credit: <a href="https://www.scylladb.com/glossary/cassandra-column-family/">https://www.scylladb.com/glossary/cassandra-column-family/</a></figcaption></figure><p>Please note that one column can only appear in up to one column family. The columns in the primary keys are in a special column family. There should be no overlapping for the column families or primary keys.</p><p>Taking the previous device_metrics as an example, the lat and lon are commonly queried together. You can define a column family for them.</p><pre>CREATE MUTABLE STREAM device_metrics<br>(<br>  device_id string,<br>  timestamp datetime64(3),<br>  batch_id uint32,<br>  region string,<br>  city string,<br>  lat float32,<br>  lon float32,<br>  battery float32,<br>  humidity uint16,<br>  temperature float32,<br>  FAMILY cf1 (lat,lon)<br>)<br>PRIMARY KEY (device_id, timestamp, batch_id)</pre><p>There are many more cool features such as multi-sharding, parallel keyspace scan and how it works with our Multi-Raft cluster. Please check the <a href="https://docs.timeplus.com/mutable-stream#shards">docs</a> for more details or <a href="https://timeplus.com/slack">join our slack</a> for discussions.</p><h3>Streaming SQL on Mutable Streams</h3><p>Mutable streams work in both historical query and streaming query modes.</p><p>When you run SELECT … FROM table(mutable_stream) .. This will scan the historical data without any duplication. You can run such queries every second or even more frequently, the data is always up-to-date.</p><p>You can also query the mutable streams in a streaming SQL application, so that whenever there is new data or updated data in the mutable stream, Timeplus SQL engine will automatically process that data and serve the latest results to the app in real-time. For example this is a streaming aggregation over the mutable stream:</p><pre>SELECT device_id, avg(temperature), min(battery)<br>FROM device_metrics GROUP BY device_id</pre><h3>Preliminary Performance Numbers</h3><p>Both our engineering team and our external users have conducted some preliminary performance tests on the new Mutable Stream. In many cases, it is way faster than the ClickHouse ReplacingMergeTree. In some scenarios, using ClickHouse will hit memory issues and not even return while Timeplus can return the result subsecond.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CUARwefdoNBtr3qXK6PvPw.png" /><figcaption>Query response time in second (smaller is better) Testbed: AWS EC2 c5a.4xlarge: 16c/32G, GP3 EBS. Contact us for more information</figcaption></figure><p>In one of our internal tests, on a 20c32G physical machine, we created a mutable stream with 58 columns, 8 secondary indexes, and the primary key with 3 columns. Then we loaded 20 million rows.</p><p>Sample query:</p><pre>SELECT * FROM table(test_stream) WHERE <br>  (algoid = &#39;s_1-algo-20230202-000000-000-0000000-168.11.224.1&#39;) AND <br>  (createdate &gt;= &#39;1675267200000&#39;) AND (createdate &lt;= &#39;1682985535000&#39;) <br>  AND (ordstatus IN (&#39;1&#39;, &#39;2&#39;)) AND (source = &#39;O32&#39;) <br>  AND (userid = &#39;53&#39;) AND (securityid IN (&#39;601998&#39;, &#39;IF602816&#39;))</pre><p>Whether using 3 shards or more, when there is only 1 query to scan the whole data set, most of the queries can return within 0.05 seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uP9GfS4DnKFxMR7TroVynA.png" /></figure><p>When running 200 queries concurrently, most queries can still return within 2 seconds which is reasonable under such loads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*64FekX1iz-K1yGlWdfj3cQ.png" /></figure><h3>What’s Next</h3><p>With the new mutable streams in Timeplus Enterprise, you can filter and aggregate massive amounts of streaming data at real-time, even rapidly updating data. You can also use the mutable streams to only keep the latest update to records. Combined with Timeplus materialized views, external streams for Apache Kafka or another Timeplus deployment, you may implement more streaming analytics use cases, just with SQL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TCrneT1QjP9xvxwuMreHog.png" /></figure><p>Feel free to <a href="https://www.timeplus.com/product#selfhosted">try Timeplus Enterprise</a> yourself or <a href="https://timeplus.com/slack">join our community slack</a> for more discussions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bab88cb0934" width="1" height="1" alt=""><hr><p><a href="https://medium.com/www-timeplus-com/introducing-mutable-streams-5bab88cb0934">Introducing Mutable Streams</a> was originally published in <a href="https://medium.com/www-timeplus-com">Timeplus</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>