|
1 | | -# AliSQL |
| 1 | +<p align="center"> |
| 2 | + <img src="https://img.alicdn.com/imgextra/i2/O1CN01dPPLYy1Igf8GHqNIK_!!6000000000921-2-tps-1024-1024.png" width="180" alt="AliSQL Logo"/> |
| 3 | +</p> |
2 | 4 |
|
3 | | -AliSQL is Alibaba's MySQL branch, forked from official MySQL and used extensively in Alibaba Group's production environment. It includes various performance optimizations, stability improvements, and features tailored for large-scale applications. |
| 5 | +<h1 align="center">AliSQL</h1> |
4 | 6 |
|
5 | | -- [AliSQL](#alisql) |
6 | | - - [Quick Start (DuckDB)](#-quick-start-duckdb) |
7 | | - - [Version Information](#version-information) |
8 | | - - [Features](#features) |
9 | | - - [Roadmap](#roadmap) |
10 | | - - [Getting Started](#getting-started) |
11 | | - - [Support](#support) |
12 | | - - [Contributing](#contributing) |
13 | | - - [License](#license) |
14 | | - - [See Also](#see-also) |
| 7 | +<p align="center"> |
| 8 | + <strong>Alibaba's Enterprise MySQL Branch with DuckDB OLAP & Native Vector Search</strong> |
| 9 | +</p> |
15 | 10 |
|
16 | | -## Quick Start (DuckDB) |
| 11 | +<p align="center"> |
| 12 | + <em>Battle-tested in Alibaba's production environment, powering millions of databases</em> |
| 13 | +</p> |
17 | 14 |
|
18 | | -> **Quickly build your DuckDB node:** **[How to set up a DuckDB node](./wiki/duckdb/how-to-setup-duckdb-node-en.md)** |
| 15 | +<p align="center"> |
| 16 | + <a href="https://github.com/alibaba/AliSQL/stargazers"><img src="https://img.shields.io/github/stars/alibaba/AliSQL?style=for-the-badge&logo=github&color=ffca28" alt="GitHub Stars"></a> |
| 17 | + <a href="https://github.com/alibaba/AliSQL/network/members"><img src="https://img.shields.io/github/forks/alibaba/AliSQL?style=for-the-badge&logo=github&color=8bc34a" alt="GitHub Forks"></a> |
| 18 | + <a href="https://github.com/alibaba/AliSQL/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-GPL%202.0-blue?style=for-the-badge" alt="License"></a> |
| 19 | + <a href="https://github.com/alibaba/AliSQL/releases"><img src="https://img.shields.io/badge/MySQL-8.0.44%20LTS-orange?style=for-the-badge&logo=mysql&logoColor=white" alt="MySQL Version"></a> |
| 20 | +</p> |
19 | 21 |
|
20 | | -## Version Information |
| 22 | +<p align="center"> |
| 23 | + <a href="#key-features">Features</a> • |
| 24 | + <a href="#quick-start">Quick Start</a> • |
| 25 | + <a href="#documentation">Docs</a> • |
| 26 | + <a href="#roadmap">Roadmap</a> • |
| 27 | + <a href="#contributing">Contributing</a> |
| 28 | +</p> |
21 | 29 |
|
22 | | -- **AliSQL Version**: 8.0.44 (LTS) |
23 | | -- **Based on**: MySQL 8.0.44 |
| 30 | +<p align="center"> |
| 31 | + <a href="./README_zh.md">简体中文</a> | <a href="./README.md">English</a> |
| 32 | +</p> |
24 | 33 |
|
25 | | -## Features |
| 34 | +--- |
26 | 35 |
|
27 | | -- **[DuckDB Storage Engine](./wiki/duckdb/duckdb-en.md)**:AliSQL integrates DuckDB as a native storage engine, allowing users to operate DuckDB with the same experience as MySQL. By leveraging AliSQL for rapid deployment of DuckDB service nodes, users can easily achieve lightweight analytical capabilities. |
| 36 | +## Why AliSQL? |
28 | 37 |
|
29 | | -- **[Vector Storage](./wiki/vidx/vidx_readme.md)**:AliSQL natively supports enterprise-grade vector processing for up to 16,383 dimensions. By integrating a highly optimized HNSW algorithm for high-performance Approximate Nearest Neighbor (ANN) search, AliSQL empowers users to build AI-driven applications—such as semantic search and recommendation systems—seamlessly using standard SQL interfaces. |
| 38 | +AliSQL brings enterprise-grade capabilities to MySQL, combining the reliability of InnoDB OLTP with DuckDB's blazing-fast analytics and native vector search — all through familiar MySQL interfaces. |
30 | 39 |
|
31 | | -## Roadmap |
| 40 | +<table> |
| 41 | +<tr> |
| 42 | +<td width="33%" align="center"> |
| 43 | + |
| 44 | +### 200x Faster Analytics |
| 45 | + |
| 46 | +DuckDB columnar engine delivers **200x speedup** on analytical queries compared to InnoDB |
| 47 | + |
| 48 | +</td> |
| 49 | +<td width="33%" align="center"> |
| 50 | + |
| 51 | +### Native Vector Search |
| 52 | + |
| 53 | +Built-in HNSW algorithm supporting up to **16,383 dimensions** for AI/ML workloads |
| 54 | + |
| 55 | +</td> |
| 56 | +<td width="33%" align="center"> |
| 57 | + |
| 58 | +### 100% MySQL Compatible |
| 59 | + |
| 60 | +Use your existing MySQL tools, drivers, and SQL — zero learning curve |
32 | 61 |
|
33 | | -- **[DDL Optimization](https://www.alibabacloud.com/help/en/rds/apsaradb-rds-for-mysql/alisql-ddl-best-practices?spm=a2c63.p38356.help-menu-26090.d_2_8_0.1f7a28a5F1ZVeK)** *(planned)*:AliSQL delivers a faster, safer, and lighter DDL experience through innovations such as enhanced Instant DDL, parallel B+tree construction, a non-blocking lock mechanism, and real-time DDL apply—significantly improving schema change efficiency and virtually eliminating replication lag. |
| 62 | +</td> |
| 63 | +</tr> |
| 64 | +</table> |
34 | 65 |
|
35 | | -- **[RTO Optimization](https://www.alibabacloud.com/help/en/rds/apsaradb-rds-for-mysql/best-practices-for-rto-optimization-in-alisql?spm=a3c0i.36496430.J_TlTAa0s_LXHOq4tuiO-gv.1.43c56e9bd5YdDQ&scm=20140722.S_help@@%E6%96%87%E6%A1%A3@@2880006._.ID_help@@%E6%96%87%E6%A1%A3@@2880006-RL_RDSMySQLRTO-LOC_2024SPAllResult-OR_ser-PAR1_0bc3b4af17685488697221621e29f2-V_4-PAR3_r-RE_new5-P0_0-P1_0)** *(planned)*:AliSQL deeply optimizes the end-to-end crash recovery path to accelerate instance startup, shorten RTO, and restore service quickly. |
| 66 | +--- |
36 | 67 |
|
37 | | -- **[Replication Optimization](https://www.alibabacloud.com/help/en/rds/apsaradb-rds-for-mysql/replication-optimization/?spm=a2c63.p38356.help-menu-26090.d_2_6.48a125033Ze9gw)** *(planned)*: AliSQL significantly boosts replication throughput and minimizes lag by implementing Binlog Parallel Flush, Binlog in Redo, and specialized optimizations for large transactions and DDL operations. |
| 68 | +## Key Features |
38 | 69 |
|
39 | | -## Getting Started |
40 | | -**Prerequisites**: |
41 | | -- [CMake](https://cmake.org) 3.x or higher |
42 | | -- Python3 |
43 | | -- C++17 compliant compiler (GCC 7+ or Clang 5+) |
| 70 | +| Feature | Description | Status | |
| 71 | +|---------|-------------|--------| |
| 72 | +| **DuckDB Storage Engine** | Columnar OLAP engine with automatic compression, perfect for analytics workloads | Available | |
| 73 | +| **Vector Index (VIDX)** | Native vector storage & ANN search with HNSW, supports COSINE & EUCLIDEAN distance | Available | |
| 74 | +| **DDL Optimization** | Instant DDL, parallel B+tree construction, non-blocking locks | Planned | |
| 75 | +| **RTO Optimization** | Accelerated crash recovery for faster instance startup | Planned | |
| 76 | +| **Replication Boost** | Binlog Parallel Flush, Binlog in Redo, large transaction optimization | Planned | |
44 | 77 |
|
45 | | -**Build Instructions**: |
| 78 | +--- |
| 79 | + |
| 80 | +## Quick Start |
| 81 | + |
| 82 | +### Option 1: Build from Source |
46 | 83 |
|
47 | 84 | ```bash |
48 | 85 | # Clone the repository |
49 | 86 | git clone https://github.com/alibaba/AliSQL.git |
50 | 87 | cd AliSQL |
51 | 88 |
|
52 | | -# Build the project (release build) |
53 | | -sh build.sh -t release -d /path/to/install/dir |
| 89 | +# Build (release mode) |
| 90 | +sh build.sh -t release -d ~/alisql |
54 | 91 |
|
55 | | -# For development/debugging (debug build) |
56 | | -sh build.sh -t debug -d /path/to/install/dir |
57 | | - |
58 | | -# Install the built MySQL server |
| 92 | +# Install |
59 | 93 | make install |
60 | 94 | ``` |
61 | 95 |
|
62 | | -**Build Options**: |
63 | | -- `-t release|debug`: Build type (default: debug) |
64 | | -- `-d <dest_dir>`: Installation directory (default: /usr/local/alisql or $HOME/alisql) |
65 | | -- `-s <server_suffix>`: Server suffix (default: alisql-dev) |
66 | | -- `-g asan|tsan`: Enable sanitizer |
67 | | -- `-c`: Enable GCC coverage (gcov) |
68 | | -- `-h, --help`: Show help |
| 96 | +### Option 2: Set Up a DuckDB Analytical Node |
69 | 97 |
|
70 | | -## Support |
71 | | -- **GitHub Issues**: [https://github.com/alibaba/AliSQL/issues](https://github.com/alibaba/AliSQL/issues) |
72 | | -- **Alibaba Cloud RDS**: [DuckDB-based Analytical Instance](https://help.aliyun.com/zh/rds/apsaradb-rds-for-mysql/duckdb-based-analytical-instance/) |
| 98 | +> **Step-by-step guide:** [How to set up a DuckDB node](./wiki/duckdb/how-to-setup-duckdb-node-en.md) |
73 | 99 |
|
74 | | -> For DuckDB-specific support, see the [DuckDB Support Options](https://duckdblabs.com/support/). |
| 100 | +### Initialize & Start Server |
75 | 101 |
|
76 | | -## Contributing |
| 102 | +```bash |
| 103 | +# Initialize data directory |
| 104 | +~/alisql/bin/mysqld --initialize-insecure --datadir=~/alisql/data |
77 | 105 |
|
78 | | -AliSQL 8.0 became an open-source project in December 2025 and is actively maintained by engineers at Alibaba Group. |
| 106 | +# Start the server |
| 107 | +~/alisql/bin/mysqld --datadir=~/alisql/data |
| 108 | +``` |
79 | 109 |
|
80 | | -Contributions are welcome! Please: |
81 | | -1. Fork the repository |
82 | | -2. Create a feature branch |
83 | | -3. Make your changes with appropriate tests |
84 | | -4. Submit a pull request |
| 110 | +--- |
85 | 111 |
|
86 | | -For bug reports and feature requests, please use the [GitHub Issues](https://github.com/alibaba/AliSQL/issues) page. |
| 112 | +## Usage Examples |
87 | 113 |
|
88 | | -## License |
| 114 | +### DuckDB for Analytics |
89 | 115 |
|
90 | | -This project is licensed under the GPL-2.0 license. See the [LICENSE](LICENSE) file for details. |
| 116 | +```sql |
| 117 | +-- Create an analytical table with DuckDB engine |
| 118 | +CREATE TABLE sales_analytics ( |
| 119 | + sale_date DATE, |
| 120 | + product_id INT, |
| 121 | + revenue DECIMAL(10,2), |
| 122 | + quantity INT |
| 123 | +) ENGINE=DuckDB; |
91 | 124 |
|
92 | | -AliSQL is based on MySQL, which is licensed under GPL-2.0. The DuckDB integration follows the same licensing terms. |
| 125 | +-- Run complex analytics (200x faster than InnoDB!) |
| 126 | +SELECT |
| 127 | + DATE_FORMAT(sale_date, '%Y-%m') as month, |
| 128 | + SUM(revenue) as total_revenue, |
| 129 | + COUNT(*) as transactions |
| 130 | +FROM sales_analytics |
| 131 | +GROUP BY month |
| 132 | +ORDER BY total_revenue DESC; |
| 133 | +``` |
| 134 | + |
| 135 | +### Vector Search for AI Applications |
| 136 | + |
| 137 | +```sql |
| 138 | +-- Create a table with vector column |
| 139 | +CREATE TABLE embeddings ( |
| 140 | + id INT PRIMARY KEY, |
| 141 | + content TEXT, |
| 142 | + embedding VECTOR(768) -- 768-dimensional vectors |
| 143 | +) ENGINE=InnoDB; |
| 144 | + |
| 145 | +-- Create HNSW index for fast ANN search |
| 146 | +CREATE VECTOR INDEX idx_embedding ON embeddings(embedding); |
| 147 | + |
| 148 | +-- Find similar items using cosine distance |
| 149 | +SELECT id, content, |
| 150 | + COSINE_DISTANCE(embedding, '[0.1, 0.2, ...]') as distance |
| 151 | +FROM embeddings |
| 152 | +ORDER BY distance |
| 153 | +LIMIT 10; |
| 154 | +``` |
| 155 | + |
| 156 | +--- |
| 157 | + |
| 158 | +## Build Options |
| 159 | + |
| 160 | +| Option | Description | Default | |
| 161 | +|--------|-------------|---------| |
| 162 | +| `-t release\|debug` | Build type | `debug` | |
| 163 | +| `-d <dir>` | Installation directory | `/usr/local/alisql` | |
| 164 | +| `-g asan\|tsan` | Enable sanitizer (memory/thread) | disabled | |
| 165 | +| `-c` | Enable code coverage (gcov) | disabled | |
| 166 | + |
| 167 | +**Prerequisites:** CMake 3.x+, Python 3, GCC 7+ or Clang 5+ |
| 168 | + |
| 169 | +--- |
| 170 | + |
| 171 | +## Roadmap |
| 172 | + |
| 173 | +``` |
| 174 | +Q4 2025 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 175 | + [x] DuckDB Storage Engine [x] Vector Index (VIDX) [x] Open Source |
| 176 | +
|
| 177 | +2026 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 178 | + [ ] DDL Optimization [ ] RTO Optimization [ ] Replication Boost |
| 179 | + - Instant DDL - Fast Crash Recovery - Binlog Parallel Flush |
| 180 | + - Parallel B+tree - Minimize RTO - Binlog in Redo |
| 181 | + - Non-blocking Locks - Large TX Optimization |
| 182 | +``` |
93 | 183 |
|
94 | | -## See Also |
95 | | -- [AliSQL Release Notes](./wiki/changes-in-alisql-8.0.44.md) |
96 | | -- [DuckDB Storage Engine in AliSQL](./wiki/duckdb/duckdb-en.md) |
97 | | -- [Vector Index in AliSQL](./wiki/vidx/vidx_readme.md) |
| 184 | +--- |
| 185 | + |
| 186 | +## Documentation |
| 187 | + |
| 188 | +| Document | Description | |
| 189 | +|----------|-------------| |
| 190 | +| [DuckDB Integration Guide](./wiki/duckdb/duckdb-en.md) | Complete guide for DuckDB storage engine | |
| 191 | +| [Vector Index Guide](./wiki/vidx/vidx_readme.md) | Native vector storage and ANN search | |
| 192 | +| [Release Notes](./wiki/changes-in-alisql-8.0.44.md) | What's new in AliSQL 8.0.44 | |
| 193 | +| [Setup DuckDB Node](./wiki/duckdb/how-to-setup-duckdb-node-en.md) | Quick setup guide for analytics | |
| 194 | + |
| 195 | +**External Resources:** |
98 | 196 | - [MySQL 8.0 Documentation](https://dev.mysql.com/doc/refman/8.0/en/) |
99 | | -- [MySQL 8.0 Github Repository](https://github.com/mysql/mysql-server) |
100 | | -- [DuckDB Official Documentation](https://duckdb.org/docs/stable/) |
101 | | -- [DuckDB GitHub Repository](https://github.com/duckdb/duckdb) |
| 197 | +- [DuckDB Official Docs](https://duckdb.org/docs/stable/) |
102 | 198 | - [Detailed Article (Chinese)](https://mp.weixin.qq.com/s/_YmlV3vPc9CksumXvXWBEw) |
| 199 | + |
| 200 | +--- |
| 201 | + |
| 202 | +## Contributing |
| 203 | + |
| 204 | +AliSQL became open source in December 2025 and is actively maintained by Alibaba Cloud Database Team. |
| 205 | + |
| 206 | +We welcome contributions of all kinds! |
| 207 | + |
| 208 | +1. **Fork** the repository |
| 209 | +2. **Create** a feature branch (`git checkout -b feature/amazing-feature`) |
| 210 | +3. **Commit** your changes (`git commit -m 'Add amazing feature'`) |
| 211 | +4. **Push** to the branch (`git push origin feature/amazing-feature`) |
| 212 | +5. **Open** a Pull Request |
| 213 | + |
| 214 | +For bugs and feature requests, please use [GitHub Issues](https://github.com/alibaba/AliSQL/issues). |
| 215 | + |
| 216 | +--- |
| 217 | + |
| 218 | +## Community & Support |
| 219 | + |
| 220 | +<table> |
| 221 | +<tr> |
| 222 | +<td align="center" width="50%"> |
| 223 | + |
| 224 | +**GitHub Issues** |
| 225 | + |
| 226 | +For bug reports & feature requests |
| 227 | + |
| 228 | +[Open an Issue](https://github.com/alibaba/AliSQL/issues) |
| 229 | + |
| 230 | +</td> |
| 231 | +<td align="center" width="50%"> |
| 232 | + |
| 233 | +**Alibaba Cloud RDS** |
| 234 | + |
| 235 | +Managed DuckDB analytical instances |
| 236 | + |
| 237 | +[Learn More](https://help.aliyun.com/zh/rds/apsaradb-rds-for-mysql/duckdb-based-analytical-instance/) |
| 238 | + |
| 239 | +</td> |
| 240 | +</tr> |
| 241 | +</table> |
| 242 | + |
| 243 | +--- |
| 244 | + |
| 245 | +## License |
| 246 | + |
| 247 | +AliSQL is licensed under **GPL-2.0**, the same license as MySQL. |
| 248 | + |
| 249 | +See the [LICENSE](LICENSE) file for details. |
| 250 | + |
| 251 | +--- |
| 252 | + |
| 253 | +## Star History |
| 254 | + |
| 255 | +<p align="center"> |
| 256 | + <a href="https://star-history.com/#alibaba/AliSQL&Date"> |
| 257 | + <img src="https://api.star-history.com/svg?repos=alibaba/AliSQL&type=Date" alt="Star History Chart" width="600"> |
| 258 | + </a> |
| 259 | +</p> |
| 260 | + |
| 261 | +--- |
| 262 | + |
| 263 | +<p align="center"> |
| 264 | + Made with care by <a href="https://www.alibabacloud.com/product/apsaradb-for-rds-mysql">Alibaba Cloud Database Team</a> |
| 265 | +</p> |
| 266 | + |
| 267 | +<p align="center"> |
| 268 | + <a href="https://github.com/alibaba/AliSQL">GitHub</a> • |
| 269 | + <a href="https://github.com/mysql/mysql-server">MySQL</a> • |
| 270 | + <a href="https://github.com/duckdb/duckdb">DuckDB</a> |
| 271 | +</p> |
0 commit comments