<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hana Wang</title>
    <description>The latest articles on DEV Community by Hana Wang (@elliezza).</description>
    <link>https://dev.to/elliezza</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1186254%2Fb3a47378-3576-44b3-9cd3-e940992605b7.JPG</url>
      <title>DEV Community: Hana Wang</title>
      <link>https://dev.to/elliezza</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/elliezza"/>
    <language>en</language>
    <item>
      <title>Introducing OpenMLDB’s New Feature: Feature Signatures — Enabling Complete Feature Engineering with SQL</title>
      <dc:creator>Hana Wang</dc:creator>
      <pubDate>Thu, 23 May 2024 08:42:00 +0000</pubDate>
      <link>https://dev.to/elliezza/introducing-openmldbs-new-feature-feature-signatures-enabling-complete-feature-engineering-with-sql-26l1</link>
      <guid>https://dev.to/elliezza/introducing-openmldbs-new-feature-feature-signatures-enabling-complete-feature-engineering-with-sql-26l1</guid>
      <description>&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;Rewinding to 2020, the Feature Engine team of Fourth Paradigm submitted and passed an invention patent titled “&lt;a href="https://patents.google.com/patent/CN111752967A" rel="noopener noreferrer"&gt;Data Processing Method, Device, Electronic Equipment, and Storage Medium Based on SQL&lt;/a&gt;”. This patent innovatively combines the SQL data processing language with machine learning feature signatures, greatly expanding the functional boundaries of SQL statements.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2560%2F1%2AV5fQ3koN8HFikmZWJPtykA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2560%2F1%2AV5fQ3koN8HFikmZWJPtykA.png" alt="Screenshot of Patent in Cinese"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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).&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feature Signatures and Label Signatures
&lt;/h2&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;continuous(column)&lt;/code&gt;: Indicates that the column is a continuous feature; the column can be of any numerical type.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;discrete(column[, bucket_size])&lt;/code&gt;: 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 &lt;code&gt;bucket_size&lt;/code&gt; sets the number of buckets. If &lt;code&gt;bucket_size&lt;/code&gt; is not specified, the range of values is the entire range of the int64 type.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;binary_label(column)&lt;/code&gt;: Indicates that the column is a binary classification label; the column must be of boolean type.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;multiclass_label(column)&lt;/code&gt;: Indicates that the column is a multiclass classification label; the column can be of boolean type or integer type.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;regression_label(column)&lt;/code&gt;: Indicates that the column is a regression label; the column can be of any numerical type.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These functions must be used in conjunction with the sample format functions &lt;code&gt;csv&lt;/code&gt; or &lt;code&gt;libsvm&lt;/code&gt; and cannot be used independently. &lt;code&gt;csv&lt;/code&gt; and &lt;code&gt;libsvm&lt;/code&gt; can accept any number of parameters, and each parameter needs to be specified using functions like &lt;code&gt;continuous&lt;/code&gt; to determine how to sign it. OpenMLDB handles null and erroneous data appropriately, retaining the maximum amount of sample information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage Example
&lt;/h2&gt;

&lt;p&gt;First, follow the &lt;a href="https://openmldb.ai/docs/en/main/tutorial/standalone_use.html" rel="noopener noreferrer"&gt;quick start&lt;/a&gt; guide to get the image and start the OpenMLDB server and client.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-it&lt;/span&gt; 4pdosc/openmldb:0.9.0 bash
/work/init.sh
/work/openmldb/sbin/openmldb-cli.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a database and import data in the OpenMLDB client.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;--OpenMLDB CLI&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;demo_db&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;demo_db&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;t1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vendor_id&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pickup_datetime&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dropoff_datetime&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;passenger_count&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pickup_longitude&lt;/span&gt; &lt;span class="nb"&gt;double&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pickup_latitude&lt;/span&gt; &lt;span class="nb"&gt;double&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dropoff_longitude&lt;/span&gt; &lt;span class="nb"&gt;double&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dropoff_latitude&lt;/span&gt; &lt;span class="nb"&gt;double&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;store_and_fwd_flag&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;trip_duration&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="o"&gt;@@&lt;/span&gt;&lt;span class="n"&gt;execute_mode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'offline'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;LOAD&lt;/span&gt; &lt;span class="k"&gt;DATA&lt;/span&gt; &lt;span class="n"&gt;INFILE&lt;/span&gt; &lt;span class="s1"&gt;'/work/taxi-trip/data/taxi_tour_table_train_simple.snappy.parquet'&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;t1&lt;/span&gt; &lt;span class="k"&gt;options&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'parquet'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;mode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'append'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the &lt;code&gt;SHOW JOBS&lt;/code&gt; command to check the task running status. After the task is successfully executed, perform feature engineering and export the training data in CSV format.&lt;/p&gt;

&lt;p&gt;Currently, OpenMLDB does not support overly long column names, so specifying the column name of the sample as &lt;code&gt;instance&lt;/code&gt; using &lt;code&gt;SELECT csv(...)&lt;/code&gt; AS instance is necessary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;--OpenMLDB CLI&lt;/span&gt;
&lt;span class="n"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;demo_db&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="o"&gt;@@&lt;/span&gt;&lt;span class="n"&gt;execute_mode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'offline'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;t1&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;trip_duration&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;passenger_count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pickup_latitude&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;vendor_sum_pl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vendor_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;vendor_cnt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;t1&lt;/span&gt;
    &lt;span class="k"&gt;WINDOW&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;vendor_id&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;pickup_datetime&lt;/span&gt; &lt;span class="n"&gt;ROWS_RANGE&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="k"&gt;PRECEDING&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="k"&gt;CURRENT&lt;/span&gt; &lt;span class="k"&gt;ROW&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;regression_label&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;trip_duration&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;continuous&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;passenger_count&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;continuous&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vendor_sum_pl&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;continuous&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vendor_cnt&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;discrete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vendor_cnt&lt;/span&gt; &lt;span class="n"&gt;DIV&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;instance&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;t1&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;OUTFILE&lt;/span&gt; &lt;span class="s1"&gt;'/tmp/feature_data_csv'&lt;/span&gt; &lt;span class="k"&gt;OPTIONS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'csv'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If LIBSVM format training data is needed, simply change &lt;code&gt;SELECT csv(...)&lt;/code&gt; to &lt;code&gt;SELECT libsvm(...)&lt;/code&gt;. Note that the &lt;code&gt;OPTIONS&lt;/code&gt; should still use the CSV format because the exported data only has one column, which already contains the complete LIBSVM format sample.&lt;/p&gt;

&lt;p&gt;Moreover, the &lt;code&gt;libsvm&lt;/code&gt; 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.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;--OpenMLDB CLI&lt;/span&gt;
&lt;span class="n"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;demo_db&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="o"&gt;@@&lt;/span&gt;&lt;span class="n"&gt;execute_mode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'offline'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;t1&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;trip_duration&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;passenger_count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pickup_latitude&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;vendor_sum_pl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vendor_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;vendor_cnt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;t1&lt;/span&gt;
    &lt;span class="k"&gt;WINDOW&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;vendor_id&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;pickup_datetime&lt;/span&gt; &lt;span class="n"&gt;ROWS_RANGE&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="k"&gt;PRECEDING&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="k"&gt;CURRENT&lt;/span&gt; &lt;span class="k"&gt;ROW&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;libsvm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;regression_label&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;trip_duration&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;continuous&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;passenger_count&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;continuous&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vendor_sum_pl&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;continuous&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vendor_cnt&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;discrete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vendor_cnt&lt;/span&gt; &lt;span class="n"&gt;DIV&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;instance&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;t1&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;OUTFILE&lt;/span&gt; &lt;span class="s1"&gt;'/tmp/feature_data_libsvm'&lt;/span&gt; &lt;span class="k"&gt;OPTIONS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'csv'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;For more information on OpenMLDB:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Official website: &lt;a href="https://openmldb.ai/" rel="noopener noreferrer"&gt;https://openmldb.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/4paradigm/OpenMLDB" rel="noopener noreferrer"&gt;https://github.com/4paradigm/OpenMLDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/en/" rel="noopener noreferrer"&gt;https://openmldb.ai/docs/en/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join us on &lt;a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg" rel="noopener noreferrer"&gt;&lt;strong&gt;Slack&lt;/strong&gt;&lt;/a&gt;!&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This post is a re-post from &lt;a href="https://openmldb.medium.com/" rel="noopener noreferrer"&gt;OpenMLDB Blogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>featureengineering</category>
      <category>sql</category>
      <category>featuresignatures</category>
      <category>openmldb</category>
    </item>
    <item>
      <title>OpenMLDB v0.9.0 Release: Major Upgrade in SQL Capabilities Covering the Entire Feature Servicing Process</title>
      <dc:creator>Hana Wang</dc:creator>
      <pubDate>Fri, 03 May 2024 03:22:41 +0000</pubDate>
      <link>https://dev.to/elliezza/openmldb-v090-release-major-upgrade-in-sql-capabilities-covering-the-entire-feature-servicing-process-bfo</link>
      <guid>https://dev.to/elliezza/openmldb-v090-release-major-upgrade-in-sql-capabilities-covering-the-entire-feature-servicing-process-bfo</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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 “&lt;a href="https://openmldb.medium.com/ultra-high-performance-database-openm-ysq-ldb-seamless-compatibility-with-mysql-protocol-and-d3f60210feea"&gt;&lt;strong&gt;Ultra High-Performance Database OpenM(ysq)LDB: Seamless Compatibility with MySQL Protocol and Multi-Language MySQL Client&lt;/strong&gt;&lt;/a&gt;”.&lt;/p&gt;

&lt;p&gt;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 &lt;code&gt;Deploy&lt;/code&gt; command and then perform online feature computation through SDKs or HTTP interfaces. The new version adds &lt;code&gt;SELECT CONFIG&lt;/code&gt; and &lt;code&gt;CALL&lt;/code&gt; statements, allowing users to directly specify request mode and sample data in SQL to compute feature results, as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Execute online request mode query for action (10, "foo", timestamp(4000))
SELECT id, count(val) over (partition by id order by ts rows between 10 preceding and current row)
FROM t1
CONFIG (execute_mode = 'online', values = (10, "foo", timestamp(4000)))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use the ANSI SQL &lt;code&gt;CALL&lt;/code&gt; statement to invoke stored procedures with sample rows as parameters, as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Execute online request mode query for action (10, "foo", timestamp(4000))
DEPLOY window_features SELECT id, count(val) over (partition by id order by ts rows between 10 preceding and current row)
FROM t1;

