Skip to content

Commit ccefb18

Browse files
authored
Merge pull request #279 from NotHimmel/v5.4
Add ivy_mooncake (OLAP Analytics) documentation.
2 parents 76dc96a + c88a14a commit ccefb18

8 files changed

Lines changed: 164 additions & 0 deletions
Binary file not shown.
Binary file not shown.

CN/modules/ROOT/nav.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
** xref:7.20.adoc[17、sys_guid 函数]
2727
** xref:7.21.adoc[18、空字符串转null]
2828
** xref:7.22.adoc[19、CALL INTO]
29+
* OLAP 分析
30+
** xref:ivy_mooncake.adoc[ivy_mooncake]
2931
* 容器化与云服务
3032
** 容器化指南
3133
*** xref:4.6.1.adoc[K8S部署]
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
:sectnums:
2+
:sectnumlevels: 5
3+
4+
= OLAP 分析(ivy_mooncake)
5+
6+
== 概述
7+
8+
*ivy_mooncake* 是 https://github.com/Mooncake-Labs/pg_mooncake[pg_mooncake] 的 IvorySQL 发行版。它是一个 Postgres 扩展,可在 https://iceberg.apache.org/[Apache Iceberg] 中为 Postgres 表创建列存镜像,从而支持亚秒级新鲜度的快速分析(OLAP)查询。它让 IvorySQL 在事务表之上直接获得实时分析处理能力:
9+
10+
* *实时摄取*:由 https://github.com/IvorySQL/ivy_moonlink[moonlink] 驱动,支持流式与批量的 INSERT/UPDATE/DELETE。
11+
* *快速分析*:由 https://github.com/IvorySQL/ivy_duckdb[DuckDB] 加速,在 https://www.mooncake.dev/blog/clickbench-v0.1[ClickBench] 上排名前 10。
12+
* *Postgres 原生*:可像查询普通 Postgres 表一样查询列存表。
13+
* *Iceberg 原生*:数据可被其他查询引擎直接访问。
14+
15+
== 文档下载
16+
17+
* xref:attachment$ivy_mooncake技术白皮书-v1.0beta1.docx[ivy_mooncake 技术白皮书(V1.0 beta1)]
18+
* xref:attachment$ivy_mooncake用户使用手册-v1.0beta1.docx[ivy_mooncake 用户使用手册(V1.0 beta1)]
19+
20+
== 安装
21+
22+
=== 使用 Docker 运行(预览版)
23+
24+
提供了预装 `pg_duckdb` 与 `pg_mooncake` 的 IvorySQL 预览镜像:
25+
26+
[literal]
27+
----
28+
docker run --name ivy_mooncake \
29+
-e IVORYSQL_PASSWORD=password \
30+
-p 5432:5432 -p 1521:1521 \
31+
-v ivy_mooncake_data:/var/lib/ivorysql/data \
32+
-v ivy_mooncake_warehouse:/tmp/moonlink_iceberg \
33+
registry.highgo.com/mooncake/ivy_mooncake:0.1
34+
----
35+
36+
== 快速开始
37+
38+
** 创建 `pg_mooncake` 扩展
39+
+
40+
[literal]
41+
----
42+
CREATE EXTENSION pg_mooncake CASCADE;
43+
----
44+
45+
** 创建普通 Postgres 表 `trades`
46+
+
47+
[literal]
48+
----
49+
CREATE TABLE trades(
50+
id bigint PRIMARY KEY,
51+
symbol text,
52+
time timestamp,
53+
price real
54+
);
55+
----
56+
57+
** 创建与 `trades` 保持同步的列存镜像 `trades_iceberg`
58+
+
59+
[literal]
60+
----
61+
CALL mooncake.create_table('trades_iceberg', 'trades');
62+
----
63+
64+
** 向 `trades` 插入数据
65+
+
66+
[literal]
67+
----
68+
INSERT INTO trades VALUES
69+
(1, 'AMD', '2024-06-05 10:00:00', 119),
70+
(2, 'AMZN', '2024-06-05 10:05:00', 207),
71+
(3, 'AAPL', '2024-06-05 10:10:00', 203),
72+
(4, 'AMZN', '2024-06-05 10:15:00', 210);
73+
----
74+
75+
** 查询 `trades_iceberg`,它反映 `trades` 的最新状态
76+
+
77+
[literal]
78+
----
79+
SELECT avg(price) FROM trades_iceberg WHERE symbol = 'AMZN';
80+
----
Binary file not shown.
Binary file not shown.

