<?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 OpenMLDB Blogs on Medium]]></title>
        <description><![CDATA[Stories by OpenMLDB Blogs on Medium]]></description>
        <link>https://medium.com/@openmldb?source=rss-5e0ba83dc987------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EMd2bjV8-8fzIAfj3ygQfQ.png</url>
            <title>Stories by OpenMLDB Blogs on Medium</title>
            <link>https://medium.com/@openmldb?source=rss-5e0ba83dc987------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 03 Apr 2026 21:36:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@openmldb/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[Feature Signatures — Enabling Complete Feature Engineering with SQL]]></title>
            <link>https://openmldb.medium.com/feature-signatures-enabling-complete-feature-engineering-with-sql-7d3c147a278c?source=rss-5e0ba83dc987------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d3c147a278c</guid>
            <category><![CDATA[software-tools]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[feature-engineering]]></category>
            <category><![CDATA[openmldb]]></category>
            <category><![CDATA[feature-signature]]></category>
            <dc:creator><![CDATA[OpenMLDB Blogs]]></dc:creator>
            <pubDate>Thu, 23 May 2024 07:24:28 GMT</pubDate>
            <atom:updated>2024-05-23T07:26:31.081Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introducing OpenMLDB’s New Feature: Feature Signatures — Enabling Complete Feature Engineering with SQL</h3><h3>Background</h3><p>Rewinding to 2020, the Feature Engine team of Fourth Paradigm submitted and passed an invention patent titled “<a href="https://patents.google.com/patent/CN111752967A">Data Processing Method, Device, Electronic Equipment, and Storage Medium Based on SQL</a>”. This patent innovatively combines the SQL data processing language with machine learning feature signatures, greatly expanding the functional boundaries of SQL statements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V5fQ3koN8HFikmZWJPtykA.png" /><figcaption>Screenshot of Patent in Cinese</figcaption></figure><p>At that time, no SQL database or OLAP engine on the market supported this syntax, and even on Fourth Paradigm’s machine learning platform, the feature signature function could only be implemented using a custom DSL (Domain-Specific Language).</p><p>Finally, in version v0.9.0, OpenMLDB introduced the feature signature function, supporting sample output in formats such as CSV and LIBSVM. This allows direct integration with machine learning training or prediction while ensuring consistency between offline and online environments.</p><h3>Feature Signatures and Label Signatures</h3><p>The feature signature function in OpenMLDB is implemented based on a series of OpenMLDB-customized UDFs (User-Defined Functions) on top of standard SQL. Currently, OpenMLDB supports the following signature functions:</p><ul><li>continuous(column): Indicates that the column is a continuous feature; the column can be of any numerical type.</li><li>discrete(column[, bucket_size]): Indicates that the column is a discrete feature; the column can be of boolean type, integer type, or date and time type. The optional parameter bucket_size sets the number of buckets. If bucket_size is not specified, the range of values is the entire range of the int64 type.</li><li>binary_label(column): Indicates that the column is a binary classification label; the column must be of boolean type.</li><li>multiclass_label(column): Indicates that the column is a multiclass classification label; the column can be of boolean type or integer type.</li><li>regression_label(column): Indicates that the column is a regression label; the column can be of any numerical type.</li></ul><p>These functions must be used in conjunction with the sample format functions csv or libsvm and cannot be used independently. csv and libsvm can accept any number of parameters, and each parameter needs to be specified using functions like continuous to determine how to sign it. OpenMLDB handles null and erroneous data appropriately, retaining the maximum amount of sample information.</p><h3>Usage Example</h3><p>First, follow the <a href="https://openmldb.ai/docs/en/main/tutorial/standalone_use.html">quick start</a> guide to get the image and start the OpenMLDB server and client.</p><pre>docker run -it 4pdosc/openmldb:0.9.0 bash<br>/work/init.sh<br>/work/openmldb/sbin/openmldb-cli.sh</pre><p>Create a database and import data in the OpenMLDB client.</p><pre>--OpenMLDB CLI<br>CREATE DATABASE demo_db;<br>USE demo_db;<br>CREATE TABLE t1(id string, vendor_id int, pickup_datetime timestamp, dropoff_datetime timestamp, passenger_count int, pickup_longitude double, pickup_latitude double, dropoff_longitude double, dropoff_latitude double, store_and_fwd_flag string, trip_duration int);<br>SET @@execute_mode=&#39;offline&#39;;<br>LOAD DATA INFILE &#39;/work/taxi-trip/data/taxi_tour_table_train_simple.snappy.parquet&#39; INTO TABLE t1 options(format=&#39;parquet&#39;, header=true, mode=&#39;append&#39;);</pre><p>Use the SHOW JOBS command to check the task running status. After the task is successfully executed, perform feature engineering and export the training data in CSV format.</p><p>Currently, OpenMLDB does not support overly long column names, so specifying the column name of the sample as instance using SELECT csv(...) AS instance is necessary.</p><pre>--OpenMLDB CLI<br>USE demo_db;<br>SET @@execute_mode=&#39;offline&#39;;<br>WITH t1 as (SELECT trip_duration,<br>        passenger_count,<br>        sum(pickup_latitude) OVER w AS vendor_sum_pl,<br>        count(vendor_id) OVER w AS vendor_cnt,<br>    FROM t1<br>    WINDOW w AS (PARTITION BY vendor_id ORDER BY pickup_datetime ROWS_RANGE BETWEEN 1d PRECEDING AND CURRENT ROW))<br>SELECT csv(<br>    regression_label(trip_duration),<br>    continuous(passenger_count),<br>    continuous(vendor_sum_pl),<br>    continuous(vendor_cnt),<br>    discrete(vendor_cnt DIV 10)) AS instance<br>FROM t1 INTO OUTFILE &#39;/tmp/feature_data_csv&#39; OPTIONS(format=&#39;csv&#39;, header=false, quote=&#39;&#39;);</pre><p>If LIBSVM format training data is needed, simply change SELECT csv(...) to SELECT libsvm(...). Note that the OPTIONS should still use the CSV format because the exported data only has one column, which already contains the complete LIBSVM format sample.</p><p>Moreover, the libsvm function will start numbering continuous features and discrete features with a known number of buckets from 1. Therefore, specifying the number of buckets ensures that the feature encoding ranges of different columns do not conflict. If the number of buckets for discrete features is not specified, there is a small probability of feature signature conflict in some samples.</p><pre>--OpenMLDB CLI<br>USE demo_db;<br>SET @@execute_mode=&#39;offline&#39;;<br>WITH t1 as (SELECT trip_duration,<br>        passenger_count,<br>        sum(pickup_latitude) OVER w AS vendor_sum_pl,<br>        count(vendor_id) OVER w AS vendor_cnt,<br>    FROM t1<br>    WINDOW w AS (PARTITION BY vendor_id ORDER BY pickup_datetime ROWS_RANGE BETWEEN 1d PRECEDING AND CURRENT ROW))<br>SELECT libsvm(<br>    regression_label(trip_duration),<br>    continuous(passenger_count),<br>    continuous(vendor_sum_pl),<br>    continuous(vendor_cnt),<br>    discrete(vendor_cnt DIV 10, 100)) AS instance<br>FROM t1 INTO OUTFILE &#39;/tmp/feature_data_libsvm&#39; OPTIONS(format=&#39;csv&#39;, header=false, quote=&#39;&#39;);</pre><h3>Summary</h3><p>By combining SQL with machine learning, feature signatures simplify the data processing workflow, making feature engineering more efficient and consistent. This innovation extends the functional boundaries of SQL, supporting the output of various formats of data samples, directly connecting to machine learning training and prediction, improving data processing flexibility and accuracy, and having significant implications for data science and engineering practices.</p><p>OpenMLDB introduces signature functions to further bridge the gap between feature engineering and machine learning frameworks. By uniformly signing samples with OpenMLDB, offline and online consistency can be improved throughout the entire process, reducing maintenance and change costs. In the future, OpenMLDB will add more signature functions, including one-hot encoding and feature crossing, to make the information in sample feature data more easily utilized by machine learning frameworks.</p><p><strong>For more information on OpenMLDB:</strong></p><ul><li>Official website: <a href="https://openmldb.ai/">https://openmldb.ai/</a></li><li>GitHub: <a href="https://github.com/4paradigm/OpenMLDB">https://github.com/4paradigm/OpenMLDB</a></li><li>Documentation: <a href="https://openmldb.ai/docs/en/">https://openmldb.ai/docs/en/</a></li><li>Join us on <a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"><strong>Slack</strong></a><strong> </strong>!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8AtcErgR4aDgzpyKaYdqKQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d3c147a278c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenMLDB v0.9.0]]></title>
            <link>https://openmldb.medium.com/openmldb-v0-9-0-f8c083add4b0?source=rss-5e0ba83dc987------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8c083add4b0</guid>
            <category><![CDATA[openmldb]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[OpenMLDB Blogs]]></dc:creator>
            <pubDate>Thu, 02 May 2024 09:13:07 GMT</pubDate>
            <atom:updated>2024-05-03T02:02:47.271Z</atom:updated>
            <content:encoded><![CDATA[<h3>OpenMLDB v0.9.0 Release: Major Upgrade in SQL Capabilities Covering the Entire Feature Servicing Process</h3><p>OpenMLDB has just released a new version v0.9.0, including SQL syntax extensions, MySQL protocol compatibility, TiDB storage support, online feature computation, feature signatures, and more. Among these, the most noteworthy features are the MySQL protocol and ANSI SQL compatibility, along with the extended SQL syntax capabilities.</p><p>Firstly, MySQL protocol compatibility allows OpenMLDB users to access OpenMLDB clusters using any MySQL client, not limited to GUI applications like NaviCat or Sequal Ace but also Java JDBC MySQL Driver, Python SQLAlchemy, Go MySQL Driver, and various programming language SDKs. For more information, you can refer to “<a href="https://openmldb.medium.com/ultra-high-performance-database-openm-ysq-ldb-seamless-compatibility-with-mysql-protocol-and-d3f60210feea"><strong>Ultra High-Performance Database OpenM(ysq)LDB: Seamless Compatibility with MySQL Protocol and Multi-Language MySQL Client</strong></a>”.</p><p>Secondly, the new version significantly expands SQL capabilities, especially implementing OpenMLDB’s unique request mode and stored procedure execution within standard SQL syntax. Compared to traditional SQL databases, OpenMLDB covers the entire machine learning process, including offline and online modes. In online mode, users can input sample data, and get feature results through SQL feature extraction. On the contrary, in the past, we needed to deploy SQL as a stored procedure through the Deploy command and then perform online feature computation through SDKs or HTTP interfaces. The new version adds SELECT CONFIG and CALL statements, allowing users to directly specify request mode and sample data in SQL to compute feature results, as shown below:</p><pre>-- Execute online request mode query for action (10, &quot;foo&quot;, timestamp(4000))<br>SELECT id, count(val) over (partition by id order by ts rows between 10 preceding and current row)<br>FROM t1<br>CONFIG (execute_mode = &#39;online&#39;, values = (10, &quot;foo&quot;, timestamp(4000)))</pre><p>You can also use the ANSI SQL CALL statement to invoke stored procedures with sample rows as parameters, as shown below:</p><pre>-- Execute online request mode query for action (10, &quot;foo&quot;, timestamp(4000))<br>DEPLOY window_features SELECT id, count(val) over (partition by id order by ts rows between 10 preceding and current row)<br>FROM t1;<br><br>CALL window_features(10, &quot;foo&quot;, timestamp(4000))</pre><p>For detailed release notes, please refer to: <a href="https://github.com/4paradigm/OpenMLDB/releases/tag/v0.9.0">https://github.com/4paradigm/OpenMLDB/releases/tag/v0.9.0</a></p><p>Please feel free to download and explore the latest release. Your feedback is highly valued and appreciated. We encourage you to share your thoughts and suggestions to help us improve and enhance the platform. Thank you for your support!</p><h3>Release Date</h3><p>April 25, 2024</p><h3>Release Note</h3><p><a href="https://github.com/4paradigm/OpenMLDB/releases/tag/v0.9.0">https://github.com/4paradigm/OpenMLDB/releases/tag/v0.9.0</a></p><h3>Highlighted Features</h3><ul><li>Added support for the latest version of SQLAlchemy 2, seamlessly integrating with popular Python frameworks such as Pandas and Numpy.</li><li>Expanded support for more data backends, integrating TiDB’s distributed file storage capability with OpenMLDB’s high-performance in-memory feature computation capability.</li><li>Enhanced ANSI SQL support, fixed first_value semantics, supported MAP type and feature signatures, and added offline mode support for INSERT statements.</li><li>Added support for MySQL protocol, allowing access to OpenMLDB clusters using MySQL clients like NaviCat, Sequal Ace, and various MySQL SDKs for programming languages.</li><li>Extended SQL syntax support, enabling online feature computation directly through SELECT CONFIG or CALL statements.</li></ul><p><strong>For more information on OpenMLDB:</strong></p><ul><li>Official website: <a href="https://openmldb.ai/">https://openmldb.ai/</a></li><li>GitHub: <a href="https://github.com/4paradigm/OpenMLDB">https://github.com/4paradigm/OpenMLDB</a></li><li>Documentation: <a href="https://openmldb.ai/docs/en/">https://openmldb.ai/docs/en/</a></li><li>Join us on <a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"><strong>Slack</strong></a><strong> </strong>!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8c083add4b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparative Analysis of Memory Consumption: OpenMLDB vs Redis Test Report]]></title>
            <link>https://openmldb.medium.com/comparative-analysis-of-memory-consumption-openmldb-vs-redis-test-report-b7b4022b9583?source=rss-5e0ba83dc987------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7b4022b9583</guid>
            <category><![CDATA[openmldb]]></category>
            <category><![CDATA[memory-consumption]]></category>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[comparative-analysis]]></category>
            <dc:creator><![CDATA[OpenMLDB Blogs]]></dc:creator>
            <pubDate>Tue, 02 Apr 2024 09:07:46 GMT</pubDate>
            <atom:updated>2024-04-03T04:01:57.142Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rv9O4omnzKmmrktSBT0DHQ.png" /></figure><h3>Background</h3><p>OpenMLDB is an open-source high-performance in-memory SQL database with numerous innovations and optimizations particularly tailored for time-series data storage, real-time feature computation, and other advanced functionalities. On the other hand, Redis is the most popular in-memory storage database widely used in high-performance online scenarios such as caching. While their respective application landscapes differ, both databases share a common trait of utilizing memory as their storage medium.</p><p>The objective of this article is to perform a comparative analysis of memory consumption under identical data row counts for both databases. Our goal is to provide users with a clear and intuitive understanding of the respective memory resource consumptions of each database.</p><h3>Test Environment</h3><p>This test is based on physical machine deployment (40C250G * 3) with the following hardware specifications:</p><p>- CPU: Intel(R) Xeon(R) CPU E5–2630 v4 @ 2.20GHz<br>- Processor: 40 Cores<br>- Memory: 250 G<br>- Storage: HDD 7.3T * 4</p><p>The software versions are as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*CMmxhQ8_Tny81f6_vDkKBw.png" /></figure><h3>Test Methods</h3><p>We have developed a Java-based testing tool using the OpenMLDB Java SDK and Jedis to compare memory usage between OpenMLDB and Redis. The objective is to insert identical data into both databases and analyze their respective memory usage. Due to variations in supported data types and storage methods, the data insertion process differs slightly between the two platforms. Since the data being tested consists of timestamped feature data, we have devised the following two distinct testing approaches to closely mimic real-world usage scenarios.</p><h4><strong>Method One: Random Data Generation</strong></h4><p>In this method, each test dataset comprises m keys serving as primary identifiers, with each key potentially having n different values (simulating time series data). For simplicity, each value is represented by a single field, and the lengths of the key and value fields can be controlled via configuration parameters. For OpenMLDB, we create a test table with two columns (key, value) and insert each key-value pair as a data entry. In the case of Redis, we use each key as an identifier and store multiple values corresponding to that key as a sorted set (zset) within Redis.</p><h4><strong>- Example</strong></h4><p>We plan to test with 1 million (referred to as 1M) keys, each corresponding to 100 time-series data entries. Therefore, the actual data stored in OpenMLDB would be 1M * 100 = 100M, which is equivalent to 100 million data entries. In Redis, we store 1M keys, each key corresponding to a sorted set (zset) containing 100 members.</p><h4><strong>- Configurable Parameters</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*7unY38PGdSYuRiZNNKopqw.png" /></figure><h4><strong>- Operations Steps (Reproducible Steps)</strong></h4><h4>a. Deploy OpenMLDB and Redis</h4><p>Deployment can be done through containerization or directly on physical machines using software packages. There is no significant difference between the two methods. Below is an example of using containerization for deployment:</p><ul><li>OpenMLDB<br>- Docker image: docker pull 4pdosc/openmldb:0.8.5<br>- Documentation: <a href="https://openmldb.ai/docs/zh/main/quickstart/openmldb_quickstart.html">https://openmldb.ai/docs/zh/main/quickstart/openmldb_quickstart.html</a></li><li>Redis:<br>- Docker image: docker pull redis:7.2.4<br>- Documentation: <a href="https://hub.docker.com/_/redis">https://hub.docker.com/_/redis</a></li></ul><h4>b. Pull the<a href="https://github.com/4paradigm/OpenMLDB/tree/main/benchmark"> testing code</a></h4><h4>c. Modify configuration</h4><ul><li>Configuration file: src/main/resources/memory.properties [<a href="https://github.com/4paradigm/OpenMLDB/blob/main/benchmark/src/main/resources/memory.properties">link</a>]</li><li>Note: Ensure that REDIS_HOST_PORT and ZK_CLUSTER configurations match the actual testing environment. Other configurations are related to the amount of test data and should be adjusted as needed. If the data volume is large, the testing process may take longer.</li></ul><h4>d. Rut the tests</h4><p>[Related paths in the GitHub benchmark Readme]</p><h4>e. Check the output results</h4><h4><strong>Method Two: Using the Open Source Dataset TalkingData</strong></h4><p>To enhance the credibility of the results, cover a broader range of data types, and facilitate result reproduction and comparison, we have designed a test using an open-source dataset — the TalkingData dataset. This dataset is used as a typical case in <a href="https://openmldb.ai/docs/en/main/use_case/talkingdata_demo.html">OpenMLDB for ad fraud detection</a>. Here, we utilize the TalkingData train dataset, which can be obtained as follows:</p><ul><li>Sample data: <a href="https://github.com/4paradigm/OpenMLDB/blob/main/demo/talkingdata-adtracking-fraud-detection/train_sample.csv">sample data used in OpenMLDB</a></li><li>Full data: Available on <a href="https://www.kaggle.com/c/talkingdata-adtracking-fraud-detection/data">Kaggle</a></li></ul><p>Differing from the first method, the TalkingData dataset includes multiple columns with strings, numbers, and time types. To align storage and usage more closely with real-world scenarios, we use the “ip” column from TalkingData as the key for storage. In OpenMLDB, this involves creating a table corresponding to the TalkingData dataset and creating an index for the “ip” column (OpenMLDB defaults to creating an index for the first column). In Redis, we use “ip” as the key and store a JSON string composed of other column data in a zset (as TalkingData is time-series data, there can be multiple rows with the same “ip”).</p><h4><strong>- Example</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*XPXdzaRIq68z6LdBwEaY8Q.png" /></figure><h4><strong>- Configurable Parameters</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*ovUBAeCcDeADBcedmJapeQ.png" /></figure><h4>- <strong>Operation Steps (Reproducible Steps)</strong></h4><h4>a. Deploy OpenMLDB and Redis</h4><p>Same as in method one.</p><h4>b. Pull the <a href="https://github.com/4paradigm/OpenMLDB/tree/main/benchmark">testing code</a></h4><h4>c. Modify configuration</h4><ul><li>Configuration file: src/main/resources/memory.properties [<a href="https://github.com/4paradigm/OpenMLDB/blob/main/benchmark/src/main/resources/memory.properties">link</a>]</li><li>Note:<br>- Ensure that REDIS_HOST_PORT and ZK_CLUSTER configurations match the actual testing environment.<br>- Modify TALKING_DATASET_PATH (defaults to resources/data/talking_data_sample.csv).</li></ul><h4>d. Obtain the test data file</h4><p>Place the test data file in the resources/data directory, which is consistent with the TALKING_DATASET_PATH configuration path.</p><h4>e. Run the tests</h4><p>[Related paths in the GitHub benchmark Readme]</p><h4>f. Check the output results</h4><h3>Results</h3><h4>Random Data Test</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*B0ZdlXLfn9ENGdGKjnz1Qg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OVmEh9P1vfJHvXay" /></figure><p>Under the experimental conditions mentioned above, storing the same amount of data, OpenMLDB (memory storage-mode) consumes over 30% less memory compared to Redis.</p><h4>TalkingData Test</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*gzgkhGue0sXvwD-zhY4H1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r5EJqYOtgistOp3D" /></figure><p>Thanks to OpenMLDB’s data compression capabilities, when sampling small batches of data from the TalkingData train dataset, OpenMLDB’s memory usage is significantly reduced by 74.77% compared to Redis. As the volume of test data increases, due to the nature of the TalkingData train dataset, a high number of duplicate keys during storage occurs, leading to a decrease in the storage advantage of OpenMLDB relative to Redis. This trend continues until all the train dataset is stored in the database, at which point OpenMLDB’s memory reduction compared to Redis is 45.66%.</p><h3>Summary</h3><p>For the open-source dataset TalkingData when storing data of similar magnitude, OpenMLDB reduces memory usage by 45.66% compared to Redis. Even on datasets consisting purely of string data, OpenMLDB can still reduce memory usage by over 30% compared to Redis.</p><p>This is because of OpenMLDB’s compact row encoding format, which optimizes various data types when storing the same amount of data. The optimization reduces memory usage in in-memory databases and lowers servicing costs. Comparisons with mainstream in-memory databases like Redis further demonstrate OpenMLDB’s superior performance in terms of memory usage and Total Cost of Ownership (TCO).</p><p><strong>For more information on OpenMLDB:</strong></p><ul><li>Official website: <a href="https://openmldb.ai/">https://openmldb.ai/</a></li><li>GitHub: <a href="https://github.com/4paradigm/OpenMLDB">https://github.com/4paradigm/OpenMLDB</a></li><li>Documentation: <a href="https://openmldb.ai/docs/en/">https://openmldb.ai/docs/en/</a></li><li>Join us on <a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"><strong>Slack</strong></a><strong> </strong>!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7b4022b9583" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ultra High-Performance Database OpenM(ysq)LDB: Seamless Compatibility with MySQL Protocol and…]]></title>
            <link>https://openmldb.medium.com/ultra-high-performance-database-openm-ysq-ldb-seamless-compatibility-with-mysql-protocol-and-d3f60210feea?source=rss-5e0ba83dc987------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3f60210feea</guid>
            <category><![CDATA[high-performance]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[OpenMLDB Blogs]]></dc:creator>
            <pubDate>Fri, 22 Mar 2024 05:02:59 GMT</pubDate>
            <atom:updated>2024-03-25T06:57:09.752Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ultra High-Performance Database OpenM(ysq)LDB: Seamless Compatibility with MySQL Protocol and Multi-Language MySQL Client</h3><h3>What’s OpenM(ysq)LDB?</h3><p><a href="https://github.com/4paradigm/OpenMLDB">OpenMLDB</a> has introduced a new service module called OpenM(ysq)LDB, expanding its capabilities to integrate with MySQL infrastructure. This extension redefines the “ML” in OpenMLDB to signify both Machine Learning and MySQL compatibility. Through OpenM(ysq)LDB, users gain the ability to utilize MySQL command-line clients or MySQL SDKs in various programming languages, enabling seamless access to OpenMLDB’s unique online and offline feature calculation capabilities.</p><p>OpenMLDB itself is a distributed high-performance memory time-series database built on C++ and LLVM technologies. Its architectural design and implementation logic significantly differ from traditional standalone relational databases like MySQL. OpenMLDB has garnered widespread adoption, particularly in hard real-time online feature calculation scenarios such as financial risk control and recommendation systems. While OpenMLDB’s capabilities are robust, its adoption was initially hindered by perceived high adaptation costs.</p><p>However, the introduction of OpenM(ysq)LDB addresses this barrier by facilitating direct integration with MySQL Clients and SDKs. Through standard ANSI SQL interfaces, OpenMLDB is now compatible with MySQL protocol, allowing customers to directly use the familiar MySQL clients to access OpenMLDB data and perform special OpenMLDB SQL feature extraction syntax. This enhancement streamlines the transition for users familiar with MySQL environments, making OpenMLDB’s advanced features more accessible and user-friendly.</p><p>For more details, check the official documentation at <a href="https://openmldb.ai/docs/en/main/app_ecosystem/open_mysql_db/index.html.">https://openmldb.ai/docs/en/main/app_ecosystem/open_mysql_db/index.html.</a></p><h3>Usage</h3><h4>Use a Compatible MySQL Command Line</h4><p>After deploying the OpenMLDB distributed cluster, developers do not need to install additional OpenMLDB command line tools. Using the pre-installed MySQL command line tool, developers can directly connect to the OpenMLDB cluster for testing ( note that the following SQL connections and execution results are all returned by the OpenMLDB cluster, not by a remote MySQL service).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5QIIjVAzsut4WoQ-" /></figure><p>By executing customized OpenMLDB SQL, developers can not only view the status of the OpenMLDB cluster but also switch between offline mode and online mode to realize the offline and online feature extraction functions of MLOps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ptCWEInPe6Lc-BJe" /></figure><h4>Use a Compatible JDBC Driver</h4><p>Java developers generally use the MySQL JDBC driver to connect to MySQL. The same code can directly connect to the OpenMLDB cluster without any modification.</p><p>Write the Java application code as follows. Pay attention to modifying the IP, port, username, and password information according to the actual cluster situation.</p><pre>public class Main {<br>    public static void main(String[] args) {<br>        String url = &quot;jdbc:mysql://localhost:3307/db1&quot;;<br>        String user = &quot;root&quot;;<br>        String password = &quot;root&quot;;<br>        Connection connection = null;<br>        Statement statement = null;<br>        ResultSet resultSet = null;<br>        try {<br>            connection = DriverManager.getConnection(url, user, password);<br>            statement = connection.createStatement();<br>            resultSet = statement.executeQuery(&quot;SELECT * FROM db1.t1&quot;);<br>            while (resultSet.next()) {<br>                int id = resultSet.getInt(&quot;id&quot;);<br>                String name = resultSet.getString(&quot;name&quot;);<br>                System.out.println(&quot;ID: &quot; + id + &quot;, Name: &quot; + name);<br>            }<br>        } catch (SQLException e) {<br>            e.printStackTrace();<br>        } finally {<br>            // Close the result set, statement, and connection<br>            try {<br>                if (resultSet != null) {<br>                    resultSet.close();<br>                }<br>                if (statement != null) {<br>                    statement.close();<br>                }<br>                if (connection != null) {<br>                    connection.close();<br>                }<br>            } catch (SQLException e) {<br>                e.printStackTrace();<br>            }<br>        }<br>    }<br>}</pre><p>Then compile and execute, and you can see the queried data for the OpenMLDB database in the command line output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aivjJLsx6yA2yshj" /></figure><h4>Use a Compatible SQLAlchemy Driver</h4><p>Python developers often use SQLAlchemy and MySQL drivers, and the same code can also be directly applied to query OpenMLDB’s online data.</p><p>Write the Python application code as follows:</p><pre>from sqlalchemy import create_engine, text<br><br>def main():<br>    engine = create_engine(&quot;mysql+pymysql://root:root@127.0.0.1:3307/db1&quot;, echo=True)<br>    with engine.connect() as conn:<br>        result = conn.execute(text(&quot;SELECT * FROM db1.t1&quot;))<br>        for row in result:<br>            print(row)<br><br>if __name__ == &quot;__main__&quot;:<br>  main()</pre><p>Then execute it directly, and you can see the corresponding OpenMLDB database output in the command line output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EyMXQBhAIXYsleC_" /></figure><h4>Use a Compatible Go MySQL Driver</h4><p>Golang developers generally use the officially recommended github.com/go-sql-driver/mysql driver to access MySQL. They can also directly access the OpenMLDB cluster without modifying the application code.</p><p>Write the Golang application code as follows:</p><pre>package main<br><br>import (<br>        &quot;database/sql&quot;<br>        &quot;fmt&quot;<br>        &quot;log&quot;<br><br>        _ &quot;github.com/go-sql-driver/mysql&quot;<br>)<br><br>func main() {<br>        // MySQL database connection parameters<br>        dbUser := &quot;root&quot;         // Replace with your MySQL username<br>        dbPass := &quot;root&quot;         // Replace with your MySQL password<br>        dbName := &quot;db1&quot;    // Replace with your MySQL database name<br>        dbHost := &quot;localhost:3307&quot;        // Replace with your MySQL host address<br>        dbCharset := &quot;utf8mb4&quot;            // Replace with your MySQL charset<br><br>        // Create a database connection<br>        db, err := sql.Open(&quot;mysql&quot;, fmt.Sprintf(&quot;%s:%s@tcp(%s)/%s?charset=%s&quot;, dbUser, dbPass, dbHost, dbName, dbCharset))<br>        if err != nil {<br>                log.Fatalf(&quot;Error connecting to the database: %v&quot;, err)<br>        }<br>        defer db.Close()<br><br>        // Perform a simple query<br>        rows, err := db.Query(&quot;SELECT id, name FROM db1.t1&quot;)<br>        if err != nil {<br>                log.Fatalf(&quot;Error executing query: %v&quot;, err)<br>        }<br>        defer rows.Close()<br><br>        // Iterate over the result set<br>        for rows.Next() {<br>                var id int<br>                var name string<br>                if err := rows.Scan(&amp;id, &amp;name); err != nil {<br>                        log.Fatalf(&quot;Error scanning row: %v&quot;, err)<br>                }<br>                fmt.Printf(&quot;ID: %d, Name: %s\n&quot;, id, name)<br>        }<br>        if err := rows.Err(); err != nil {<br>                log.Fatalf(&quot;Error iterating over result set: %v&quot;, err)<br>        }<br>}</pre><p>Compile and run directly, and you can view the database output results in the command line output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*APMul6cHPvXo1g6y" /></figure><h4>Use a Compatible Sequel Ace Client</h4><p>MySQL developers usually use GUI applications to simplify database management. If developers want to connect to an OpenMLDB cluster, they can also use such open-source GUI tools.</p><p>Taking Sequel Ace as an example, developers do not need to modify any project code. They only need to fill in the address and port of the OpenM(ysq)LDB service when connecting to the database and fill in the username and password of the OpenMLDB service as the username and password. Then developers can follow the MySQL operation method to access the OpenMLDB service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R8vfgFm3GN4nG8Is" /></figure><h4>Use a Compatible Navicat Client</h4><p>In addition to Sequel Ace, Navicat is also a popular MySQL client. Developers do not need to modify any project code. They only need to fill in the address and port of the OpenM(ysq)LDB service when creating a new connection (MySQL), and fill in the user name and password. The username and password of the OpenMLDB service can be used to access the OpenMLDB service according to the MySQL operation method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PYBRNTVd2A2Br4NB" /></figure><h3>Compatibility Principle of MySQL Protocol</h3><p>The protocols of MySQL (including subsequent versions like MariaDB) are publicly available. On the server side, OpenM(ysq)LDB fully implements and is compatible with the MySQL protocol. While at the backend, it manages connections to the distributed OpenMLDB cluster through the OpenMLDB SDK, enabling compatibility access with various MySQL clients.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MzGK9PxpjgLgBAw4" /></figure><p>Currently, OpenM(ysql)LDB maintains client interaction with OpenMLDB through long-lived connections. This ensures that each connection has a unique client object accessing the OpenMLDB cluster. All SQL queries from the same connection do not require additional initialization, and resources are automatically released after the connection is closed. The overhead of the service itself is almost negligible, and performance can be consistent with directly connecting to OpenMLDB.</p><p>For more usage documentation, please refer to the official documentation at <a href="https://openmldb.ai/docs/en/main/app_ecosystem/open_mysql_db/index.html.">https://openmldb.ai/docs/en/main/app_ecosystem/open_mysql_db/index.html.</a></p><h3>Summary</h3><p>OpenM(ysql)LDB is a bold attempt within the OpenMLDB project. After a total of 39 versions released from 0.1.5 to 0.8.5, and continuous improvement in functionality and SQL syntax compatibility, it has finally achieved full compatibility with the MySQL protocol. It not only ensures basic SQL query functionality but also provides a lower-level storage implementation and AI capabilities that outperform MySQL. From now on, MySQL/MariaDB users can seamlessly switch their database storage engines. Developers using different programming languages can also directly utilize mature MySQL SDKs. The barrier to entry for using OpenMLDB services has been significantly lowered, providing a “shortcut” for all DBAs or data developers to transition to AI.</p><p>Please note that as of now, MySQL Workbench testing with OpenM(ysql)LDB is not yet supported. Relevant testing work is still ongoing, and interested developers can stay updated on the development progress of this project on GitHub.</p><p><strong>For more information on OpenMLDB:</strong></p><ul><li>Official website: <a href="https://openmldb.ai/">https://openmldb.ai/</a></li><li>GitHub: <a href="https://github.com/4paradigm/OpenMLDB">https://github.com/4paradigm/OpenMLDB</a></li><li>Documentation: <a href="https://openmldb.ai/docs/en/">https://openmldb.ai/docs/en/</a></li><li>Join us on <a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"><strong>Slack</strong></a><strong> </strong>!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3f60210feea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Distributed Database Development in 10 Minutes with OpenMLDB Developer Docker Image]]></title>
            <link>https://openmldb.medium.com/mastering-distributed-database-development-in-10-minutes-with-openmldb-developer-docker-image-0dc4ec84dd49?source=rss-5e0ba83dc987------2</link>
            <guid isPermaLink="false">https://medium.com/p/0dc4ec84dd49</guid>
            <category><![CDATA[openmldb]]></category>
            <category><![CDATA[distributed-database]]></category>
            <category><![CDATA[docker-image]]></category>
            <dc:creator><![CDATA[OpenMLDB Blogs]]></dc:creator>
            <pubDate>Wed, 13 Mar 2024 04:49:16 GMT</pubDate>
            <atom:updated>2024-03-13T05:17:52.583Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qiSmedKZYmkNz45_pcms3w.png" /></figure><p><a href="https://github.com/4paradigm/OpenMLDB">OpenMLDB</a> is an open-source, distributed in-memory database system designed for time-series data. It focuses on high performance, reliability, and scalability, making it suitable for handling massive time-series data and real-time computation of online features. In the wave of big data and machine learning, OpenMLDB has emerged as a promising player in the open-source database field, thanks to its powerful data processing capabilities and efficient support for machine learning.</p><p>The core storage and SQL engine of OpenMLDB consist of over 360,000 lines of C++ code and a massive amount of C header files. To further reduce the project compilation threshold and enhance developers’ efficiency, we have introduced a newly designed OpenMLDB Docker image. This allows developers to quickly compile the database source code from scratch on any operating system platform, including Linux, MacOS, Windows, etc. With just ten minutes, developers can join as contributors to the development of distributed databases.</p><h3>Usage</h3><p>The mirror is currently hosted on the Alibaba Cloud Mirror Repository. The process for using the mirror is as follows:</p><p>1. Start container: Use Docker commands to start the container. This will initiate an environment containing the OpenMLDB source code and all dependencies.</p><pre>docker run -it registry.cn-beijing.aliyuncs.com/openmldb/openmldb-build bash</pre><p>2. Compile OpenMLDB: Inside the container, you can directly navigate to the OpenMLDB source code directory and execute the compilation script.</p><pre>cd OpenMLDB<br>make</pre><p>3. Install OpenMLDB, default installation path is ${PROJECT_ROOT}/openmldb</p><pre>make install</pre><p>4. Deployment and Testing: After the compilation is complete, you can proceed with deployment and testing accordingly. All necessary tools and dependencies are already prepared and ready to use.</p><h3>Concurrent Compilation Time</h3><p>OpenMLDB disables concurrent compilation by default. However, if the resources on the compilation machine are sufficient, you can enable concurrent compilation using the compilation parameter NPROC. Here we list the time required for concurrent compilation.</p><p>1. 4-core Compilation</p><pre>make NPROC=4</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/0*PxiBv02dcLlqT6v4" /></figure><p>2. 8-core Compilation</p><pre>make NPROC=8</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/0*N1-PWLtPlGHTkXBl" /></figure><p><strong>3. 16-core Compilation</strong></p><pre>make NPROC=16</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/0*nj1LbYr7AJQIDUIE" /></figure><h3>Highlights</h3><ol><li><strong>Quick Start</strong>: Eliminates complex setup steps, allowing developers to quickly enter development mode on different operating system platforms.</li><li><strong>Unified Environment</strong>: Whether for individual development or team collaboration, the Docker image ensures that each member develops in a consistent environment, effectively avoiding the “it works on my machine” problem.</li><li><strong>Easy Sharing</strong>: The image can be easily shared with other team members or distributed in the community, accelerating the adoption and application of OpenMLDB.</li><li><strong>Complete OpenMLDB Environment</strong>: The image comes pre-installed with the complete source code of OpenMLDB, enabling developers to easily explore and modify the OpenMLDB source code and contribute to the OpenMLDB community.</li><li><strong>Offline Compilation and Deployment Capabilities</strong>: By pre-downloading the third-party libraries required by OpenMLDB, the image can compile and deploy OpenMLDB in a completely offline environment. This greatly improves work efficiency in network-restricted environments, enhancing the flexibility and feasibility of development.</li><li><strong>Compilation Efficiency</strong>: Since all dependencies are already built into the image, this avoids lengthy dependency download and installation processes, making the compilation process much faster.</li></ol><p>This custom Docker image tailored for offline building of OpenMLDB not only simplifies the onboarding process for developers but also provides robust support for project compilation, deployment, and testing. We anticipate that this tool will help more developers and enterprises leverage OpenMLDB more efficiently, enabling them to control the compilation and development capabilities of OpenMLDB at the source code level. Moreover, with the enhanced development and application capabilities, we look forward to seeing OpenMLDB further develop and apply in industry ecosystems such as financial risk control, recommendation systems, and quantitative trading.</p><p><strong>For more information on OpenMLDB:</strong></p><ul><li>Official website: <a href="https://openmldb.ai/">https://openmldb.ai/</a></li><li>GitHub: <a href="https://github.com/4paradigm/OpenMLDB">https://github.com/4paradigm/OpenMLDB</a></li><li>Documentation: <a href="https://openmldb.ai/docs/en/">https://openmldb.ai/docs/en/</a></li><li>Join us on <a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"><strong>Slack</strong></a><strong> </strong>!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0dc4ec84dd49" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Hive — Offline Data for OpenMLDB]]></title>
            <link>https://openmldb.medium.com/apache-hive-offline-data-for-openmldb-f2e0ea3fd6a7?source=rss-5e0ba83dc987------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2e0ea3fd6a7</guid>
            <category><![CDATA[apache-hive]]></category>
            <category><![CDATA[data-offline]]></category>
            <category><![CDATA[openmldb]]></category>
            <dc:creator><![CDATA[OpenMLDB Blogs]]></dc:creator>
            <pubDate>Fri, 08 Mar 2024 06:09:27 GMT</pubDate>
            <atom:updated>2024-03-08T06:42:48.476Z</atom:updated>
            <content:encoded><![CDATA[<h3>Apache Hive — Offline Data for OpenMLDB</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1JN5tOgSx1-mKihnRxlXXA.png" /></figure><p>The <a href="https://hive.apache.org/">Apache Hive</a>™ is a distributed, fault-tolerant data warehouse system that enables analytics at a massive scale and facilitates reading, writing, and managing petabytes of data residing in distributed storage using SQL. OpenMLDB extends its capabilities by offering seamless import and export functionalities for Hive as a data warehousing solution. While Hive is primarily used as an offline data source, it can also function as a data source for online data ingestion during the initialization phase of online engines.</p><p>Note that currently, only reading and writing to non-ACID tables (EXTERNAL tables) in Hive is supported. ACID tables (Full ACID or insert-only tables, i.e., MANAGED tables) are not supported at the moment.</p><h3>OpenMLDB Deployment</h3><p>You can refer to the official documentation for <a href="https://openmldb.ai/docs/en/main/deploy/install_deploy.html">deployment</a>. An easier way is to deploy with an official docker image, as described in <a href="https://openmldb.ai/docs/en/main/quickstart/openmldb_quickstart.html">Quickstart</a>.</p><p>In addition, you will also need Spark, please refer to <a href="https://openmldb.ai/docs/en/main/tutorial/openmldbspark_distribution.html">OpenMLDB Spark Distribution</a>.</p><h3>Hive-OpenMLDB Integration</h3><h4>Installation</h4><p>For users employing <a href="https://openmldb.ai/docs/en/main/tutorial/openmldbspark_distribution.html">OpenMLDB Spark Distribution Version</a>, specifically v0.6.7 and newer iterations, the essential Hive dependencies are already integrated.</p><p>However, if you are working with an alternative Spark distribution, you can follow these steps for installation.</p><ul><li>Execute the following command in Spark to compile Hive dependencies</li></ul><pre>./build/mvn -Pyarn -Phive -Phive-thriftserver -DskipTests clean package</pre><ul><li>After successfully executed, the dependent package is located in the directory assembly/target/scala-xx/jars</li><li>Add all dependent packages to Spark’s class path.</li></ul><h4>Configuration</h4><p>At present, OpenMLDB exclusively supports utilizing metastore services for establishing connections to Hive. You can adopt either of the two provided configuration methods to access the Hive data source. To set up a simple HIVE environment, configuring hive.metastore.uris will suffice. However, in the production environment when HIVE configurations are required, configurations through hive-site.xml is recommended.</p><ul><li>Using the spark.conf Approach: You can set up spark.hadoop.hive.metastore.uris within the Spark configuration. This can be accomplished in two ways:</li></ul><p>a. taskmanager.properties: Include spark.hadoop.hive.metastore.uris=thrift://... within the spark.default.conf configuration item, followed by restarting the taskmanager.</p><p>b. CLI: Integrate this configuration directive into ini conf and use --spark_conf when start CLI. Please refer to <a href="https://openmldb.ai/docs/en/main/reference/client_config/client_spark_config.html">Client Spark Configuration</a>.</p><ul><li>hive-site.xml: You can configure hive.metastore.uris within the hive-site.xml file. Place this configuration file within the conf/ directory of the Spark home. If the HADOOP_CONF_DIR environment variable is already set, you can also position the configuration file there. For instance:</li></ul><pre>&lt;configuration&gt;<br>  &lt;property&gt;<br>    &lt;name&gt;hive.metastore.uris&lt;/name&gt;<br>     &lt;!--Make sure that &lt;value&gt; points to the Hive Metastore URI in your cluster --&gt;<br>     &lt;value&gt;thrift://localhost:9083&lt;/value&gt;<br>     &lt;description&gt;URI for client to contact metastore server&lt;/description&gt;<br>  &lt;/property&gt;<br>&lt;/configuration&gt;</pre><p>Apart from configuring the Hive connection, it is crucial to provide the necessary permissions to the initial users (both OS users and groups) of the TaskManager for Read/Write operations within Hive. Additionally, Read/Write/Execute permissions should be granted to the HDFS path associated with the Hive table.</p><h4>Check</h4><p>Verify whether the task is connected to the appropriate Hive cluster by examining the task log. Here’s how you can proceed:</p><ul><li>INFO HiveConf: indicates the Hive configuration file that was utilized. If you require further information about the loading process, you can review the Spark logs.</li><li>When connecting to the Hive metastore, there should be a log entry similar to INFO metastore: Trying to connect to metastore with URI. A successful connection will be denoted by a log entry reading INFO metastore: Connected to metastore.</li></ul><h3>Usage</h3><h4>Table Creation with LIKE</h4><p>You can use LIKE syntax to create tables, leveraging existing Hive tables, with identical schemas in OpenMLDB.</p><pre>CREATE TABLE db1.t1 LIKE HIVE &#39;hive://hive_db.t1&#39;;<br>-- SUCCEED</pre><h4>Import Hive Data to OpenMLDB</h4><p>Importing data from Hive sources is done through the API <a href="https://openmldb.ai/docs/en/main/openmldb_sql/dml/LOAD_DATA_STATEMENT.html">LOAD DATA INFILE</a>. This operation employs a specialized URI format, hive://[db].table, to seamlessly import data from Hive.</p><pre>LOAD DATA INFILE &#39;hive://db1.t1&#39; INTO TABLE t1 OPTIONS(deep_copy=false);</pre><p>The data loading process also supports using SQL queries to filter specific data from Hive tables. The table name used should be the registered name without the hive:// prefix.</p><pre>LOAD DATA INFILE &#39;hive://db1.t1&#39; INTO TABLE db1.t1 OPTIONS(deep_copy=true, sql=&#39;SELECT * FROM db1.t1 where key=\&quot;foo\&quot;&#39;)</pre><h4>Export OpenMLDB Data to Hive</h4><p>Exporting data to Hive sources is done through the API <a href="https://openmldb.ai/docs/en/main/openmldb_sql/dql/SELECT_INTO_STATEMENT.html">SELECT INTO</a>, which employs a distinct URI hive://[db].table, to seamlessly transfer data to Hive.</p><pre>SELECT col1, col2, col3 FROM t1 INTO OUTFILE &#39;hive://db1.t1&#39;;</pre><h3>Summary</h3><p>This is a brief guide for integration of Hive offline data source with OpenMLDB to best facilitate your application needs. For more details, you can check the official documentation on <a href="https://openmldb.ai/docs/en/main/integration/offline_data_sources/hive.html">Hive integration</a>.</p><p>OpenMLDB community has recently released <a href="https://github.com/4paradigm/FeatInsight">FeatInsight</a>, a sophisticated feature store service, leveraging OpenMLDB for efficient feature computation, management, and orchestration. The service is available for trial at <a href="http://152.136.144.33/">http://152.136.144.33/</a>. Contact us for a user ID and password to gain access!</p><p><strong>For more information on OpenMLDB:</strong></p><ul><li>Official website: <a href="https://openmldb.ai/">https://openmldb.ai/</a></li><li>GitHub: <a href="https://github.com/4paradigm/OpenMLDB">https://github.com/4paradigm/OpenMLDB</a></li><li>Documentation: <a href="https://openmldb.ai/docs/en/">https://openmldb.ai/docs/en/</a></li><li>Join us on <a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"><strong>Slack</strong></a><strong> </strong>!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2e0ea3fd6a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenMLDB v0.8.5 Release: Enhanced Authentication Feature, Comprehensive Security Upgrade]]></title>
            <link>https://openmldb.medium.com/openmldb-v0-8-5-b70b45e51733?source=rss-5e0ba83dc987------2</link>
            <guid isPermaLink="false">https://medium.com/p/b70b45e51733</guid>
            <category><![CDATA[new-releases]]></category>
            <category><![CDATA[openmldb]]></category>
            <dc:creator><![CDATA[OpenMLDB Blogs]]></dc:creator>
            <pubDate>Thu, 29 Feb 2024 05:12:42 GMT</pubDate>
            <atom:updated>2024-05-17T02:13:22.776Z</atom:updated>
            <content:encoded><![CDATA[<h3>Release Date</h3><p>28 February 2024</p><h3>Release Notes</h3><p><a href="https://github.com/4paradigm/OpenMLDB/releases/tag/v0.8.5">https://github.com/4paradigm/OpenMLDB/releases/tag/v0.8.5</a></p><p>OpenMLDB released a new version v0.8.5, including SQL syntax extensions, Iceberg data lake support, TTL type extensions, and improved user authentication functionality. The most noteworthy feature is the integration of the Iceberg engine and the enhancement of user authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EPSO-1u5BuGYR_t-" /></figure><p>Iceberg is an open-source table format data lake management tool, focusing on providing a highly reliable, scalable data lake management solution. Its core features include atomic write mechanisms, multi-version data management, metadata management, etc., aiming to provide comprehensive data lake management functionality for enterprises. OpenMLDB integrates Iceberg into its platform, allowing users to directly read and write Iceberg data lakes while using OpenMLDB’s features. This results in higher data reliability and consistency, more flexible data operations and management, and more efficient data query performance, providing enterprises with a comprehensive and reliable data lake management solution.</p><p>OpenMLDB has also introduced user authentication functionality, allowing users to more flexibly manage and control database access permissions through SQL statements such as CREATE / ALTER / DROP USER. This feature not only ensures the security of the data but also enhances the convenience and flexibility of database management. Users can autonomously manage the creation, modification, and deletion of user accounts according to their actual needs, better meeting the enterprise&#39;s requirements for data access permission management, and improving the overall system&#39;s security and manageability.</p><p>For detailed release notes, please refer to: <a href="https://github.com/4paradigm/OpenMLDB/releases/tag/v0.8.5">https://github.com/4paradigm/OpenMLDB/releases/tag/v0.8.5</a></p><p>Please feel free to download and explore the latest release. Your feedback is highly valued and appreciated. We encourage you to share your thoughts and suggestions to help us improve and enhance the platform. Thank you for your support!</p><h3>Highlights</h3><ul><li>Added integration with Apache Iceberg offline storage engine, supporting data import and feature data export functionalities, further strengthening the integration of OpenMLDB with the ecosystem.</li><li>Added standard SQL syntax UNION ALL, expanding WINDOW UNION and LAST JOIN to achieve multi-table join.</li><li>Support for SELECT INTO OUTFILE to configure OpenMLDB online tables, achieving synchronization between online and offline storage.</li><li>In offline mode, LAST JOIN and WINDOW operations support not specifying ORDER BY parameters, making usage more flexible.</li><li>Added user management functionality, enabling user addition, modification, and deletion through standard SQL statements CREATE / ALTER / DROP USER.</li><li>Support for configuring Spark task parameters through SDK, providing more flexible offline task resource configuration.</li><li>INSERT statement supports configuring server-side memory limits, providing more user-friendly error messages for insertion failures.</li><li>LEFT JOIN statement deployment supports automatic index creation, eliminating the need for manual index creation and data re-importation.</li><li>File storage engine supports TTL types absandlat / absorlat, aligning with in-memory storage engine functionality.</li></ul><p><strong>For more information on OpenMLDB:</strong></p><ul><li>Official website: <a href="https://openmldb.ai/">https://openmldb.ai/</a></li><li>GitHub: <a href="https://github.com/4paradigm/OpenMLDB">https://github.com/4paradigm/OpenMLDB</a></li><li>Documentation: <a href="https://openmldb.ai/docs/en/">https://openmldb.ai/docs/en/</a></li><li>Join us on <a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"><strong>Slack</strong></a><strong> </strong>!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b70b45e51733" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FeatInsight: Leveraging OpenMLDB for Highly Efficient Feature Management and Orchestration]]></title>
            <link>https://openmldb.medium.com/featinsight-leveraging-openmldb-for-highly-efficient-feature-management-and-orchestration-bc01b6f2907d?source=rss-5e0ba83dc987------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc01b6f2907d</guid>
            <category><![CDATA[featinsight]]></category>
            <category><![CDATA[orchestration]]></category>
            <category><![CDATA[feature-management]]></category>
            <category><![CDATA[openmldb]]></category>
            <dc:creator><![CDATA[OpenMLDB Blogs]]></dc:creator>
            <pubDate>Fri, 23 Feb 2024 01:58:45 GMT</pubDate>
            <atom:updated>2024-03-08T05:38:01.583Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Try out our FeatInsight feature platform at <a href="http://152.136.144.33/#/">http://152.136.144.33/#/</a>. Contact us for a user ID and password to gain access!</blockquote><p>The OpenMLDB community has recently released a new open-source feature platform product — <a href="https://github.com/4paradigm/FeatInsight">FeatInsight </a>(https://github.com/4paradigm/FeatInsight).</p><p>FeatInsight is a sophisticated feature store service, leveraging <a href="https://github.com/4paradigm/OpenMLDB">OpenMLDB</a> for efficient feature computation, management, and orchestration.</p><p>FeatInsight provides a user-friendly user interface, allowing users to perform the entire process of feature engineering for machine learning, including data import, viewing and update, feature generation, store, and online deployment. For offline scenarios, users can choose features for training sample generation for ML training; for online scenarios, users can deploy online feature services for real-time feature computations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vAJ9X3jRWmQnRbRLEAah1w.png" /></figure><h3>Key Features</h3><p>The main objective of FeatInsight is to address common challenges in machine learning development, including facilitating easy and quick feature extraction, transformation, combination, and selection, managing feature lineage, enabling feature reuse and sharing, version control for feature services, and ensuring consistency and reliability of feature data used in both training and inference processes. Application scenarios include the following:</p><ul><li>Online Feature Service Deployment: Provides high-performance feature storage and online feature computation functions for localized deployment.</li><li>MLOps Platform: Establishes MLOps workflow with OpenMLDB online-offline consistent computations.</li><li>FeatureStore Platform: Provides comprehensive feature extraction, deletion, online deployment, and lineage management functionality to achieve low-cost local FeatureStore services.</li><li>Open-Source Feature Solution Reuse: Supports solution reuse locally for feature reuse and sharing.</li><li>Business Component for Machine Learning: Provides a one-stop feature engineering solution for machine learning models in recommendation systems, natural language processing, finance, healthcare, and other areas of machine learning implementation.</li></ul><p>For more content, please refer to FeatInsight <a href="https://openmldb.ai/docs/en/main/app_ecosystem/feat_insight/index.html">Documentation</a>.</p><h3>QuickStart</h3><p>We will use a simple example to show how to use FeatInsight to perform feature engineering. The usage process includes the following four steps: data import, feature creation, offline scenarios, and online scenarios.</p><h4>1. Data Import</h4><p>Firstly, create database test_db and data table test_table. You can use SQL to create.</p><pre>CREATE DATABASE test_db;<br>CREATE TABLE test_db.test_table (id STRING, trx_time DATE);</pre><p>Or you can use the UI and create it under “Data Import”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/0*fAsNuEcuAuKxPxHG" /></figure><p>For easier testing, we prepare a CSV file and save it to /tmp/test_table.csv. Note that, this path is a local path for the machine that runs the OpenMLDB TaskManager, usually also the machine for FeatInsight. You will need access to the machine for the edition.</p><pre>id,trx_time<br>user1,2024-01-01<br>user2,2024-01-02<br>user3,2024-01-03<br>user4,2024-01-04<br>user5,2024-01-05<br>user6,2024-01-06<br>user7,2024-01-07</pre><p>For online scenarios, you can use the command LOAD DATA or INSERT. Here we use &quot;Import from CSV&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/0*SA_ahc-gr-KdxQoW" /></figure><p>The imported data can be previewed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/0*zslCR2m4JDLRX2F9" /></figure><p>For offline scenarios, you can also use LOAD_DATA or &quot;Import from CSV&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nJXy3ZVC6_wDGMjZ" /></figure><p>Wait for about half a minute for the task to finish. You can also check the status and log.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uRfWllebyLSTIPlK" /></figure><h4>2. Feature Creation</h4><p>After data imports, we can create features. Here we use SQL to create two basic features.</p><pre>SELECT id, dayofweek(trx_time) as trx_day FROM test_table</pre><p>In “Features”, the button beside “All Features” is to create new features. Fill in the form accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*W_yPog3z6G6d1QP8" /></figure><p>After successful creation, you can check the features. Click on the name to go into details. You can check the basic information, as well as preview feature values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HZbp68_k0Pr7EptI" /></figure><h4>3. Offline Samples Export</h4><p>In “Offline Scenario”, you can choose to export offline samples. You can choose the features to export and specify the export path. There are “More Options” for you to specify the file format and other advanced parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9JIclPEPFGQlb3m6" /></figure><p>Wait for about half a minute and you can check the status at “Offline Samples”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H7F-Dny4Mydo36ft" /></figure><p>You can check the content of the exported samples. To verify online-offline consistency provided by FeatInsight, you can record the result and compare it with online feature computation results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/0*XTsFasaMSdEa6mJu" /></figure><h4>4. Online Feature Service</h4><p>In “Feature Services”, the button beside “All Feature Services” is to create a new feature service. You can choose the features to deploy, and fill in the service name and version accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PR26Hq2qZb09j0iz" /></figure><p>After successful creation, you can check service details, including the feature list, dependent tables, and lineage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gqIk-leJBHbIwFBz" /></figure><p>Lastly, on the “Request Feature Service” page, we can key in test data to perform online feature calculation, and compare it with offline computation results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C-2aUiA8wi9q36Ww" /></figure><h3>Summary</h3><p>This example demonstrates the complete process of using FeatInsight. By writing simple SQL statements, users can define features for both online and offline scenarios. By selecting different features or combining feature sets, users can quickly reuse and deploy feature services. Lastly, the consistency of feature computation can be validated by comparing offline and online calculation results.</p><p>If you want to have a further understanding of how to use FeatInsight and its application scenarios, please refer to <a href="https://openmldb.ai/docs/en/main/app_ecosystem/feat_insight/use_cases/index.html">Application Scenarios</a>.</p><h3>Appendix: Advanced Functions</h3><p>In addition to the basic functionalities of feature engineering, FeatInsight also provides advanced functionalities to facilitate feature development for users:</p><ul><li>SQL Playground: Offers debugging and execution capabilities for OpenMLDB SQL statements, allowing users to execute arbitrary SQL operations and debug SQL statements for feature extraction.</li><li>Computed Features: Enables the direct storage of feature values obtained through external batch computation or stream processing into OpenMLDB online tables. Users can then access and manipulate feature data in online tables.</li></ul><h3>Read More:</h3><ul><li>FeatInsight Github: <a href="https://github.com/4paradigm/FeatInsight">https://github.com/4paradigm/FeatInsight</a></li><li>FeatInsight documentation: <a href="https://openmldb.ai/docs/en/main/app_ecosystem/feat_insight/index.html">https://openmldb.ai/docs/en/main/app_ecosystem/feat_insight/index.html</a></li></ul><p><strong>For more information on OpenMLDB:</strong></p><ul><li>Official website: <a href="https://openmldb.ai/">https://openmldb.ai/</a></li><li>GitHub: <a href="https://github.com/4paradigm/OpenMLDB">https://github.com/4paradigm/OpenMLDB</a></li><li>Documentation: <a href="https://openmldb.ai/docs/en/">https://openmldb.ai/docs/en/</a></li><li>Join us on <a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"><strong>Slack</strong></a><strong> </strong>!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc01b6f2907d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenMLDB Selected as the Sole Feature Store Vendor from China in the 2023 Gartner Report]]></title>
            <link>https://openmldb.medium.com/openmldb-selected-as-the-sole-feature-store-vendor-from-china-in-the-2023-gartner-report-f91100380daa?source=rss-5e0ba83dc987------2</link>
            <guid isPermaLink="false">https://medium.com/p/f91100380daa</guid>
            <category><![CDATA[gartner]]></category>
            <category><![CDATA[openmldb]]></category>
            <category><![CDATA[feature-store]]></category>
            <dc:creator><![CDATA[OpenMLDB Blogs]]></dc:creator>
            <pubDate>Sun, 11 Feb 2024 07:10:47 GMT</pubDate>
            <atom:updated>2024-02-28T09:47:24.476Z</atom:updated>
            <content:encoded><![CDATA[<p>In the report “The Logical Feature Store: Data Management for Machine Learning” published by the International Authoritative Consulting and Research firm, Gartner, OpenMLDB is honored to be selected as the sole representative feature store vendor from China.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kEqB4-TF4xCGr6wNp5krxg.png" /></figure><p>The report thoroughly analyzes the three major challenges faced by current machine learning applications in the practical implementation process: Low End-to-end Efficiency, Lack of Reusability, and Inconsistency between Training and Production Environments. This explains the urgent necessity of a feature store. Considering the challenges posed by the high complexity and resource allocation involved in developing feature stores, Gartner firmly believes that, compared to in-house development, seeking external procurement, especially purchasing from MLOps vendors with built-in feature stores, is a more cost-effective choice. In this regard, OpenMLDB has successfully been included in Gartner’s recommended list of vendors for its outstanding performance, becoming the only Chinese ML vendor with a built-in feature store. This report provides valuable professional guidance for enterprises eager to expand the scale of their AI implementation in business.</p><h3>OpenMLDB: Providing a Consistent Production-level Feature Store Online and Offline, Achieving a 500% Efficiency Improvement per Unit Cost</h3><p>Gartner emphasizes the challenges of machine learning in practical applications in its report. Typically, machine learning teams in enterprises find themselves investing significant time in addressing data issues, leaving little room for focusing on actual model development and optimization. During this process, there is a notable prevalence of inconsistent feature definitions and frequent repetitive rework. Similar observations are revealed in OpenMLDB’s research, “In the Realm of Artificial Intelligence Engineering Practices, Enterprises Often Allocate a Staggering 95% of their Overall Time and Effort to Tasks such as Data Processing and Feature Validation”.</p><p>In the traditional approach without OpenMLDB, the deployment of real-time feature computations typically involves the following three steps: (1) Data scientists develop feature scripts offline using SparkSQL or Python; (2) As the developed offline scripts cannot meet the requirements of the production environment, the engineering team needs to reoptimize them based on a different tool stack; (3) Finally, there is a need for consistency validation of the offline feature scripts developed by data scientists and the online services developed by the engineering team. The entire process involves two groups of developers and two sets of tool stacks, resulting in significant deployment costs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*rpGKEuu6O_QNOxGqQXFpvw.png" /></figure><p>OpenMLDB aims for a seamless transition from development to deployment, allowing feature scripts developed by data scientists to be directly deployed in the production environment. The platform is equipped with both offline and online processing engines, with the online engine being deeply optimized to meet both production-level online requirements and ensure consistency between online and offline through an automatic consistency execution plan generator. Utilizing OpenMLDB, the implementation of machine learning applications in the feature phase involves only two steps: (1) Data scientists develop offline feature scripts using SQL, and (2) deploying the feature script to the online engine with a single deployment command. This approach ensures consistency between online and offline while successfully achieving millisecond-level low latency, high concurrency, and high availability for online services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*em_Qs0k2LW0SYqdTtQuVvA.png" /></figure><p>Therefore, the greatest value of OpenMLDB lies in significantly reducing the engineering deployment costs of artificial intelligence. In a larger business scenario, OpenMLDB can achieve a remarkable reduction from the traditional approach, where 6 person/ month was required, to just 1 person/ month. This results in a 500% efficiency improvement per unit cost by eliminating the need for the engineering team to develop online services and conduct online-offline consistency checks.</p><h3>OpenMLDB X Akulaku: By Scenario-driven Approach, Windowed Feature Computation for One Billion Orders Achieves 4 Milliseconds Latency Performance, Saving over 4 Million Resources</h3><p>OpenMLDB is committed to addressing the data governance challenges in the implementation of AI engineering and has already been deployed in over a hundred enterprise-level AI scenarios. Among them, Akulaku, as a leading internet finance service provider in Southeast Asia, covers the entire e-commerce chain, with applications spanning financial risk control, intelligent customer service, and e-commerce recommendations. In numerous scenarios, Akulaku requires the implementation of corresponding AI applications. In the field of e-commerce finance, there is often a high demand for the feature store, requiring online deployment with low latency and high efficiency. It needs to reflect real-time feature computation for new data as much as possible, while offline demand analysis requires high throughput. At the same time, consistency between online and offline must be ensured. Meeting all three requirements simultaneously is a challenging task.</p><p>To address this challenge, OpenMLDB has assisted Akulaku in building an intelligent computing architecture. This involves embedding OpenMLDB’s online engine into the model computation layer and embedding the offline engine into the feature computation layer. Through a scenario-driven approach, real-time computation results are invoked in the business calling process. This approach has successfully performed windowed feature computation for one billion orders, achieving a 4-millisecond latency performance and conservatively estimated resource savings of over 4 million.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*L4ppIB9S6ctPoDV2-MZV1A.png" /></figure><p>In addition, OpenMLDB has assisted numerous enterprises in optimizing their database architecture, facilitating more effective implementation of AI scenarios. For example, it helped Vipshop reduce the feature development and iteration time for personalized product recommendations from 5 person/ day to 2 person/ day, resulting in a 60% improvement in feature development iteration speed. A leading bank’s anti-fraud system utilized OpenMLDB for feature computation and management in offline development, online inference, and self-learning stages. This resolved long-standing issues of data traversal and inconsistent results, eliminating the need for expensive consistency verification costs. Huawei, after implementing OpenMLDB for real-time personalized product recommendations, achieved minute-level data updates and hour-level feature deployment. Looking ahead, OpenMLDB aims to assist more enterprises in addressing real-world challenges in data and feature processing for successful business implementation.</p><p>As the sole representative of a database feature store from China selected in the Gartner report “The Logical Feature Store: Data Management for Machine Learning,” OpenMLDB will continue refining its product, optimizing performance, and leveraging its strengths in the field of database feature platforms. The aim is to liberate AI practitioners from tedious and inefficient data processing, assisting enterprises in achieving simpler and more efficient implementations of machine learning applications.</p><p><strong>For more information on OpenMLDB:</strong></p><ul><li>Official website: <a href="https://openmldb.ai/">https://openmldb.ai/</a></li><li>GitHub: <a href="https://github.com/4paradigm/OpenMLDB">https://github.com/4paradigm/OpenMLDB</a></li><li>Documentation: <a href="https://openmldb.ai/docs/en/">https://openmldb.ai/docs/en/</a></li><li>Join us on <a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"><strong>Slack</strong></a><strong> </strong>!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f91100380daa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Deployment Guide for OpenMLDB]]></title>
            <link>https://openmldb.medium.com/kubernetes-deployment-guide-for-openmldb-4796a66f5b3f?source=rss-5e0ba83dc987------2</link>
            <guid isPermaLink="false">https://medium.com/p/4796a66f5b3f</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[openmldb]]></category>
            <dc:creator><![CDATA[OpenMLDB Blogs]]></dc:creator>
            <pubDate>Fri, 12 Jan 2024 06:38:04 GMT</pubDate>
            <atom:updated>2024-01-16T04:14:56.503Z</atom:updated>
            <content:encoded><![CDATA[<p>Kubernetes is a widely adopted cloud-native container orchestration and management tool in the industry that has been extensively used in project implementations. Currently, both the offline and online engines of OpenMLDB have complete support for deployment based on Kubernetes, enabling more convenient management functionalities. This article will respectively introduce the deployment strategies of the offline and online engines based on Kubernetes.</p><p>It’s important to note that the deployment of the offline engine and the online engine based on Kubernetes are entirely decoupled. Users have the flexibility to deploy either the offline or online engine based on their specific requirements.</p><p>Besides Kubernetes-based deployment, the offline engine also supports deployment in local mode and yarn mode. Similarly, the online engine supports a native deployment method that doesn&#39;t rely on containers. These deployment strategies can be flexibly mixed and matched in practical scenarios to meet the demands of production environments.</p><h3>Offline Engine with Kubernetes Backend</h3><h4>Deployment of Kubernetes Operator for Apache Spark</h4><p>Please refer to <a href="https://github.com/GoogleCloudPlatform/spark-on-k8s-operator">spark-on-k8s-operator official documentation</a>. The following is the command to deploy to the default namespace using Helm. Modify the namespace and permission as required.</p><pre>helm install my-release spark-operator/spark-operator --namespace default --create-namespace --set webhook.enable=true<br>kubectl create serviceaccount spark --namespace default<br>kubectl create clusterrolebinding binding --clusterrole=edit --serviceaccount=default:spark</pre><p>After successful deployment, you can use the code examples provided by spark-operator to test whether Spark tasks can be submitted normally.</p><h4>HDFS Support</h4><p>If you need to configure Kubernetes tasks to read and write HDFS data, you need to prepare a Hadoop configuration file in advance and create a ConfigMap. You can modify the ConfigMap name and file path as needed. The creation command example is as follows:</p><pre>kubectl create configmap hadoop-config --from-file=/tmp/hadoop/etc/</pre><h4>Offline Engine Configurations for Kubernetes Support</h4><p>The configuration file for TaskManager in the offline engine can be configured for Kubernetes support, respective settings are:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46698a47473ca417b96acb7350210adb/href">https://medium.com/media/46698a47473ca417b96acb7350210adb/href</a></iframe><p>If Kubernetes is used to run the offline engine, the user’s computation tasks will run on the cluster. Therefore, it’s recommended to configure the offline storage path as an HDFS path; otherwise, it might lead to data read/write failures in tasks. Example configuration for the item is as follows:</p><pre>offline.data.prefix=hdfs:///foo/bar/</pre><p>💡<em>For a complete configuration file example for TaskManager in OpenMLDB offline engine, visit: </em><a href="https://openmldb.ai/docs/en/main/deploy/conf.html#he-configuration-file-for-taskmanager-conf-taskmanager-properties"><em>https://openmldb.ai/docs/en/main/deploy/conf.html#he-configuration-file-for-taskmanager-conf-taskmanager-properties</em></a></p><h4>Task Submission and Management</h4><p>After configuring TaskManager and Kubernetes, you can submit offline tasks via the command line. The usage is similar to that of the local or YARN mode, allowing not only usage within the SQL command-line client but also via SDKs in various programming languages.</p><p>For instance, to submit a data import task:</p><pre>LOAD DATA INFILE &#39;hdfs:///hosts&#39; INTO TABLE db1.t1 OPTIONS(delimiter = &#39;,&#39;, mode=&#39;overwrite&#39;);</pre><p>Check Hadoop ConfigMap:</p><pre>kubectl get configmap hdfs-config -o yaml</pre><p>Check Spark job and Pod log:</p><pre>kubectl get SparkApplicationkubectl get pods</pre><h3>Online Engine Deployment with Kubernetes</h3><h4>Github</h4><p>The deployment of online engine based on Kubernetes is supported as a separate tool for OpenMLDB. Its source code repository is located at: <a href="https://github.com/4paradigm/openmldb-k8s">https://github.com/4paradigm/openmldb-k8s</a></p><h4>Requirement</h4><p>This deployment tool offers a Kubernetes-based deployment solution for the OpenMLDB online engine, implemented using Helm Charts. The tool has been tested and verified with the following versions:</p><ul><li>Kubernetes 1.19+</li><li>Helm 3.2.0+</li></ul><p>Additionally, for users who utilize pre-compiled OpenMLDB images from Docker Hub, only OpenMLDB versions &gt;= 0.8.2 are supported. Users also have the option to create other versions of OpenMLDB images using the tool described in the last section of this article.</p><h4>Preparation: Deploy ZooKeeper</h4><p>If there is an available ZooKeeper instance, you can skip this step. Otherwise, proceed with the installation process:</p><pre>helm install zookeeper oci://registry-1.docker.io/bitnamicharts/zookeeper --set persistence.enabled=false</pre><p>You can specify a previously created storage class for persistent storage:</p><pre>helm install zookeeper oci://registry-1.docker.io/bitnamicharts/zookeeper --set persistence.storageClass=local-storage</pre><p>For more parameter settings, refer to <a href="https://github.com/bitnami/charts/tree/main/bitnami/zookeeper">here</a></p><h4>OpenMLDB Deployment</h4><p><strong>Download Source Code</strong></p><p>Download the source code and set the working directory to the root directory of the repository.</p><pre>git clone https://github.com/4paradigm/openmldb-k8s.git<br>cd openmldb-k8s</pre><p><strong>Configure ZooKeeper Address</strong></p><p>Modify the zk_cluster in the charts/openmldb/conf/tablet.flags and charts/openmldb/conf/nameserver.flags files to the actual ZooKeeper address, with the default zk_root_path set to /openmldb.</p><p><strong>Deploy OpenMLDB</strong></p><p>You can achieve one-click deployment using Helm with the following commands:</p><pre>helm install openmldb ./charts/openmldb</pre><p>Users have the flexibility to configure additional deployment options using the --set command. Detailed information about supported options can be found in the <a href="https://github.com/4paradigm/openmldb-k8s/blob/main/charts/openmldb/README.md">OpenMLDB Chart Configuration</a>.</p><p>Important configuration considerations include:</p><ul><li>By default, temporary files are used for data storage, which means that data may be lost if the pod restarts. It is recommended to associate a Persistent Volume Claim (PVC) with a specific storage class using the following method:</li></ul><pre>helm install openmldb ./charts/openmldb --set persistence.dataDir.enabled=true --set  persistence.dataDir.storageClass=local-storage</pre><ul><li>By default, the 4pdosc/openmldb-online image from Docker Hub is utilized (supporting OpenMLDB &gt;= 0.8.2). If you prefer to use a custom image, you can specify the image name during installation with --set image.openmldbImage. For information on creating custom images, refer to the last section of this article.</li></ul><pre>helm install openmldb ./charts/openmldb --set image.openmldbImage=openmldb-online:0.8.4</pre><p><strong>Note</strong></p><ul><li>Deployed OpenMLDB services can only be accessed within the same namespace within Kubernetes.</li><li>The OpenMLDB cluster deployed using this method does not include a TaskManager module. Consequently, statements such as <a href="https://openmldb.ai/docs/en/main/openmldb_sql/dml/LOAD_DATA_STATEMENT.html">LOAD DATA</a> and <a href="https://openmldb.ai/docs/en/main/openmldb_sql/dql/SELECT_INTO_STATEMENT.html">SELECT INTO</a>, and offline-related functions are not supported. If you need to import data into OpenMLDB, you can use OpenMLDB’s <a href="https://openmldb.ai/docs/en/main/tutorial/data_import.html">Online Import Tool</a>, <a href="https://openmldb.ai/docs/en/main/integration/online_datasources/index.html">OpenMLDB Connector</a>, or SDK. For exporting table data, the <a href="https://openmldb.ai/docs/en/main/tutorial/data_export.html">Online Data Export Tool</a> can be utilized.</li><li>For production, it’s necessary to disable Transparent Huge Pages (THP) on the physical node where Kubernetes deploys the tablet. Failure to do so may result in issues where deleted tables cannot be fully released. For instructions on disabling THP, please refer to <a href="https://openmldb.ai/docs/en/main/deploy/install_deploy.html#disable-thp-transparent-huge-pages">this link</a>.</li></ul><h3>Create Docker Image</h3><p>The default deployment uses the OpenMLDB docker image from Docker Hub. Users can also create their local docker image. The creation tool is located in the repository (<a href="https://github.com/4paradigm/openmldb-k8s">https://github.com/4paradigm/openmldb-k8s</a>) as docker/build.sh.</p><p>This script supports two parameters:</p><ul><li>OpenMLDB version number.</li><li>Source of the OpenMLDB package. By default, it pulls the package from a mirror in mainland China. If you want to pull it from GitHub, you can set the second parameter to github.</li></ul><pre>cd docker<br>sh build.sh 0.8.4</pre><p>For more information on OpenMLDB:</p><ul><li>Official website: <a href="https://openmldb.ai/">https://openmldb.ai/</a></li><li>GitHub: <a href="https://github.com/4paradigm/OpenMLDB">https://github.com/4paradigm/OpenMLDB</a></li><li>Documentation: <a href="https://openmldb.ai/docs/en/">https://openmldb.ai/docs/en/</a></li><li>Join us on <a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"><strong>Slack</strong></a><strong> </strong>!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4796a66f5b3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>