CALL window_features(10, "foo", timestamp(4000))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For detailed release notes, please refer to: &lt;a href="https://github.com/4paradigm/OpenMLDB/releases/tag/v0.9.0"&gt;https://github.com/4paradigm/OpenMLDB/releases/tag/v0.9.0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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!&lt;/p&gt;

&lt;h2&gt;
  
  
  Release Date
&lt;/h2&gt;

&lt;p&gt;April 25, 2024&lt;/p&gt;

&lt;h2&gt;
  
  
  Release Note
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/4paradigm/OpenMLDB/releases/tag/v0.9.0"&gt;https://github.com/4paradigm/OpenMLDB/releases/tag/v0.9.0&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Highlighted Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Added support for the latest version of SQLAlchemy 2, seamlessly integrating with popular Python frameworks such as Pandas and Numpy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Expanded support for more data backends, integrating TiDB’s distributed file storage capability with OpenMLDB’s high-performance in-memory feature computation capability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enhanced ANSI SQL support, fixed &lt;code&gt;first_value&lt;/code&gt; semantics, supported &lt;code&gt;MAP&lt;/code&gt; type and feature signatures, and added offline mode support for &lt;code&gt;INSERT&lt;/code&gt; statements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Added support for MySQL protocol, allowing access to OpenMLDB clusters using MySQL clients like NaviCat, Sequal Ace, and various MySQL SDKs for programming languages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extended SQL syntax support, enabling online feature computation directly through &lt;code&gt;SELECT CONFIG&lt;/code&gt; or &lt;code&gt;CALL&lt;/code&gt; statements.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;For more information on OpenMLDB:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Official website: &lt;a href="https://openmldb.ai/"&gt;https://openmldb.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/4paradigm/OpenMLDB"&gt;https://github.com/4paradigm/OpenMLDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/en/"&gt;https://openmldb.ai/docs/en/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join us on &lt;a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"&gt;&lt;strong&gt;Slack&lt;/strong&gt;&lt;/a&gt;!&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This post is a re-post from &lt;a href="https://openmldb.medium.com/"&gt;OpenMLDB Blogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>Comparative Analysis of Memory Consumption: OpenMLDB vs Redis Test Report</title>
      <dc:creator>Hana Wang</dc:creator>
      <pubDate>Wed, 03 Apr 2024 03:56:42 +0000</pubDate>
      <link>https://dev.to/elliezza/comparative-analysis-of-memory-consumption-openmldb-vs-redis-test-report-2gf5</link>
      <guid>https://dev.to/elliezza/comparative-analysis-of-memory-consumption-openmldb-vs-redis-test-report-2gf5</guid>
      <description>&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test Environment
&lt;/h2&gt;

&lt;p&gt;This test is based on physical machine deployment (40C250G * 3) with the following hardware specifications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU: Intel(R) Xeon(R) CPU E5–2630 v4 @ 2.20GHz&lt;/li&gt;
&lt;li&gt;Processor: 40 Cores&lt;/li&gt;
&lt;li&gt;Memory: 250 G&lt;/li&gt;
&lt;li&gt;Storage: HDD 7.3T * 4&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The software versions are as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UOsbIhEV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ACMmxhQ8_Tny81f6_vDkKBw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UOsbIhEV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ACMmxhQ8_Tny81f6_vDkKBw.png" alt="" width="596" height="106"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Test Methods
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Method One: Random Data Generation&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example
&lt;/h4&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h4&gt;
  
  
  Configurable Parameters
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YOfk8RWH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A7unY38PGdSYuRiZNNKopqw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YOfk8RWH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A7unY38PGdSYuRiZNNKopqw.png" alt="" width="665" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Operations Steps (Reproducible Steps)
&lt;/h4&gt;

&lt;h5&gt;
  
  
  a. Deploy OpenMLDB and Redis
&lt;/h5&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;OpenMLDB&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker image: &lt;code&gt;docker pull 4pdosc/openmldb:0.8.5&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/zh/main/quickstart/openmldb_quickstart.html"&gt;https://openmldb.ai/docs/zh/main/quickstart/openmldb_quickstart.html&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Redis:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker image: &lt;code&gt;docker pull redis:7.2.4&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://hub.docker.com/_/redis"&gt;https://hub.docker.com/_/redis&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  b. Pull the &lt;a href="https://github.com/4paradigm/OpenMLDB/tree/main/benchmark"&gt;testing code&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  c. Modify configuration
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Configuration file: &lt;code&gt;src/main/resources/memory.properties&lt;/code&gt; [&lt;a href="https://github.com/4paradigm/OpenMLDB/blob/main/benchmark/src/main/resources/memory.properties"&gt;link&lt;/a&gt;]&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Note: Ensure that &lt;code&gt;REDIS_HOST_PORT&lt;/code&gt; and &lt;code&gt;ZK_CLUSTER&lt;/code&gt; 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.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  d. Rut the tests
&lt;/h5&gt;

&lt;p&gt;[Related paths in the GitHub benchmark Readme]&lt;/p&gt;

&lt;h5&gt;
  
  
  e. Check the output results
&lt;/h5&gt;

&lt;h3&gt;
  
  
  Method Two: Using the Open Source Dataset TalkingData
&lt;/h3&gt;

&lt;p&gt;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 &lt;a href="https://openmldb.ai/docs/en/main/use_case/talkingdata_demo.html"&gt;OpenMLDB for ad fraud detection&lt;/a&gt;. Here, we utilize the TalkingData train dataset, which can be obtained as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Sample data: &lt;a href="https://github.com/4paradigm/OpenMLDB/blob/main/demo/talkingdata-adtracking-fraud-detection/train_sample.csv"&gt;sample data used in OpenMLDB&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Full data: Available on &lt;a href="https://www.kaggle.com/c/talkingdata-adtracking-fraud-detection/data"&gt;Kaggle&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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”).&lt;/p&gt;

&lt;h4&gt;
  
  
  Example
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3XvINGfI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AXPXdzaRIq68z6LdBwEaY8Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3XvINGfI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AXPXdzaRIq68z6LdBwEaY8Q.png" alt="" width="662" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Configurable Parameters
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BNl53h6r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AovUBAeCcDeADBcedmJapeQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BNl53h6r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AovUBAeCcDeADBcedmJapeQ.png" alt="" width="663" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Operation Steps (Reproducible Steps)
&lt;/h4&gt;

&lt;h5&gt;
  
  
  a. Deploy OpenMLDB and Redis
&lt;/h5&gt;

&lt;p&gt;Same as in method one.&lt;/p&gt;