EN/modules/ROOT/nav.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
** xref:7.20.adoc[17、sys_guid Function]
2727
** xref:7.21.adoc[18、Empty String to NULL]
2828
** xref:7.22.adoc[19、CALL INTO]
29+
* OLAP Analytics
30+
** xref:ivy_mooncake.adoc[ivy_mooncake]
2931
* Containerization and Cloud Service
3032
** Containerization
3133
*** xref:4.6.1.adoc[K8S deployment]
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
:sectnums:
2+
:sectnumlevels: 5
3+
4+
= OLAP Analytics (ivy_mooncake)
5+
6+
== Overview
7+
8+
*ivy_mooncake* is the IvorySQL distribution of https://github.com/Mooncake-Labs/pg_mooncake[pg_mooncake], a Postgres extension that creates a columnstore mirror of your Postgres tables in https://iceberg.apache.org/[Apache Iceberg], enabling fast analytics (OLAP) queries with sub-second freshness. It gives IvorySQL real-time analytical processing capability directly on top of its transactional tables:
9+
10+
* *Real-time ingestion* powered by https://github.com/IvorySQL/ivy_moonlink[moonlink] for streaming and batched INSERT/UPDATE/DELETE.
11+
* *Fast analytics* accelerated by https://github.com/IvorySQL/ivy_duckdb[DuckDB], ranking top 10 on https://www.mooncake.dev/blog/clickbench-v0.1[ClickBench].
12+
* *Postgres-native*, allowing you to query a columnstore table just like a regular Postgres table.
13+
* *Iceberg-native*, making your data readily accessible by other query engines.
14+
15+
== Documents
16+
17+
* xref:attachment$ivy_mooncake-technical-whitepaper-v1.0beta1.docx[ivy_mooncake Technical White Paper (V1.0 beta1)]
18+
* xref:attachment$ivy_mooncake-user-manual-v1.0beta1.docx[ivy_mooncake User Manual (V1.0 beta1)]
19+
20+
== Installation
21+
22+
=== Run with Docker (preview)
23+
24+
A preview image bundling IvorySQL with `pg_duckdb` and `pg_mooncake` preloaded is available:
25+
26+
[literal]
27+
----
28+
docker run --name ivy_mooncake \
29+
-e IVORYSQL_PASSWORD=password \
30+
-p 5432:5432 -p 1521:1521 \
31+
-v ivy_mooncake_data:/var/lib/ivorysql/data \
32+
-v ivy_mooncake_warehouse:/tmp/moonlink_iceberg \
33+
registry.highgo.com/mooncake/ivy_mooncake:0.1
34+
----
35+
36+
== Quick Start
37+
38+
** Create the `pg_mooncake` extension
39+
+
40+
[literal]
41+
----
42+
CREATE EXTENSION pg_mooncake CASCADE;
43+
----
44+
45+
** Create a regular Postgres table `trades`
46+
+
47+
[literal]
48+
----
49+
CREATE TABLE trades(
50+
id bigint PRIMARY KEY,
51+
symbol text,
52+
time timestamp,
53+
price real
54+
);
55+
----
56+
57+
** Create a columnstore mirror `trades_iceberg` that stays in sync with `trades`
58+
+
59+
[literal]
60+
----
61+
CALL mooncake.create_table('trades_iceberg', 'trades');
62+
----
63+
64+
** Insert some data into `trades`
65+
+
66+
[literal]
67+
----
68+
INSERT INTO trades VALUES
69+
(1, 'AMD', '2024-06-05 10:00:00', 119),
70+
(2, 'AMZN', '2024-06-05 10:05:00', 207),
71+
(3, 'AAPL', '2024-06-05 10:10:00', 203),
72+
(4, 'AMZN', '2024-06-05 10:15:00', 210);
73+
----
74+
75+
** Query `trades_iceberg`; it reflects the up-to-date state of `trades`
76+
+
77+
[literal]
78+
----
79+
SELECT avg(price) FROM trades_iceberg WHERE symbol = 'AMZN';
80+
----

0 commit comments

Comments
 (0)