&lt;h5&gt;
  
  
  b. Pull the &lt;a href="https://github.com/4paradigm/OpenMLDB/tree/main/benchmark"&gt;testing code&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  c. Modify configuration
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Configuration file: &lt;code&gt;src/main/resources/memory.properties&lt;/code&gt; [&lt;a href="https://github.com/4paradigm/OpenMLDB/blob/main/benchmark/src/main/resources/memory.properties"&gt;link&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;Note:

&lt;ul&gt;
&lt;li&gt;Ensure that &lt;code&gt;REDIS_HOST_PORT&lt;/code&gt; and &lt;code&gt;ZK_CLUSTER&lt;/code&gt; configurations match the actual testing environment.&lt;/li&gt;
&lt;li&gt;Modify &lt;code&gt;TALKING_DATASET_PATH&lt;/code&gt; (defaults to &lt;code&gt;resources/data/talking_data_sample.csv&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  d. Obtain the test data file
&lt;/h5&gt;

&lt;p&gt;Place the test data file in the &lt;code&gt;resources/data&lt;/code&gt; directory, which is consistent with the &lt;code&gt;TALKING_DATASET_PATH&lt;/code&gt; configuration path.&lt;/p&gt;

&lt;h5&gt;
  
  
  e. Run the tests
&lt;/h5&gt;

&lt;p&gt;[Related paths in the GitHub benchmark Readme]&lt;/p&gt;

&lt;h5&gt;
  
  
  f. Check the output results
&lt;/h5&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Random Data Test
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vk55fTyS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AB0ZdlXLfn9ENGdGKjnz1Qg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vk55fTyS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AB0ZdlXLfn9ENGdGKjnz1Qg.png" alt="" width="659" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TfPrRum0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2800/0%2AOVmEh9P1vfJHvXay" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TfPrRum0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2800/0%2AOVmEh9P1vfJHvXay" alt="" width="800" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Under the experimental conditions mentioned above, storing the same amount of data, OpenMLDB (memory storage-mode) consumes over 30% less memory compared to Redis.&lt;/p&gt;

&lt;h3&gt;
  
  
  TalkingData Test
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VdtfRBmn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AgzgkhGue0sXvwD-zhY4H1A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VdtfRBmn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AgzgkhGue0sXvwD-zhY4H1A.png" alt="" width="715" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IyxtqLnz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2800/0%2Ar5EJqYOtgistOp3D" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IyxtqLnz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2800/0%2Ar5EJqYOtgistOp3D" alt="" width="800" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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%.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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).&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;For more information on OpenMLDB:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Official website: &lt;a href="https://openmldb.ai/"&gt;https://openmldb.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/4paradigm/OpenMLDB"&gt;https://github.com/4paradigm/OpenMLDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/en/"&gt;https://openmldb.ai/docs/en/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join us on &lt;a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"&gt;&lt;strong&gt;Slack&lt;/strong&gt;&lt;/a&gt;!&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This post is a re-post from &lt;a href="https://openmldb.medium.com/"&gt;OpenMLDB Blogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>redis</category>
      <category>report</category>
      <category>opensource</category>
      <category>memory</category>
    </item>
    <item>
      <title>Ultra High-Performance Database OpenM(ysq)LDB: Seamless Compatibility with MySQL Protocol and Multi-Language MySQL Client</title>
      <dc:creator>Hana Wang</dc:creator>
      <pubDate>Tue, 26 Mar 2024 01:49:00 +0000</pubDate>
      <link>https://dev.to/elliezza/ultra-high-performance-database-openmysqldb-seamless-compatibility-with-mysql-protocol-and-multi-language-mysql-client-2d9l</link>
      <guid>https://dev.to/elliezza/ultra-high-performance-database-openmysqldb-seamless-compatibility-with-mysql-protocol-and-multi-language-mysql-client-2d9l</guid>
      <description>&lt;h2&gt;
  
  
  What’s OpenM(ysq)LDB?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/4paradigm/OpenMLDB"&gt;OpenMLDB&lt;/a&gt; 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;For more details, check the &lt;a href="//../app_ecosystem/open_mysql_db/index.rst"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Use a Compatible MySQL Command Line
&lt;/h3&gt;

&lt;p&gt;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).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TeEI2mHh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2800/0%2A5QIIjVAzsut4WoQ-" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TeEI2mHh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2800/0%2A5QIIjVAzsut4WoQ-" alt="" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iDfVmKer--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2800/0%2AptCWEInPe6Lc-BJe" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iDfVmKer--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2800/0%2AptCWEInPe6Lc-BJe" alt="" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Use a Compatible JDBC Driver
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Write the Java application code as follows. Pay attention to modifying the IP, port, username, and password information according to the actual cluster situation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Main {
    public static void main(String[] args) {
        String url = "jdbc:mysql://localhost:3307/db1";
        String user = "root";
        String password = "root";
        Connection connection = null;
        Statement statement = null;
        ResultSet resultSet = null;
        try {
            connection = DriverManager.getConnection(url, user, password);
            statement = connection.createStatement();
            resultSet = statement.executeQuery("SELECT * FROM db1.t1");
            while (resultSet.next()) {
                int id = resultSet.getInt("id");
                String name = resultSet.getString("name");
                System.out.println("ID: " + id + ", Name: " + name);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            // Close the result set, statement, and connection
            try {
                if (resultSet != null) {
                    resultSet.close();
                }
                if (statement != null) {
                    statement.close();
                }
                if (connection != null) {
                    connection.close();
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then compile and execute, and you can see the queried data for the OpenMLDB database in the command line output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hpNULpUW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2258/0%2AaivjJLsx6yA2yshj" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hpNULpUW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2258/0%2AaivjJLsx6yA2yshj" alt="" width="800" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Use a Compatible SQLAlchemy Driver
&lt;/h3&gt;

&lt;p&gt;Python developers often use SQLAlchemy and MySQL drivers, and the same code can also be directly applied to query OpenMLDB’s online data.&lt;/p&gt;

&lt;p&gt;Write the Python application code as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sqlalchemy import create_engine, text

def main():
    engine = create_engine("mysql+pymysql://root:root@127.0.0.1:3307/db1", echo=True)
    with engine.connect() as conn:
        result = conn.execute(text("SELECT * FROM db1.t1"))
        for row in result:
            print(row)

if __name__ == "__main__":
  main()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then execute it directly, and you can see the corresponding OpenMLDB database output in the command line output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fN4h1G04--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2414/0%2AEyMXQBhAIXYsleC_" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fN4h1G04--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2414/0%2AEyMXQBhAIXYsleC_" alt="" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Use a Compatible Go MySQL Driver
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Write the Golang application code as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
        "database/sql"
        "fmt"
        "log"

        _ "github.com/go-sql-driver/mysql"
)

func main() {
        // MySQL database connection parameters
        dbUser := "root"         // Replace with your MySQL username
        dbPass := "root"         // Replace with your MySQL password
        dbName := "db1"    // Replace with your MySQL database name
        dbHost := "localhost:3307"        // Replace with your MySQL host address
        dbCharset := "utf8mb4"            // Replace with your MySQL charset

        // Create a database connection
        db, err := sql.Open("mysql", fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=%s", dbUser, dbPass, dbHost, dbName, dbCharset))
        if err != nil {
                log.Fatalf("Error connecting to the database: %v", err)
        }
        defer db.Close()

        // Perform a simple query
        rows, err := db.Query("SELECT id, name FROM db1.t1")
        if err != nil {
                log.Fatalf("Error executing query: %v", err)
        }
        defer rows.Close()

        // Iterate over the result set
        for rows.Next() {
                var id int
                var name string
                if err := rows.Scan(&amp;amp;id, &amp;amp;name); err != nil {
                        log.Fatalf("Error scanning row: %v", err)
                }
                fmt.Printf("ID: %d, Name: %s\n", id, name)
        }
        if err := rows.Err(); err != nil {
                log.Fatalf("Error iterating over result set: %v", err)
        }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compile and run directly, and you can view the database output results in the command line output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---vMV-RXg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AAPMul6cHPvXo1g6y" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---vMV-RXg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AAPMul6cHPvXo1g6y" alt="" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Use a Compatible Sequel Ace Client
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ep9xdEes--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2800/0%2AR8vfgFm3GN4nG8Is" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ep9xdEes--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2800/0%2AR8vfgFm3GN4nG8Is" alt="" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Use a Compatible Navicat Client
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wGSwmYNt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2800/0%2APYBRNTVd2A2Br4NB" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wGSwmYNt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2800/0%2APYBRNTVd2A2Br4NB" alt="" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Compatibility Principle of MySQL Protocol
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bnzAxR24--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2452/0%2AMzGK9PxpjgLgBAw4" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bnzAxR24--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2452/0%2AMzGK9PxpjgLgBAw4" alt="" width="800" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;For more usage documentation, please refer to the &lt;a href="//../app_ecosystem/open_mysql_db/index.rst"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;For more information on OpenMLDB:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Official website: &lt;a href="https://openmldb.ai/"&gt;https://openmldb.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/4paradigm/OpenMLDB"&gt;https://github.com/4paradigm/OpenMLDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/en/"&gt;https://openmldb.ai/docs/en/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join us on &lt;a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"&gt;&lt;strong&gt;Slack&lt;/strong&gt;&lt;/a&gt;!&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This post is a re-post from &lt;a href="https://openmldb.medium.com/"&gt;OpenMLDB Blogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>mysql</category>
      <category>opensource</category>
      <category>database</category>
      <category>featureengineering</category>
    </item>
    <item>
      <title>Integrating Apache Hive — Offline Data for OpenMLDB</title>
      <dc:creator>Hana Wang</dc:creator>
      <pubDate>Wed, 13 Mar 2024 06:21:49 +0000</pubDate>
      <link>https://dev.to/elliezza/integrating-apache-hive-offline-data-for-openmldb-2n9k</link>
      <guid>https://dev.to/elliezza/integrating-apache-hive-offline-data-for-openmldb-2n9k</guid>
      <description>&lt;p&gt;The &lt;a href="https://hive.apache.org/"&gt;Apache Hive&lt;/a&gt;™ 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  OpenMLDB Deployment
&lt;/h2&gt;

&lt;p&gt;You can refer to the official documentation for &lt;a href="https://openmldb.ai/docs/en/main/deploy/install_deploy.html"&gt;deployment&lt;/a&gt;. An easier way is to deploy with an official docker image, as described in &lt;a href="https://openmldb.ai/docs/en/main/quickstart/openmldb_quickstart.html"&gt;Quickstart&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In addition, you will also need Spark, please refer to &lt;a href="https://openmldb.ai/docs/en/main/tutorial/openmldbspark_distribution.html"&gt;OpenMLDB Spark Distribution&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hive-OpenMLDB Integration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;For users employing &lt;a href="https://openmldb.ai/docs/en/main/tutorial/openmldbspark_distribution.html"&gt;OpenMLDB Spark Distribution Version&lt;/a&gt;, specifically v0.6.7 and newer iterations, the essential Hive dependencies are already integrated.&lt;/p&gt;

&lt;p&gt;However, if you are working with an alternative Spark distribution, you can follow these steps for installation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Execute the following command in Spark to compile Hive dependencies
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
    ./build/mvn -Pyarn -Phive -Phive-thriftserver -DskipTests clean package
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;After successfully executed, the dependent package is located in the directory &lt;code&gt;assembly/target/scala-xx/jars&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add all dependent packages to Spark’s class path.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Configuration
&lt;/h3&gt;

&lt;p&gt;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 &lt;code&gt;hive.metastore.uris&lt;/code&gt; will suffice. However, in the production environment when HIVE configurations are required, configurations through &lt;code&gt;hive-site.xml&lt;/code&gt; is recommended.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using the &lt;code&gt;spark.conf&lt;/code&gt; Approach: You can set up &lt;code&gt;spark.hadoop.hive.metastore.uris&lt;/code&gt; within the Spark configuration. This can be accomplished in two ways:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;a. taskmanager.properties: Include &lt;code&gt;spark.hadoop.hive.metastore.uris=thrift://...&lt;/code&gt; within the &lt;code&gt;spark.default.conf&lt;/code&gt; configuration item, followed by restarting the taskmanager.&lt;/p&gt;

&lt;p&gt;b. CLI: Integrate this configuration directive into ini conf and use &lt;code&gt;--spark_conf&lt;/code&gt; when start CLI. Please refer to &lt;a href="https://openmldb.ai/docs/en/main/reference/client_config/client_spark_config.html"&gt;Client Spark Configuration&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;hive-site.xml&lt;/code&gt;: You can configure &lt;code&gt;hive.metastore.uris&lt;/code&gt; within the &lt;code&gt;hive-site.xml&lt;/code&gt; file. Place this configuration file within the &lt;code&gt;conf/&lt;/code&gt; directory of the Spark home. If the &lt;code&gt;HADOOP_CONF_DIR&lt;/code&gt; environment variable is already set, you can also position the configuration file there. For instance:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;configuration&amp;gt;
      &amp;lt;property&amp;gt;
        &amp;lt;name&amp;gt;hive.metastore.uris&amp;lt;/name&amp;gt;
         &amp;lt;!--Make sure that &amp;lt;value&amp;gt; points to the Hive Metastore URI in your cluster --&amp;gt;
         &amp;lt;value&amp;gt;thrift://localhost:9083&amp;lt;/value&amp;gt;
         &amp;lt;description&amp;gt;URI for client to contact metastore server&amp;lt;/description&amp;gt;
      &amp;lt;/property&amp;gt;
    &amp;lt;/configuration&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check
&lt;/h3&gt;

&lt;p&gt;Verify whether the task is connected to the appropriate Hive cluster by examining the task log. Here’s how you can proceed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;INFO HiveConf&lt;/code&gt;: indicates the Hive configuration file that was utilized. If you require further information about the loading process, you can review the Spark logs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When connecting to the Hive metastore, there should be a log entry similar to &lt;code&gt;INFO metastore: Trying to connect to metastore with URI&lt;/code&gt;. A successful connection will be denoted by a log entry reading &lt;code&gt;INFO metastore: Connected to metastore&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Table Creation with &lt;code&gt;LIKE&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;You can use LIKE syntax to create tables, leveraging existing Hive tables, with identical schemas in OpenMLDB.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    CREATE TABLE db1.t1 LIKE HIVE 'hive://hive_db.t1';
    -- SUCCEED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Import Hive Data to OpenMLDB
&lt;/h3&gt;

&lt;p&gt;Importing data from Hive sources is done through the API &lt;a href="https://openmldb.ai/docs/en/main/openmldb_sql/dml/LOAD_DATA_STATEMENT.html"&gt;LOAD DATA INFILE&lt;/a&gt;. This operation employs a specialized URI format, &lt;code&gt;hive://[db].table&lt;/code&gt;, to seamlessly import data from Hive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    LOAD DATA INFILE 'hive://db1.t1' INTO TABLE t1 OPTIONS(deep_copy=false);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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 &lt;code&gt;hive://&lt;/code&gt; prefix.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    LOAD DATA INFILE 'hive://db1.t1' INTO TABLE db1.t1 OPTIONS(deep_copy=true, sql='SELECT * FROM db1.t1 where key=\"foo\"')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Export OpenMLDB Data to Hive
&lt;/h3&gt;

&lt;p&gt;Exporting data to Hive sources is done through the API &lt;a href="https://openmldb.ai/docs/en/main/openmldb_sql/dql/SELECT_INTO_STATEMENT.html"&gt;SELECT INTO&lt;/a&gt;, which employs a distinct URI &lt;code&gt;hive://[db].table&lt;/code&gt;, to seamlessly transfer data to Hive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    SELECT col1, col2, col3 FROM t1 INTO OUTFILE 'hive://db1.t1';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;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 &lt;a href="https://openmldb.ai/docs/en/main/integration/offline_data_sources/hive.html"&gt;Hive integration&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;OpenMLDB community has recently released &lt;a href="https://github.com/4paradigm/FeatInsight"&gt;FeatInsight&lt;/a&gt;, a sophisticated feature store service, leveraging OpenMLDB for efficient feature computation, management, and orchestration. The service is available for trial at &lt;a href="http://152.136.144.33/"&gt;http://152.136.144.33/&lt;/a&gt;. Contact us for a user ID and password to gain access!&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;For more information on OpenMLDB:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Official website: &lt;a href="https://openmldb.ai/"&gt;https://openmldb.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/4paradigm/OpenMLDB"&gt;https://github.com/4paradigm/OpenMLDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/en/"&gt;https://openmldb.ai/docs/en/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join us on &lt;a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"&gt;&lt;strong&gt;Slack&lt;/strong&gt;&lt;/a&gt;!&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This post is a re-post from &lt;a href="https://openmldb.medium.com/"&gt;OpenMLDB Blogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>database</category>
      <category>distributedsystems</category>
      <category>opensource</category>
      <category>sql</category>
    </item>
    <item>
      <title>Mastering Distributed Database Development in 10 Minutes with OpenMLDB Developer Docker Image</title>
      <dc:creator>Hana Wang</dc:creator>
      <pubDate>Wed, 13 Mar 2024 05:21:07 +0000</pubDate>
      <link>https://dev.to/elliezza/mastering-distributed-database-development-in-10-minutes-with-openmldb-developer-docker-image-2e6g</link>
      <guid>https://dev.to/elliezza/mastering-distributed-database-development-in-10-minutes-with-openmldb-developer-docker-image-2e6g</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/4paradigm/OpenMLDB"&gt;OpenMLDB&lt;/a&gt; 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;The mirror is currently hosted on the Alibaba Cloud Mirror Repository. The process for using the mirror is as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start container: Use Docker commands to start the container. This will initiate an environment containing the OpenMLDB source code and all dependencies.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-it&lt;/span&gt; registry.cn-beijing.aliyuncs.com/openmldb/openmldb-build bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Compile OpenMLDB: Inside the container, you can directly navigate to the OpenMLDB source code directory and execute the compilation script.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;OpenMLDB
make
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install OpenMLDB, default installation path is ${PROJECT_ROOT}/openmldb
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Concurrent Compilation Time
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. 4-core Compilation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    make &lt;span class="nv"&gt;NPROC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8e1KL8MD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2APxiBv02dcLlqT6v4" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8e1KL8MD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2APxiBv02dcLlqT6v4" alt="" width="800" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. 8-core Compilation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    make &lt;span class="nv"&gt;NPROC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--niNnqum8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AN1-PWLtPlGHTkXBl" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--niNnqum8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AN1-PWLtPlGHTkXBl" alt="" width="800" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. 16-core Compilation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    make &lt;span class="nv"&gt;NPROC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CoUzzeTO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2Anj1LbYr7AJQIDUIE" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CoUzzeTO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2Anj1LbYr7AJQIDUIE" alt="" width="800" height="257"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Highlights
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Quick Start&lt;/strong&gt;: Eliminates complex setup steps, allowing developers to quickly enter development mode on different operating system platforms.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unified Environment&lt;/strong&gt;: 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.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Easy Sharing&lt;/strong&gt;: The image can be easily shared with other team members or distributed in the community, accelerating the adoption and application of OpenMLDB.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Complete OpenMLDB Environment&lt;/strong&gt;: 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.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Offline Compilation and Deployment Capabilities&lt;/strong&gt;: 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.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compilation Efficiency&lt;/strong&gt;: Since all dependencies are already built into the image, this avoids lengthy dependency download and installation processes, making the compilation process much faster.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;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.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;For more information on OpenMLDB:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Official website: &lt;a href="https://openmldb.ai/"&gt;https://openmldb.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/4paradigm/OpenMLDB"&gt;https://github.com/4paradigm/OpenMLDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/en/"&gt;https://openmldb.ai/docs/en/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join us on &lt;a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"&gt;&lt;strong&gt;Slack&lt;/strong&gt;&lt;/a&gt;!&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This post is a re-post from &lt;a href="https://openmldb.medium.com/"&gt;OpenMLDB Blogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>docker</category>
      <category>opensource</category>
      <category>database</category>
      <category>distributedsystems</category>
    </item>
    <item>
      <title>OpenMLDB v0.8.5 Release: Enhanced Authentication Feature, Comprehensive Security Upgrade</title>
      <dc:creator>Hana Wang</dc:creator>
      <pubDate>Thu, 29 Feb 2024 07:37:16 +0000</pubDate>
      <link>https://dev.to/elliezza/openmldb-v085-release-enhanced-authentication-feature-comprehensive-security-upgrade-2nc2</link>
      <guid>https://dev.to/elliezza/openmldb-v085-release-enhanced-authentication-feature-comprehensive-security-upgrade-2nc2</guid>
      <description>&lt;h2&gt;
  
  
  Release Date
&lt;/h2&gt;

&lt;p&gt;28 February 2024&lt;/p&gt;

&lt;h2&gt;
  
  
  Release Notes
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/4paradigm/OpenMLDB/releases/tag/v0.8.5" rel="noopener noreferrer"&gt;https://github.com/4paradigm/OpenMLDB/releases/tag/v0.8.5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AEPSO-1u5BuGYR_t-" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AEPSO-1u5BuGYR_t-"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;OpenMLDB has also introduced user authentication functionality, allowing users to more flexibly manage and control database access permissions through SQL statements such as &lt;code&gt;CREATE / ALTER / DROP USER&lt;/code&gt;. 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's requirements for data access permission management, and improving the overall system's security and manageability.&lt;/p&gt;

&lt;p&gt;For detailed release notes, please refer to: &lt;a href="https://github.com/4paradigm/OpenMLDB/releases/tag/v0.8.5" rel="noopener noreferrer"&gt;https://github.com/4paradigm/OpenMLDB/releases/tag/v0.8.5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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!&lt;/p&gt;

&lt;h2&gt;
  
  
  Highlights
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Added standard SQL syntax &lt;code&gt;UNION ALL&lt;/code&gt;, expanding &lt;code&gt;WINDOW UNION&lt;/code&gt; and &lt;code&gt;LAST JOIN&lt;/code&gt; to achieve multi-table join.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Support for &lt;code&gt;SELECT INTO OUTFILE&lt;/code&gt; to configure OpenMLDB online tables, achieving synchronization between online and offline storage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In offline mode, &lt;code&gt;LAST JOIN&lt;/code&gt; and &lt;code&gt;WINDOW&lt;/code&gt; operations support not specifying &lt;code&gt;ORDER BY&lt;/code&gt; parameters, making usage more flexible.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Added user management functionality, enabling user addition, modification, and deletion through standard SQL statements &lt;code&gt;CREATE / ALTER / DROP USER&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Support for configuring Spark task parameters through SDK, providing more flexible offline task resource configuration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;INSERT&lt;/code&gt; statement supports configuring server-side memory limits, providing more user-friendly error messages for insertion failures.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;LEFT JOIN&lt;/code&gt; statement deployment supports automatic index creation, eliminating the need for manual index creation and data re-importation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;File storage engine supports TTL types &lt;code&gt;absandlat / absorlat&lt;/code&gt;, aligning with in-memory storage engine functionality.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;For more information on OpenMLDB:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://openmldb.ai/" rel="noopener noreferrer"&gt;https://openmldb.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/4paradigm/OpenMLDB" rel="noopener noreferrer"&gt;https://github.com/4paradigm/OpenMLDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/en/" rel="noopener noreferrer"&gt;https://openmldb.ai/docs/en/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join us on &lt;a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg" rel="noopener noreferrer"&gt;Slack&lt;/a&gt; !&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This post is a re-post from &lt;a href="https://openmldb.medium.com/" rel="noopener noreferrer"&gt;OpenMLDB Blogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>machinelearning</category>
      <category>opensource</category>
      <category>apacheiceberg</category>
      <category>tooling</category>
    </item>
    <item>
      <title>FeatInsight: Leveraging OpenMLDB for Highly Efficient Feature Management and Orchestration</title>
      <dc:creator>Hana Wang</dc:creator>
      <pubDate>Wed, 28 Feb 2024 09:53:04 +0000</pubDate>
      <link>https://dev.to/elliezza/featinsight-leveraging-openmldb-for-highly-efficient-feature-management-and-orchestration-15pp</link>
      <guid>https://dev.to/elliezza/featinsight-leveraging-openmldb-for-highly-efficient-feature-management-and-orchestration-15pp</guid>
      <description>&lt;p&gt;The OpenMLDB community has recently released a new open-source feature platform product — &lt;a href="https://github.com/4paradigm/FeatInsight" rel="noopener noreferrer"&gt;FeatInsight &lt;/a&gt;(&lt;a href="https://github.com/4paradigm/FeatInsight" rel="noopener noreferrer"&gt;https://github.com/4paradigm/FeatInsight&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;FeatInsight is a sophisticated feature store service, leveraging &lt;a href="https://github.com/4paradigm/OpenMLDB" rel="noopener noreferrer"&gt;OpenMLDB&lt;/a&gt; for efficient feature computation, management, and orchestration.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3800%2F1%2AvAJ9X3jRWmQnRbRLEAah1w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3800%2F1%2AvAJ9X3jRWmQnRbRLEAah1w.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Online Feature Service Deployment: Provides high-performance feature storage and online feature computation functions for localized deployment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;MLOps Platform: Establishes MLOps workflow with OpenMLDB online-offline consistent computations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;FeatureStore Platform: Provides comprehensive feature extraction, deletion, online deployment, and lineage management functionality to achieve low-cost local FeatureStore services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open-Source Feature Solution Reuse: Supports solution reuse locally for feature reuse and sharing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more content, please refer to FeatInsight &lt;a href="https://openmldb.ai/docs/en/main/app_ecosystem/feat_insight/index.html" rel="noopener noreferrer"&gt;Documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  QuickStart
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Data Import
&lt;/h3&gt;

&lt;p&gt;Firstly, create database test_db and data table test_table. You can use SQL to create.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE DATABASE test_db;
CREATE TABLE test_db.test_table (id STRING, trx_time DATE);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Or you can use the UI and create it under “Data Import”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2016%2F0%2AfAsNuEcuAuKxPxHG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2016%2F0%2AfAsNuEcuAuKxPxHG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id,trx_time
user1,2024-01-01
user2,2024-01-02
user3,2024-01-03
user4,2024-01-04
user5,2024-01-05
user6,2024-01-06
user7,2024-01-07
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For online scenarios, you can use the command LOAD DATA or INSERT. Here we use "Import from CSV".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2012%2F0%2ASA_ahc-gr-KdxQoW" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2012%2F0%2ASA_ahc-gr-KdxQoW"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The imported data can be previewed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AzslCR2m4JDLRX2F9" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AzslCR2m4JDLRX2F9"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For offline scenarios, you can also use LOAD_DATA or "Import from CSV".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AnJXy3ZVC6_wDGMjZ" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AnJXy3ZVC6_wDGMjZ"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wait for about half a minute for the task to finish. You can also check the status and log.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2326%2F0%2AuRfWllebyLSTIPlK" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2326%2F0%2AuRfWllebyLSTIPlK"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Feature Creation
&lt;/h3&gt;

&lt;p&gt;After data imports, we can create features. Here we use SQL to create two basic features.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT id, dayofweek(trx_time) as trx_day FROM test_table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In “Features”, the button beside “All Features” is to create new features. Fill in the form accordingly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AW_yPog3z6G6d1QP8" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AW_yPog3z6G6d1QP8"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AHZbp68_k0Pr7EptI" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AHZbp68_k0Pr7EptI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Offline Samples Export
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2A9JIclPEPFGQlb3m6" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2A9JIclPEPFGQlb3m6"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wait for about half a minute and you can check the status at “Offline Samples”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AH7F-Dny4Mydo36ft" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AH7F-Dny4Mydo36ft"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AXTsFasaMSdEa6mJu" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AXTsFasaMSdEa6mJu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Online Feature Service
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2APR26Hq2qZb09j0iz" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2APR26Hq2qZb09j0iz"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After successful creation, you can check service details, including the feature list, dependent tables, and lineage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AgqIk-leJBHbIwFBz" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2AgqIk-leJBHbIwFBz"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2638%2F0%2AC-2aUiA8wi9q36Ww" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2638%2F0%2AC-2aUiA8wi9q36Ww"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;If you want to have a further understanding of how to use FeatInsight and its application scenarios, please refer to &lt;a href="https://openmldb.ai/docs/en/main/app_ecosystem/feat_insight/use_cases/index.html" rel="noopener noreferrer"&gt;Application Scenarios&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix: Advanced Functions
&lt;/h2&gt;

&lt;p&gt;In addition to the basic functionalities of feature engineering, FeatInsight also provides advanced functionalities to facilitate feature development for users:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Read More:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;FeatInsight Github: &lt;a href="https://github.com/4paradigm/FeatInsight" rel="noopener noreferrer"&gt;https://github.com/4paradigm/FeatInsight&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;FeatInsight documentation: &lt;a href="https://openmldb.ai/docs/en/main/app_ecosystem/feat_insight/index.html" rel="noopener noreferrer"&gt;https://openmldb.ai/docs/en/main/app_ecosystem/feat_insight/index.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;For more information on OpenMLDB:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://openmldb.ai/" rel="noopener noreferrer"&gt;https://openmldb.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/4paradigm/OpenMLDB" rel="noopener noreferrer"&gt;https://github.com/4paradigm/OpenMLDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/en/" rel="noopener noreferrer"&gt;https://openmldb.ai/docs/en/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join us on &lt;a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg" rel="noopener noreferrer"&gt;Slack&lt;/a&gt; !&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This post is a re-post from &lt;a href="https://openmldb.medium.com/" rel="noopener noreferrer"&gt;OpenMLDB Blogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>machinelearning</category>
      <category>opensource</category>
      <category>tools</category>
      <category>featureplatform</category>
    </item>
    <item>
      <title>OpenMLDB Selected as the Sole Feature Store Vendor from China in the 2023 Gartner Report</title>
      <dc:creator>Hana Wang</dc:creator>
      <pubDate>Mon, 26 Feb 2024 08:05:23 +0000</pubDate>
      <link>https://dev.to/elliezza/openmldb-selected-as-the-sole-feature-store-vendor-from-china-in-the-2023-gartner-report-ckg</link>
      <guid>https://dev.to/elliezza/openmldb-selected-as-the-sole-feature-store-vendor-from-china-in-the-2023-gartner-report-ckg</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2560%2F1%2AkEqB4-TF4xCGr6wNp5krxg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2560%2F1%2AkEqB4-TF4xCGr6wNp5krxg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  OpenMLDB: Providing a Consistent Production-level Feature Store Online and Offline, Achieving a 500% Efficiency Improvement per Unit Cost
&lt;/h2&gt;

&lt;p&gt;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”.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ArpGKEuu6O_QNOxGqQXFpvw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ArpGKEuu6O_QNOxGqQXFpvw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Aem_Qs0k2LW0SYqdTtQuVvA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Aem_Qs0k2LW0SYqdTtQuVvA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  OpenMLDB X Akulaku: By Scenario-driven Approach, Windowed Feature Computation for One Billion Orders Achieves 4 Milliseconds Latency Performance, Saving over 4 Million Resources
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AL4ppIB9S6ctPoDV2-MZV1A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AL4ppIB9S6ctPoDV2-MZV1A.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;




&lt;p&gt;For more information on OpenMLDB:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://openmldb.ai/" rel="noopener noreferrer"&gt;https://openmldb.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/4paradigm/OpenMLDB" rel="noopener noreferrer"&gt;https://github.com/4paradigm/OpenMLDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/en/" rel="noopener noreferrer"&gt;https://openmldb.ai/docs/en/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join us on &lt;a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg" rel="noopener noreferrer"&gt;Slack&lt;/a&gt; !&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This post is a re-post from &lt;a href="https://openmldb.medium.com/" rel="noopener noreferrer"&gt;OpenMLDB Blogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>Kubernetes Deployment Guide for OpenMLDB</title>
      <dc:creator>Hana Wang</dc:creator>
      <pubDate>Tue, 16 Jan 2024 05:16:15 +0000</pubDate>
      <link>https://dev.to/elliezza/kubernetes-deployment-guide-for-openmldb-3b61</link>
      <guid>https://dev.to/elliezza/kubernetes-deployment-guide-for-openmldb-3b61</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Besides Kubernetes-based deployment, the offline engine also supports deployment in &lt;code&gt;local&lt;/code&gt; mode and &lt;code&gt;yarn&lt;/code&gt; mode. Similarly, the online engine supports a native deployment method that doesn't rely on containers. These deployment strategies can be flexibly mixed and matched in practical scenarios to meet the demands of production environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Offline Engine with Kubernetes Backend
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Deployment of Kubernetes Operator for Apache Spark
&lt;/h3&gt;

&lt;p&gt;Please refer to &lt;a href="https://github.com/GoogleCloudPlatform/spark-on-k8s-operator"&gt;spark-on-k8s-operator official documentation&lt;/a&gt;. The following is the command to deploy to the &lt;code&gt;default&lt;/code&gt; namespace using &lt;code&gt;Helm&lt;/code&gt;. Modify the namespace and permission as required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm install my-release spark-operator/spark-operator --namespace default --create-namespace --set webhook.enable=true
kubectl create serviceaccount spark --namespace default
kubectl create clusterrolebinding binding --clusterrole=edit --serviceaccount=default:spark
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;After successful deployment, you can use the code examples provided by spark-operator to test whether Spark tasks can be submitted normally.&lt;/p&gt;
&lt;h3&gt;
  
  
  HDFS Support
&lt;/h3&gt;

&lt;p&gt;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:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create configmap hadoop-config --from-file=/tmp/hadoop/etc/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Offline Engine Configurations for Kubernetes Support
&lt;/h3&gt;

&lt;p&gt;The configuration file for TaskManager in the offline engine can be configured for Kubernetes support, respective settings are:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
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:&lt;br&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;offline.data.prefix=hdfs:///foo/bar/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡&lt;em&gt;For a complete configuration file example for TaskManager in OpenMLDB offline engine, visit: &lt;a href="https://openmldb.ai/docs/en/main/deploy/conf.html#he-configuration-file-for-taskmanager-conf-taskmanager-properties"&gt;https://openmldb.ai/docs/en/main/deploy/conf.html#he-configuration-file-for-taskmanager-conf-taskmanager-properties&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Task Submission and Management
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;For instance, to submit a data import task:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LOAD DATA INFILE 'hdfs:///hosts' INTO TABLE db1.t1 OPTIONS(delimiter = ',', mode='overwrite');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check Hadoop ConfigMap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get configmap hdfs-config -o yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check Spark job and Pod log:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get SparkApplicationkubectl get pods
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Online Engine Deployment with Kubernetes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Github
&lt;/h3&gt;

&lt;p&gt;The deployment of online engine based on Kubernetes is supported as a separate tool for OpenMLDB. Its source code repository is located at: &lt;a href="https://github.com/4paradigm/openmldb-k8s"&gt;https://github.com/4paradigm/openmldb-k8s&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Requirement
&lt;/h3&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kubernetes 1.19+&lt;/li&gt;
&lt;li&gt;Helm 3.2.0+&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, for users who utilize pre-compiled OpenMLDB images from Docker Hub, only OpenMLDB versions &amp;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preparation: Deploy ZooKeeper
&lt;/h3&gt;

&lt;p&gt;If there is an available ZooKeeper instance, you can skip this step. Otherwise, proceed with the installation process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm install zookeeper oci://registry-1.docker.io/bitnamicharts/zookeeper --set persistence.enabled=false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can specify a previously created storage class for persistent storage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm install zookeeper oci://registry-1.docker.io/bitnamicharts/zookeeper --set persistence.storageClass=local-storage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more parameter settings, refer to &lt;a href="https://github.com/bitnami/charts/tree/main/bitnami/zookeeper"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  OpenMLDB Deployment
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Download Source Code&lt;/strong&gt;&lt;br&gt;
Download the source code and set the working directory to the root directory of the repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/4paradigm/openmldb-k8s.git
cd openmldb-k8s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Configure ZooKeeper Address&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Modify the &lt;code&gt;zk_cluster&lt;/code&gt; in the &lt;code&gt;charts/openmldb/conf/tablet.flags&lt;/code&gt; and &lt;code&gt;charts/openmldb/conf/nameserver.flags&lt;/code&gt; files to the actual ZooKeeper address, with the default &lt;code&gt;zk_root_path&lt;/code&gt; set to &lt;code&gt;/openmldb&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy OpenMLDB&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can achieve one-click deployment using Helm with the following commands:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm install openmldb ./charts/openmldb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Users have the flexibility to configure additional deployment options using the &lt;code&gt;--set&lt;/code&gt; command. Detailed information about supported options can be found in the &lt;a href="https://github.com/4paradigm/openmldb-k8s/blob/main/charts/openmldb/README.md"&gt;OpenMLDB Chart Configuration&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Important configuration considerations include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;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:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm install openmldb ./charts/openmldb --set persistence.dataDir.enabled=true --set  persistence.dataDir.storageClass=local-storage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;By default, the 4pdosc/openmldb-online image from Docker Hub is utilized (supporting OpenMLDB &amp;gt;= 0.8.2). If you prefer to use a custom image, you can specify the image name during installation with --set &lt;code&gt;image.openmldbImage&lt;/code&gt;. For information on creating custom images, refer to the last section of this article.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm install openmldb ./charts/openmldb --set image.openmldbImage=openmldb-online:0.8.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deployed OpenMLDB services can only be accessed within the same namespace within Kubernetes.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The OpenMLDB cluster deployed using this method does not include a TaskManager module. Consequently, statements such as &lt;a href="https://openmldb.ai/docs/en/main/openmldb_sql/dml/LOAD_DATA_STATEMENT.html"&gt;LOAD DATA&lt;/a&gt; and &lt;a href="https://openmldb.ai/docs/en/main/openmldb_sql/dql/SELECT_INTO_STATEMENT.html"&gt;SELECT INTO&lt;/a&gt;, and offline-related functions are not supported. If you need to import data into OpenMLDB, you can use OpenMLDB’s &lt;a href="https://openmldb.ai/docs/en/main/tutorial/data_import.html"&gt;Online Import Tool&lt;/a&gt;, &lt;a href="https://openmldb.ai/docs/en/main/integration/online_datasources/index.html"&gt;OpenMLDB Connector&lt;/a&gt;, or SDK. For exporting table data, the &lt;a href="https://openmldb.ai/docs/en/main/tutorial/data_export.html"&gt;Online Data Export Tool&lt;/a&gt; can be utilized.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;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 &lt;a href="https://openmldb.ai/docs/en/main/deploy/install_deploy.html#disable-thp-transparent-huge-pages"&gt;this link&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create Docker Image
&lt;/h2&gt;

&lt;p&gt;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 (&lt;a href="https://github.com/4paradigm/openmldb-k8s"&gt;https://github.com/4paradigm/openmldb-k8s&lt;/a&gt;) as &lt;code&gt;docker/build.sh&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This script supports two parameters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenMLDB version number.&lt;/li&gt;
&lt;li&gt;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.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd docker
sh build.sh 0.8.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;For more information on OpenMLDB:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://openmldb.ai/"&gt;https://openmldb.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/4paradigm/OpenMLDB"&gt;https://github.com/4paradigm/OpenMLDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/en/"&gt;https://openmldb.ai/docs/en/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join us on &lt;a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"&gt;Slack&lt;/a&gt; !&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This post is a re-post from &lt;a href="https://openmldb.medium.com/"&gt;OpenMLDB Blogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>kubernetes</category>
      <category>featurestore</category>
      <category>machinelearning</category>
      <category>opensource</category>
    </item>
    <item>
      <title>OpenMLDB SQL Emulator — a Development and Debugging Tool for OpenMLDB SQL</title>
      <dc:creator>Hana Wang</dc:creator>
      <pubDate>Tue, 26 Dec 2023 09:39:21 +0000</pubDate>
      <link>https://dev.to/elliezza/openmldb-sql-emulator-a-development-and-debugging-tool-for-openmldb-sql-2j41</link>
      <guid>https://dev.to/elliezza/openmldb-sql-emulator-a-development-and-debugging-tool-for-openmldb-sql-2j41</guid>
      <description>&lt;p&gt;In this blog, we would like to introduce an excellent standalone tool from the OpenMLDB community — OpenMLDB SQL Emulator (&lt;a href="https://github.com/vagetablechicken/OpenMLDBSQLEmulator"&gt;https://github.com/vagetablechicken/OpenMLDBSQLEmulator&lt;/a&gt;). This tool allows users to develop and debug OpenMLDB SQL more efficiently and conveniently.&lt;/p&gt;

&lt;p&gt;To efficiently implement time-series feature calculations, OpenMLDB SQL has improved and extended standard SQL. In practical use, beginners often encounter problems such as unfamiliar syntax and confusing execution modes when using OpenMLDB SQL. Suppose one directly develops and debugs on OpenMLDB itself, due to issues including deployment, index building, handling large data volume, and so on. In that case, he/she will end up wasting a lot of time on irrelevant tasks and might not be able to pinpoint the root cause easily.&lt;/p&gt;

&lt;p&gt;The OpenMLDB SQL Emulator is a lightweight simulation development and debugging tool for OpenMLDB SQL. It allows for SQL validation and debugging operations without the need for deploying an OpenMLDB cluster. We strongly recommend this tool to our application developers. They can use this tool to quickly verify the correctness and deployability of SQL, before switching to the actual OpenMLDB environment for deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Download the runtime package emulator-1.0.jar from the project page at &lt;a href="https://github.com/vagetablechicken/OpenMLDBSQLEmulator/releases"&gt;https://github.com/vagetablechicken/OpenMLDBSQLEmulator/releases&lt;/a&gt;. Use the following method to start (Note that the current release version 1.0 corresponds to SQL syntax for OpenMLDB 0.8.3):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;java -jar emulator-1.0.jar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: If you want to execute SQL using the run command to validate results, you will also need to download toydb_run_engine from the same page and store it in the system's /tmp directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creation of Virtual Databases and Tables
&lt;/h2&gt;

&lt;p&gt;Once started, it will directly enter the default database emudb, and no additional database creation is required.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Databases don’t need to be explicitly created. Just use use  or specify the database name when creating tables, and the database will be created automatically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the addtable command or t to create a virtual table. Repeatedly creating a table with the same name is considered an update operation and will use the latest table schema. We use a simplified SQL-like syntax to manage tables. For example, the following example creates a table with two columns:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;addtable t1 a int, b int64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Use the showtables command or st to view all current databases and tables.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Validation of OpenMLDB SQL
&lt;/h2&gt;

&lt;p&gt;To verify whether OpenMLDB SQL can be deployed in the cluster setting, you can use DEPLOY. Note that DEPLOYMENT and index need to be managed. For instance, if a certain DEPLOYMENT is not needed, it needs to be manually deleted. Similarly, if unnecessary indexes are created, they must be cleaned up.&lt;/p&gt;

&lt;p&gt;Hence, it is suggested to test and verify in the Emulator instead. You can use val and valreq to perform online batch mode and online request mode (i.e., service deployment) OpenMLDB SQL validation. For example, testing whether a SQL can be DEPLOYed online using the valreq command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;addtable t1 a int, b int64
valreq select count(*) over w1 from t1 window w1 as (partition by a order by b rows between unbounded preceding and current row);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the test fails, it will print SQL compilation errors. If successful, it will print validate * success. The entire process happens in a virtual environment, without any concerns about resource utilization after table creation, and without any side effects. Any SQL that passes the valreq validation will definitely be able to be deployed in a real cluster.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing of OpenMLDB SQL
&lt;/h2&gt;

&lt;p&gt;OpenMLDB Emulator can also return computation results to verify if the implemented SQL gives correct calculation results. You can continuously perform computations and online validations until the implemented SQL meets the expectation. This functionality can be achieved through the run command in the Emulator. Note that using the run command requires additional support from toydb_run_engine. You can use the built-in toydb from the emulator package, or download it from this page (&lt;a href="https://github.com/vagetablechicken/OpenMLDBSQLEmulator/releases"&gt;https://github.com/vagetablechicken/OpenMLDBSQLEmulator/releases&lt;/a&gt;) and place it directly in /tmp.&lt;/p&gt;

&lt;p&gt;Assuming Emulator already has toydb installed, here are the steps for testing SQL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# step 1, generate a yaml template
gencase
# step 2, modify the yaml file to add table and data
# ...
# step 3, load yaml to get table catalog, 
# then using val/valreq sql to validate the sql in emulator
loadcase
valreq &amp;lt;sql&amp;gt;
# step 4, dump the sql, this will rewrite the yaml file
dumpcase &amp;lt;sql&amp;gt;

# step 5, run sql using toydb
run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command gencase generates a YAML template file, defaulting to the directory /tmp/emu-case.yaml. You'll need to edit this YAML file as shown below. When editing, consider the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Modify table names, table schema, and their data, which can not be changed in the Emulator.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Modify the run mode to accept batch or request mode.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You may leave the SQL section blank. SQL can be written to the file in the Emulator using dumpcase . A common usage is to validate SQL first, then dump it to the case, and finally, use the run command to confirm if the SQL calculation meets expectations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The table’s indexes don’t need manual filling. When using dumpcase, indexes can be automatically generated based on the table schema (indexes are not specific to SQL and are only needed to create at least one index when creating the table). If you are not using dumpcase, please manually specify at least one index.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# call toydb_run_engine to run this yaml file
# you can generate yaml cases for reproduction by emulator dump or by yourself

# you can set the global default db
db: emudb
cases:
  - id: 0
    desc: describe this case
    # you can set batch mode
    mode: request
    db: emudb # you can set default db for case, if not set, use the global default db
    inputs:
      - name: t1
        db: emudb # you can set db for each table, if not set, use the default db(table db &amp;gt; case db &amp;gt; global db)
        # must set table schema, emulator can't do this
        columns: ["id int", "pk1 string","col1 int32", "std_ts timestamp"]
        # gen by emulator, just to init table, not the deployment index
        indexs: []
        # must set the data, emulator can't do this
        data: |
          1, A, 1, 1590115420000
          2, B, 1, 1590115420000
    # query: only support single query, to check the result by `expect`
    sql: |

    # optional, you can just check the output, or add your expect
    # expect:
    #   schema: id:int, pk1:string, col1:int, std_ts:timestamp, w1_col1_sum:int, w2_col1_sum:int, w3_col1_sum:int
    #   order: id
    #   data: |
    #     1, A, 1, 1590115420000, 1, 1, 1
    #     2, B, 1, 1590115420000, 1, 1, 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For simplicity, let’s not make any modifications and directly use this template to demonstrate how to modify the running case. In the Emulator, executing loadcase will load the table information from this case into the Emulator. You can confirm the successful loading of the case's tables by using st/showtables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;emudb&amp;gt; st
emudb={t1=id:int32,pk1:string,col1:int32,std_ts:timestamp}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see that the table information has been successfully loaded. Now, we can use valreq to confirm if the SQL we've written is syntactically correct and deployable. Subsequently, you can perform a computation test on this SQL using the dumpcase and run commands. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;valreq select count(*) over w1 from t1 window w1 as (partition by id order by std_ts rows between unbounded preceding and current row);
dumpcase select count(*) over w1 from t1 window w1 as (partition by id order by std_ts rows between unbounded preceding and current row);
run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;dumpcase command actually writes the SQL and default indexes into the case file, and the run command executes this case file. Therefore, if you are skilled enough, you can directly modify this case file and then run it in the Emulator using run, or alternatively, use toydb_run_engine --yaml_path=... to run it. After execution, you will obtain the computed results for debugging and inspection purposes.&lt;/p&gt;

&lt;h2&gt;
  
  
  More
&lt;/h2&gt;

&lt;p&gt;The OpenMLDB SQL Emulator also features a genddl function that helps users generate optimal index creation statements directly from SQL. This feature aids in avoiding redundant indexes and currently supports only single database. In future, there will be improvements in index handling, providing simpler and more convenient operations to guide users in index management.&lt;/p&gt;

&lt;p&gt;Additionally, for usage of the Emulator, it’s recommended to utilize the ?help and ?list-all prompts. Commands are in lowercase, but SQL parameter inputs are case-insensitive and do not require additional double quotes, aligning with CLI conventions. Functionalities such as command history and exporting the current environment will be added to facilitate user operations and integration with real OpenMLDB clusters in future updates.&lt;/p&gt;




&lt;p&gt;For more information on OpenMLDB:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://openmldb.ai/"&gt;https://openmldb.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/4paradigm/OpenMLDB"&gt;https://github.com/4paradigm/OpenMLDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/en/"&gt;https://openmldb.ai/docs/en/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join us on &lt;a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"&gt;Slack&lt;/a&gt; !&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This post is a re-post from &lt;a href="https://openmldb.medium.com/"&gt;OpenMLDB Blogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>opensource</category>
      <category>machinelearning</category>
      <category>featureops</category>
      <category>sql</category>
    </item>
    <item>
      <title>OpenMLDB Integration in Real-Time Decision-Making Systems</title>
      <dc:creator>Hana Wang</dc:creator>
      <pubDate>Mon, 11 Dec 2023 07:43:52 +0000</pubDate>
      <link>https://dev.to/elliezza/openmldb-integration-in-real-time-decision-making-systems-eim</link>
      <guid>https://dev.to/elliezza/openmldb-integration-in-real-time-decision-making-systems-eim</guid>
      <description>&lt;p&gt;OpenMLDB provides a real-time feature computing platform that ensures consistency between online and offline environments. It also offers flexible support for integrating into actual business systems and building complete machine-learning platforms. This article focuses on the common architectures used to integrate OpenMLDB into enterprise-level business systems, with a particular emphasis on &lt;strong&gt;storage&lt;/strong&gt; and &lt;strong&gt;application&lt;/strong&gt; computation architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Offline and online data &lt;strong&gt;storage&lt;/strong&gt; architecture: How to store &lt;strong&gt;offline&lt;/strong&gt; and &lt;strong&gt;online&lt;/strong&gt; data in a reasonable manner while maintaining consistency between the two.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Real-time decision-making &lt;strong&gt;application&lt;/strong&gt; architecture: How to build online applications based on OpenMLDB’s real-time request model, including architectures for real-time &lt;strong&gt;computation&lt;/strong&gt; and real-time &lt;strong&gt;query&lt;/strong&gt; applications.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Storage Architecture for Offline and Online Data
&lt;/h2&gt;

&lt;p&gt;Due to different performance and data volume requirements, in general, OpenMLDB’s offline and online data are stored separately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Online Data Storage:&lt;/strong&gt; OpenMLDB provides an efficient real-time database (based on memory or hard disk) primarily for storing online data used for real-time feature computations, rather than full data. The main features are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Millisecond-level access for time series data (based on memory, by default).&lt;/li&gt;
&lt;li&gt;The ability to automatically expire data (TTL). TTL can be set according to the granularity of the table, which is used to store only the necessary data within a certain time window.&lt;/li&gt;
&lt;li&gt;The memory-based storage engine has high performance but may consume a large amount of external memory. A disk-based storage engine can be used to complement if performance requirements can be met.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Offline Data Warehouse:&lt;/strong&gt; OpenMLDB does not provide a standalone offline storage engine, but can flexibly support different offline data warehouses and architecture forms.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The following section discusses the common storage architectures for offline and online data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Full Data Storage in a Real-Time Database (not recommended)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--etwgtrOT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ADVotWivbgQlmql287iWetQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--etwgtrOT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ADVotWivbgQlmql287iWetQ.png" alt="" width="386" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Users can choose to store full data in OpenMLDB’s real-time database. The advantage of this method is its simplicity and having only one copy of the data in physical storage, which saves management and maintenance costs. However, this usage method is rarely used in practice due to the following potential problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Full data is generally large, and to ensure online performance, OpenMLDB uses an external memory-based storage engine by default. Storing full data in external memory will result in a large hardware cost.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Although OpenMLDB provides disk-based storage engines, disk storage can result in a 3–7x performance decrease, which may not meet the requirements of some online business scenarios.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Storing offline and online data on the same physical medium may significantly impact the performance and stability of real-time computations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Therefore, in practice, to fully leverage OpenMLDB’s real-time computation capabilities, we do not recommend storing full data in OpenMLDB, but rather using it in conjunction with an offline data warehouse.&lt;/p&gt;

&lt;h3&gt;
  
  
  Separate Storage for Offline Data Warehouse and Online Real-Time Database
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n5TIq43H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ALRDFl6WpSB3fJA9NicuYUw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n5TIq43H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ALRDFl6WpSB3fJA9NicuYUw.png" alt="" width="677" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently, in practice, most users adopt a separate storage architecture for offline and online data. Based on this architecture, data is simultaneously written to both the offline data warehouse and the real-time database. The real-time database of OpenMLDB sets table-level data expiration (TTL), which corresponds to the size of the time window required in the feature script. In this way, the real-time database only stores necessary data for real-time feature computation, rather than the entire dataset. Some important points to note are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In actual enterprise architecture, data sources are generally based on subscription mechanisms of message queues such as Kafka. Different applications will consume data separately. Under this architecture, the channels for writing to the real-time database of OpenMLDB and storing it in the offline data warehouse can be considered as two independent consumers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If it is not based on a subscription mechanism of message queues, it can also be considered that there are one or more data-receiving programs upstream of OpenMLDB, which are used to implement and manage the online and offline storage of OpenMLDB.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The expiration time of the real-time database of OpenMLDB needs to be correctly set so that the data stored in the real-time database can be used for correct real-time feature computation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The main disadvantage of this architecture is that it is more complicated to manage, as users need to manage offline and online data separately.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Unified Storage for Offline Data Warehouse and Online Real-Time Database (Support from v0.8.0)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jtUVj_PK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AMJGizdZUw56BVp_598uW_Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jtUVj_PK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AMJGizdZUw56BVp_598uW_Q.png" alt="" width="715" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this architecture of unified management for online and offline data, users’ perspectives on data synchronization and management have been simplified. While we still have two storage engines: a real-time database, and an offline data warehouse physically, from users’ perspective, a single writing channel is presented. Users only need to write new data into OpenMLDB’s real-time database and set up the synchronization mechanism, and OpenMLDB will automatically synchronize data in real time or periodically to one or more offline data warehouses. OpenMLDB’s real-time database still relies on a data expiration mechanism to only save data necessary for online feature computation, while the offline data warehouse retains all full data. This feature is available after version 0.8.0.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-time Decision-making Application Architecture
&lt;/h2&gt;

&lt;h3&gt;
  
  
  OpenMLDB Execution Mode: Real-Time Request Mode
&lt;/h3&gt;

&lt;p&gt;Let us first understand the real-time request mode offered by OpenMLDB online real-time computing engine. It mainly includes three steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The client sends a computation request through REST APIs or OpenMLDB SDKs, which may optionally include state information of the current event, such as the swiped amount and shop ID of the current swipe event.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The OpenMLDB real-time engine accepts the request and performs on-demand real-time feature computation based on the deployed feature computation logic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;OpenMLDB returns the real-time computation results to the client who initiated the request, completing the real-time computation request.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With the execution mode in mind, we will start with practical application scenarios and explain the application architecture for real-time decision-making applications: &lt;strong&gt;computation&lt;/strong&gt; and &lt;strong&gt;query&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Application Architecture for Real-Time Computation — for Real-Time Decision-Making
&lt;/h3&gt;

&lt;p&gt;The real-time request mode (default) of OpenMLDB supports in-event (real-time) decision-making applications, meaning that decision-making behavior takes place during the event occurrence. Therefore, its main characteristic is that &lt;strong&gt;behavioral data generated by the current event is also taken into consideration for decision-making&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The most typical example is credit card anti-fraud. When a credit card transaction occurs, the anti-fraud system makes a decision before the transaction is completed, taking into account the current transaction behavioral data (such as the amount, time, and location of the current transaction), along with data from a recent time window. This architecture is widely used in fields such as anti-fraud and risk control.&lt;/p&gt;

&lt;p&gt;Let’s take a concrete example. The following figure shows the functional logic of the entire system when a credit card transaction occurs. As shown in the figure, the system maintains a history of transaction records, and when a new transaction behavior occurs, the current behavioral data is &lt;strong&gt;virtually inserted into the table&lt;/strong&gt; along with recent transaction records for feature computation, then given to the model for inference, and finally evaluated to determine whether it is a fraudulent transaction.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0TyfNJGT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/4020/1%2AOWz4CFxpbgTCf_Pwmpzqfw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0TyfNJGT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/4020/1%2AOWz4CFxpbgTCf_Pwmpzqfw.png" alt="" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that in the above figure, the new swipe record data is shown as being &lt;strong&gt;virtually inserted&lt;/strong&gt; into the historical transaction table. This is because, in OpenMLDB’s default execution mode, the system virtually inserts the in-event data carried by the request into the table, participating in the overall feature computation (if in special circumstances where the request row is not needed for decision-making, see section below “Application Architecture for Real-time Query”). At the same time, the current request row is also useful for subsequent decision-making in general, so after completing the current feature computation, it will be physically inserted into the database. To build an in-event decision-making system like the above business process, a typical architecture flowchart is listed below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2M02exdE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AoeA2kL8ZMxjG_WlvEJ4lFA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2M02exdE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AoeA2kL8ZMxjG_WlvEJ4lFA.png" alt="" width="790" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The architecture is based on the OpenMLDB SDK and achieves strict in-event decision-making, which consists of two stages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Steps 1, 2, and 3 in the above diagram constitute a real-time feature computation with OpenMLDB. The request includes the necessary data (card number, transaction amount, timestamp) at the time of the event.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After the real-time computation request is completed, the client initiates an additional data insertion request through the OpenMLDB SDK to insert the current transaction data into OpenMLDB for subsequent real-time request computations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The above strict in-event decision-making architecture based on the OpenMLDB SDK is the default and recommended architecture. In actual enterprise application architectures, there may be some variations due to the complexity of peripheral coupling or permission issues. For example, the data writing path can be completely separated, with Kafka or other methods for data writing. However, if such architecture is not verified and guaranteed, there may be problems with the order of read and write operations, resulting in duplicate or missing data computation. In general, we still recommend using the strict in-event decision-making architecture shown in the above diagram.&lt;/p&gt;

&lt;h3&gt;
  
  
  Application Architecture for Real-time Query
&lt;/h3&gt;

&lt;p&gt;In some scenarios, the application may need to perform a real-time query only, which does not carry any meaningful data. For example, when a user browses products, it is helpful to query the most popular products on the platform that match the user’s interests in the last ten minutes to recommend relevant products. In such scenarios, the user’s request does not carry any meaningful data and thus can be completely decoupled with the data writing path. Such query requests only trigger a calculation (read-only, no data writes), which can be achieved using &lt;code&gt;EXCLUDE CURRENT_ROW&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EBAvDR_f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A7H50QOlufUpFQjKAAcUVZg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EBAvDR_f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A7H50QOlufUpFQjKAAcUVZg.png" alt="" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above architecture, the real-time query request (read-only) and the data writing path are decoupled.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;For the data writing path, users can continuously write data to the OpenMLDB database through streaming (such as Kafka connector) or OpenMLDB SDK.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For real-time query requests, there are two main features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After the query request is completed, there is no additional step to write into real-time data (data write is completed by the data writing path).&lt;/li&gt;
&lt;li&gt;Since data carried by query request is not meaningful, the extended SQL keyword &lt;code&gt;EXCLUDE CURRENT_ROW&lt;/code&gt; is required to avoid virtual insertion.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Other Architectures
&lt;/h3&gt;

&lt;p&gt;In addition to the two architectures mentioned above, OpenMLDB can also be extended to support architectures for online queries of offline features and architectures for streaming features. We will gradually introduce other enterprise-level architectures applied in practical scenarios in subsequent articles.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix: EXCLUDE CURRENT_ROW Semantics
&lt;/h2&gt;

&lt;p&gt;The real-time request mode of OpenMLDB by default will virtually insert the current data row into the table and include it in the window computation. If the current row’s data is not required for the computation, &lt;code&gt;EXCLUDE CURRENT_ROW&lt;/code&gt; can be used. This syntax excludes the data of the current request row from the window computation, but the &lt;code&gt;PARTITION BY KEY&lt;/code&gt; and &lt;code&gt;ORDER BY KEY&lt;/code&gt; provided by the request row still need to be used to locate the specific data and time window of the request.&lt;/p&gt;

&lt;p&gt;The following example illustrates its semantics, assuming the schema of the data table &lt;code&gt;txn&lt;/code&gt; used to store transaction records is as follows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q4J-dIb7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AdbgptDtV-qMPTxR3gSQLfw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q4J-dIb7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AdbgptDtV-qMPTxR3gSQLfw.png" alt="" width="324" height="73"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The following SQL with &lt;code&gt;EXCLUDE CURRENT_ROW&lt;/code&gt; is used:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT card_id, sum(amount) OVER (w1) AS w1_amount_sum FROM txn 
    WINDOW w1 AS (PARTITION BY card_id ORDER BY txn_time 
    ROWS BETWEEN 2 PRECEDING AND CURRENT ROW EXCLUDE CURRENT_ROW);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The statement defines a window based on card_id as the key, sorted by txn_time, and includes two rows before the current request row. At the same time, because EXCLUDE CURRENT_ROW is specified, the current request row is excluded from the window for computation.&lt;/p&gt;

&lt;p&gt;For simplicity, let’s assume that the table only has the following two rows:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;--------- ----------- --------------- 
  card_id   amount      txn_time       
 --------- ----------- --------------- 
  aaa       22.000000   1636097890000  
  aaa       20.000000   1636097290000  
 --------- ----------- ---------------
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We send a real-time computing request, which includes the following request data:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SP7sLpC5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AZJ245r5je1zXM5hKsSQrtA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SP7sLpC5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AZJ245r5je1zXM5hKsSQrtA.png" alt="" width="474" height="127"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If &lt;code&gt;EXCLUDE CURRENT_ROW&lt;/code&gt; is not used, both the current request row and the two rows that are already in the database will be included in the window for computation, resulting in a return value of "aaa, 65.0". However, since &lt;code&gt;EXCLUDE CURRENT_ROW&lt;/code&gt; is used, the current row will not be included in the window computation, so the return value is actually "aaa, 42.0".&lt;/p&gt;

&lt;p&gt;Note that although the value of the &lt;code&gt;amount&lt;/code&gt; in the current row does not participate in the window computation, its &lt;code&gt;card_id&lt;/code&gt; (key) and &lt;code&gt;txn_time&lt;/code&gt; ( timestamp) still need to be correctly set to correctly locate the time window.&lt;/p&gt;




&lt;p&gt;For more information on OpenMLDB:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://openmldb.ai/"&gt;https://openmldb.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/4paradigm/OpenMLDB"&gt;https://github.com/4paradigm/OpenMLDB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://openmldb.ai/docs/en/"&gt;https://openmldb.ai/docs/en/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join us on &lt;a href="https://join.slack.com/t/openmldb/shared_invite/zt-ozu3llie-K~hn9Ss1GZcFW2~K_L5sMg"&gt;Slack&lt;/a&gt; !&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This post is a re-post from &lt;a href="https://openmldb.medium.com/"&gt;OpenMLDB Blogs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
  </channel>
</rss>
