├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.yml
│ ├── feature_request.md
│ └── general_question.md
└── workflows
│ ├── deploy.yml
│ └── test-deploy.yml
├── .gitignore
├── LICENSE
├── LICENSE-docs
├── README.md
├── babel.config.js
├── community
└── main.md
├── docs
├── 00-about-stonedb
│ ├── _category_.json
│ ├── architecture.md
│ ├── intro.md
│ ├── limits.md
│ └── terms.md
├── 01-environment-requirements
│ ├── _category_.json
│ ├── server-configuration-requirements.md
│ └── supported-servers-and-oss.md
├── 02-getting-started
│ ├── _category_.json
│ ├── basic-operations.md
│ ├── quick-deployment.md
│ └── quick-start.md
├── 03-O&M-Guide
│ ├── 00-monitoring-and-alerting
│ │ ├── _category_.json
│ │ └── prometheus+grafana-monitor.md
│ ├── 01-backup-and-recovery
│ │ ├── _category_.json
│ │ ├── use-mydumper-full-backup.md
│ │ └── use-mysqldump-backup-and-restore.md
│ ├── _category_.json
│ └── regular-change-operations.md
├── 04-developer-guide
│ ├── 00-compiling-methods
│ │ ├── _category_.json
│ │ ├── compile-overview.md
│ │ ├── compile-using-centos7.md
│ │ ├── compile-using-docker.md
│ │ ├── compile-using-redhat7.md
│ │ └── compile-using-ubuntu2004.md
│ ├── 01-connect-to-stonedb
│ │ ├── _category_.json
│ │ ├── use-mysql-client.md
│ │ └── use-navicat.md
│ ├── 04-create-and-manage-database-objects
│ │ ├── _category_.json
│ │ ├── create-and-manage-database.md
│ │ ├── create-and-manage-stored-procedure.md
│ │ ├── create-and-manage-table.md
│ │ └── create-and-manage-view.md
│ ├── 05-appendix
│ │ ├── _category_.json
│ │ ├── configuration-parameters.md
│ │ └── error-codes.md
│ ├── DML-starements.md
│ ├── _category_.json
│ └── statements-for-queries.md
├── 05-SQL-reference
│ ├── 03-operators
│ │ ├── _category_.json
│ │ ├── arithmetic-operators.md
│ │ ├── assignment-operators.md
│ │ ├── bitwise-operators.md
│ │ ├── comparison-operators.md
│ │ └── logical-operators.md
│ ├── 04-functions
│ │ ├── _category_.json
│ │ ├── advanced-functions.md
│ │ ├── aggregate-functions.md
│ │ ├── date-and-time-functions.md
│ │ ├── mathematical-functions.md
│ │ └── string-functions.md
│ ├── _category_.json
│ ├── character-sets.md
│ └── data-types.md
├── 06-performance-tuning
│ ├── 02-performance-monitoring-commands
│ │ ├── _category_.json
│ │ ├── cpu-monitor.md
│ │ ├── disk-io-monitor.md
│ │ ├── mem-monitor.md
│ │ ├── network-monitor.md
│ │ └── top-commands.md
│ ├── 04-database-tuning
│ │ ├── _category_.json
│ │ ├── parameter-tuning.md
│ │ ├── sql-best-practices.md
│ │ └── sql-tuning.md
│ ├── 05-architecture-tuning
│ │ ├── _category_.json
│ │ └── read_write-splitting.md
│ ├── 06-performance-tests
│ │ ├── 00-OLAP
│ │ │ ├── _category_.json
│ │ │ ├── olap-performance-test-method.md
│ │ │ └── tcph-test-report.md
│ │ ├── 01-OLTP
│ │ │ ├── _category_.json
│ │ │ └── oltp-performance-test-method.md
│ │ └── _category_.json
│ ├── _category_.json
│ ├── os-tuning.md
│ └── overview.md
├── 07-data-migration-to-stonedb
│ ├── _category_.json
│ ├── use-gravity-to-migrate.md
│ └── use-otter-to-migrate.md
├── 08-troubleshooting
│ ├── _category_.json
│ ├── excessive-large-directory.md
│ ├── failed-to-connect.md
│ ├── failed-to-operate-table.md
│ ├── failed-to-start-in-kvm.md
│ ├── failed-to-start.md
│ ├── mdl-wait.md
│ ├── resource-bottleneck.md
│ ├── slow-query.md
│ └── stonedb-crashed.md
├── 09-FAQ
│ ├── _category_.json
│ ├── install-faq.md
│ ├── stonedb-faq.md
│ └── troubleshoot-faq.md
├── download.md
└── release-notes.md
├── docusaurus.config.js
├── i18n
├── en
│ └── code.json
└── zh
│ ├── code.json
│ ├── docusaurus-plugin-content-blog-community
│ ├── main.md
│ └── options.json
│ ├── docusaurus-plugin-content-blog
│ └── options.json
│ ├── docusaurus-plugin-content-docs
│ ├── current.json
│ └── current
│ │ ├── 00-about-stonedb
│ │ ├── architecture.md
│ │ ├── intro.md
│ │ ├── limits.md
│ │ └── terms.md
│ │ ├── 01-environment-requirements
│ │ └── supported-servers-and-oss.md
│ │ ├── 02-getting-started
│ │ ├── quick-deployment.md
│ │ └── quick-start.md
│ │ ├── 03-O&M-Guide
│ │ └── regular-change-operations.md
│ │ └── download.md
│ └── docusaurus-theme-classic
│ ├── footer.json
│ └── navbar.json
├── package.json
├── plugins
├── community
│ ├── index.js
│ └── theme
│ │ └── CommunityItem
│ │ ├── index.tsx
│ │ └── styles.module.css
└── fetch-repo
│ └── index.js
├── scripts
├── config.theme.js
├── css.js
├── styles.jsx
├── theme.less
└── var.less
├── sidebars.js
├── src
├── components
│ ├── Link
│ │ ├── index.tsx
│ │ ├── interface.ts
│ │ └── styles.ts
│ ├── contact
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── default.interface.ts
│ ├── docLinks
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── download
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── emailModal
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── events
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── feature
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── footLink
│ │ ├── index.tsx
│ │ └── styles.tsx
│ ├── github
│ │ ├── fork.tsx
│ │ ├── index.tsx
│ │ ├── interface.ts
│ │ ├── star.tsx
│ │ └── styles.ts
│ ├── icon
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── image
│ │ ├── index.tsx
│ │ ├── interface.ts
│ │ └── styles.ts
│ ├── index.ts
│ ├── join
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── omit
│ │ ├── index.tsx
│ │ └── interface.ts
│ ├── seeMore
│ │ ├── index.tsx
│ │ ├── interface.ts
│ │ └── styles.ts
│ ├── social
│ │ ├── index.tsx
│ │ └── interface.ts
│ ├── styles.ts
│ ├── subscribe
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── subscribeMail
│ │ ├── form.tsx
│ │ ├── index.tsx
│ │ ├── interface.ts
│ │ ├── message.tsx
│ │ ├── styles.ts
│ │ └── tip.tsx
│ ├── switchLocale
│ │ ├── index.tsx
│ │ └── styles.ts
│ └── team
│ │ ├── index.tsx
│ │ └── styles.ts
├── css
│ ├── custom.less
│ └── theme.css
├── pages
│ ├── index.tsx
│ └── styles
│ │ └── panel.ts
├── remark
│ ├── imageList
│ │ ├── index.js
│ │ └── list.js
│ ├── remark-math
│ │ ├── block copy
│ │ ├── block.js
│ │ └── index.js
│ ├── table.js
│ ├── ul.js
│ └── util.js
├── theme
│ ├── BlogLayout
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── BlogPostItem
│ │ ├── index.tsx
│ │ └── styles.module.css
│ ├── Footer
│ │ └── LinkItem
│ │ │ ├── index.tsx
│ │ │ └── styles.tsx
│ ├── IconLanguage
│ │ └── index.tsx
│ ├── Logo
│ │ └── index.tsx
│ ├── MDXComponents
│ │ ├── A
│ │ │ └── index.tsx
│ │ ├── Image.tsx
│ │ ├── Pre.tsx
│ │ └── index.tsx
│ ├── Navbar
│ │ └── MobileSidebar
│ │ │ ├── Header
│ │ │ └── index.tsx
│ │ │ ├── Layout
│ │ │ └── index.tsx
│ │ │ ├── PrimaryMenu
│ │ │ └── index.tsx
│ │ │ ├── SecondaryMenu
│ │ │ └── index.tsx
│ │ │ ├── Toggle
│ │ │ └── index.tsx
│ │ │ └── index.tsx
│ ├── NavbarItem
│ │ └── ComponentTypes.tsx
│ ├── NotFound.tsx
│ └── TOCItems
│ │ ├── Tree.tsx
│ │ └── index.tsx
└── utils
│ ├── getRepoDetail.ts
│ ├── index.ts
│ ├── loadScript.ts
│ ├── modifyKeyName.ts
│ ├── pickWhen.ts
│ ├── postSubscribe.ts
│ └── regs.ts
├── static
├── .nojekyll
├── CNAME
├── img
│ ├── favicon.ico
│ ├── icons
│ │ ├── 128x128.png
│ │ ├── 144x144.png
│ │ ├── 152x152.png
│ │ ├── 192x192.png
│ │ ├── 200x200.png
│ │ ├── 384x384.png
│ │ ├── 512x512.png
│ │ ├── 72x72.png
│ │ └── 96x96.png
│ ├── logo_stonedb.svg
│ └── stoneDB.png
└── manifest.json
├── tsconfig.json
└── yarn.lock
/.github/ISSUE_TEMPLATE/bug_report.yml:
--------------------------------------------------------------------------------
1 | name: "\U0001F41B Bug or Crash Report"
2 | title: "bug: "
3 | description: Unexpected behavior with StoneDB.
4 | labels: ["bug"]
5 | body:
6 | - type: textarea
7 | attributes:
8 | label: Describe the problem
9 | placeholder: >
10 | Please describe the problem you observed.
11 |
12 | - type: textarea
13 | attributes:
14 | label: Expected behavior
15 | placeholder: >
16 | Expected behavior you want to see.
17 |
18 | - type: textarea
19 | attributes:
20 | label: How To Reproduce
21 | placeholder: >
22 | Provide minimal steps to reproduce the behavior:
23 |
24 | - type: textarea
25 | attributes:
26 | label: Environment
27 | placeholder: >
28 | Please describe your environment.
29 | 1. Server OS [e.g. Linux/MacOS/Distrib ...]
30 | 2. StoneDB Version [e.g. 1.0.x]
31 |
32 | - type: checkboxes
33 | attributes:
34 | label: Are you interested in submitting a PR to solve the problem?
35 | description: >
36 | We are looking forward to working with you to make a better StoneDB community.
37 | options:
38 | - label: Yes, I will!
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F680 Feature request"
3 | title: "feature: "
4 | about: Suggest an idea for StoneDB Docs
5 | labels: ["feature"]
6 | ---
7 |
8 | **Is your feature request related to a problem? Please describe.**
9 |
10 |
11 | **Describe the solution you'd like**
12 |
13 |
14 | **Describe alternatives you've considered**
15 |
16 |
17 | **Additional context**
18 |
19 |
20 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/general_question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F914 Ask a Question"
3 | title: "question: "
4 | about: Need support & not sure if this a bug? You can ask a question.
5 | labels: ["question"]
6 | ---
7 |
8 | ## General Question
9 |
10 | Before asking a question, make sure you have:
11 |
12 | - Searched existing Stack Overflow questions.
13 | - Googled your question.
14 | - Searched open and closed [GitHub issues](https://github.com/stoneatom/stonedb-docs/issues)
15 | - Searched our discussions [Discussion](https://github.com/stoneatom/stonedb-docs/discussions)
16 | - Read the documentation:
17 | - [StoneDB Readme](https://github.com/stoneatom/stonedb)
18 | - [StoneDB Documentation Readme](https://github.com/stoneatom/stonedb-docs)
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy to GitHub Pages
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | # Review gh actions docs if you want to further define triggers, paths, etc
8 | # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9 |
10 | jobs:
11 | deploy:
12 | name: Deploy to GitHub Pages
13 | runs-on: ubuntu-latest
14 | steps:
15 | - uses: actions/checkout@v2
16 | - uses: actions/setup-node@v3
17 | with:
18 | node-version: 16.x
19 | cache: yarn
20 |
21 | - name: Install dependencies
22 | run: yarn install --frozen-lockfile
23 | - name: Build website
24 | run: yarn build
25 |
26 | # Popular action to deploy to GitHub Pages:
27 | # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
28 | - name: Deploy to GitHub Pages
29 | uses: peaceiris/actions-gh-pages@v3
30 | with:
31 | github_token: ${{ secrets.GITHUB_TOKEN }}
32 | # Build output to publish to the `gh-pages` branch:
33 | publish_dir: ./build
34 | # The following lines assign commit authorship to the official
35 | # GH-Actions bot for deploys to `gh-pages` branch:
36 | # https://github.com/actions/checkout/issues/13#issuecomment-724415212
37 | # The GH actions bot is used by default if you didn't specify the two fields.
38 | # You can swap them out with your own user credentials.
39 | user_name: stoneatomadmin
40 | user_email: github@stoneatom.com
41 | permissions:
42 | actions: write
43 | checks: write
44 | contents: write
45 | deployments: write
46 | pages: write
47 | repository-projects: write
48 | security-events: write
49 | statuses: write
50 |
--------------------------------------------------------------------------------
/.github/workflows/test-deploy.yml:
--------------------------------------------------------------------------------
1 | name: Test deployment
2 |
3 | on:
4 | pull_request:
5 | branches:
6 | - main
7 | # Review gh actions docs if you want to further define triggers, paths, etc
8 | # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9 |
10 | jobs:
11 | test-deploy:
12 | name: Test deployment
13 | runs-on: ubuntu-latest
14 | steps:
15 | - uses: actions/checkout@v2
16 | - uses: actions/setup-node@v3
17 | with:
18 | node-version: 16.x
19 | cache: yarn
20 |
21 | - name: Install dependencies
22 | run: yarn install --frozen-lockfile
23 | - name: Test build website
24 | run: yarn build
25 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Dependencies
2 | /node_modules
3 |
4 | # Production
5 | /build
6 |
7 | # Generated files
8 | .docusaurus
9 | .cache-loader
10 |
11 | # Misc
12 | .DS_Store
13 | .env.local
14 | .env.development.local
15 | .env.test.local
16 | .env.production.local
17 |
18 | npm-debug.log*
19 | yarn-debug.log*
20 | yarn-error.log*
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 StoneAtom Ltd.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # stonedb
2 | StoneDB is a MySQL HTAP database developed by StoneAtom Technology Co.,Ltd.
3 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3 | plugins: [
4 | "babel-plugin-styled-components",
5 | ["import", { "libraryName": "antd", "libraryDirectory": "es", "style": true }],
6 | ]
7 | };
8 |
--------------------------------------------------------------------------------
/docs/00-about-stonedb/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 1,
3 | "label": "About StoneDB",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/00-about-stonedb/architecture.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: architecture
3 | sidebar_position: 1.2
4 | ---
5 |
6 | # Architecture
7 |
--------------------------------------------------------------------------------
/docs/00-about-stonedb/intro.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: intro
3 | sidebar_position: 1.1
4 | ---
5 | # StoneDB Introduction
6 |
7 | StoneDB is an open-source hybrid transaction/analytical processing (HTAP) database designed and developed by StoneAtom based on the MySQL kernel. It is the first database of this type launched in China. StoneDB can be seamlessly switched from MySQL. It provides features such as optimal performance and real-time analytics, offering you a one-stop solution to process online transaction processing (OLTP), online analytical processing (OLAP), and HTAP workloads.
8 |
9 | StoneDB is fully compatible with the MySQL 5.6 and 5.7 protocols, the MySQL ecosystem, and common MySQL features and syntaxes. You can use tools and clients in the MySQL ecosystem on StoneDB, such as Navicat, Workbench, mysqldump, and mydumper. In addition, all workloads on StoneDB can be run on MySQL.
10 |
11 | StoneDB is optimized for OLAP applications. StoneDB that runs on a common server can process complex queries on tens of billions of data records, while ensuring high performance. Compared to databases that use MySQL Community Edition, StoneDB is at least 10 times faster in processing queries.
12 |
13 | StoneDB uses the knowledge grid technology and a column-based storage engine. This storage engine is designed for OLAP applications and uses techniques such as column-based storage, knowledge grid-based filtering, and high-efficiency data compression. With such storage engine, StoneDB provides application systems with high-performance and reduces the total cost of ownership (TCO).
14 |
15 | ## Advantages
16 | ### Integration of MySQL
17 | StoneDB is an HTAP database built on MySQL. To enhance analytics capabilities, it integrates a self-developed engine also named StoneDB. (In this topic, StoneDB refers to the database, if not otherwise specified.) For this reason, StoneDB is fully compatible with MySQL. You can use standard interfaces, such as Open Database Connectivity (ODBC) and Java Database Connectivity (JDBC) to connect to StoneDB. In addition, you can create local connections to connect to StoneDB. StoneDB supports APIs written in various programming languages, such as C, C++, C#, Java, PHP, and Perl. StoneDB is fully compatible with views and stored procedures that comply with the ANSI SQL-92 standard and the SQL-99 standard. In this way, your application systems that can run on MySQL can directly run on StoneDB, without the need to modify the code. This allows you to seamlessly switch MySQL to StoneDB.
18 |
19 | ### Real-time HTAP
20 | StoneDB provides two engines: row-based storage engine InnoDB and column-based storage engine StoneDB. StoneDB uses binlogs to replicate data from the row-based storage engine to the column-based storage engine in real time. This ensures strong data consistency between the two storage engines.
21 |
22 | ## Key techniques
23 | ### Column-based storage engine
24 | A column-based storage engine stores data to disks column by column. When you query data, only the required fields are retrieved, which greatly reduces memory bandwidth traffic and disk I/O. In addition, in a column-based storage engine, columns do not need to be indexed, freeing the database from maintaining such indexes.
25 |
26 | ### High-efficiency data compression
27 | In a relational database, values in the same column are of the same data type. More duplicate values stored in a column indicate a higher data compression ratio and a smaller data volume. By virtue of this, less data is retrieved for queries, and thus memory bandwidth traffic and disk I/O are reduced.
28 |
29 | StoneDB saves storage space by using column-based storage. The data compression ratio of a column-oriented database is at least 10 times higher than that of a row-oriented database.
30 | ### Knowledge grid
31 | A knowledge grid can filter data packs based on metadata, and then decompress the data packs to obtain the data that meets the query conditions. This greatly reduces I/O, and improves response speed and network utilization.
32 | ### Push-based vectorized query execution
33 | When processing a query, StoneDB pushes column-based data packs from one operator to another based on the execution plan. Compared to the execution model used by row-oriented databases, push-based execution prevents in-depth calls of stacks and saves resources.
34 |
35 |
--------------------------------------------------------------------------------
/docs/00-about-stonedb/limits.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: limits
3 | sidebar_position: 1.3
4 | ---
5 |
6 | # Limits
7 | As a conlumn-based storage engine, StoneDB is built on MySQL. Therefore, StoneDB is highly compatible with the MySQL 5.6 and 5.7 protocols, and the ecosystem, common features, and common syntaxes of MySQL. However, due to characteristics of column-based storage, StoneDB is incompatible with certain MySQL operations and features.
8 | ## Unsupported DDL operations
9 | StoneDB does not support the following DDL operations:
10 |
11 | - Modify the data type of a field.
12 | - Modify the length of a field.
13 | - Change the character set of a table or a field.
14 | - Convert the character set for a table.
15 | - Optimize a table.
16 | - Analyze a table.
17 | - Lock a table.
18 | - Repair a table.
19 | - Execute a CREATE TABLE… AS SELECT statement.
20 | - Reorganize a table.
21 | - Rename a field.
22 | - Configure the default value for a field.
23 | - Specify the default value of a field to null.
24 | - Specify the default value of a field to non-null.
25 | - Add a unique constraint.
26 | - Delete a unique constraint.
27 | - Create an index.
28 | - Remove an index.
29 | - Modify a table comment.
30 |
31 | Data stored in StoneDB is highly compressed. For this reason, table attributes and column attributes are difficult to modify. The character sets, data types, constraints, and indexes must be properly defined when tables are being created.
32 | ## Unsupported DML operations
33 | StoneDB does not support the following DML operations:
34 |
35 | - Execute a DELETE statement.
36 | - Use subqueries in an UPDATE statement.
37 | - Execute an UPDATE… JOIN statement to update multiple tables.
38 | - Execute a REPLACE… INTO statement.
39 |
40 | StoneDB is not suitable for applications that are frequently updated. It supports only single-table update and insert operations. This is because a column-oriented database needs to find each corresponding column and update the value in the row when processing an update operation. However, a row-oriented database stores data by row. When processing an update operation, the row-oriented database only needs to find the corresponding page or block and update the data directly in the row.
41 | ## Unsupported objects
42 | StoneDB does not support the following objects:
43 |
44 | - Global indexes
45 | - Unique constraints
46 | - Triggers
47 | - Temporary tables
48 | - Stored procedures containing dynamic SQL statements
49 | - User-defined functions containing nested SQL statements
50 |
51 | If you want to use user-defined functions that contain nested SQL statements, set the **stonedb_ini_allowmysqlquerypath** parameter to **1** in the **stonedb.cnf** configuration file.
52 | ## Unsupported data types
53 | StoneDB does not support the following data types:
54 |
55 | - bit
56 | - enum
57 | - set
58 | - decimal whose precision is higher than 18, for example, decimal(19,x)
59 | - Data types that contain keyword **unsigned** or **zerofill**
60 | ## Unsupported binary log formats
61 | StoneDB does not support the following binary log formats:
62 |
63 | - row
64 | - mixed
65 |
66 | Column-based storage engines support only statement-based binary logs. Row-based binary logs and mixed binary logs are not supported.
67 | ## Join queries across storage engines not supported
68 | By default, StoneDB does not support join queries across storage engines. If a join query involves tables in both InnoDB and StoneDB, an error will be reported. You can set the **stonedb_ini_allowmysqlquerypath** parameter to **1** in the **stonedb.cnf** configuration file to remove this limit.
69 | ## Transactions not supported
70 | Transactions must strictly comply with the ACID attributes. However, StoneDB does not support redo and undo logs and thus does not support transactions.
71 | ## Partitions not supported
72 | Column-based storage engines do not support partitioning.
73 | ## Column locking and table locking not supported
74 | Column-based storage engines do not support column locking or table locking.
75 |
76 |
--------------------------------------------------------------------------------
/docs/00-about-stonedb/terms.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: terms
3 | sidebar_position: 1.4
4 | ---
5 |
6 | # Terms
7 |
8 | | **Term** | **Description** |
9 | | :-- | :-- |
10 | | **row** | A series of data that makes up a record. |
11 | | **column** | Also referred to as field. In a relational database, a field must be associated with a data type when the field is being created. |
12 | | **table** | Consists of rows and columns. Databases use tables to store data. Tables are essential objects in databases. |
13 | | **view** | A virtual table that does not store actual data. It is based on the result set of an SQL statement. |
14 | | **stored procedure** | A collection of one or more SQL statements that are compiled and then stored in a database to execute a specific operation. To execute a stored procedure, you need to specify the name and required parameters of the stored procedure. |
15 | | **database** | A collection of database objects such as tables, views, and stored procedures. |
16 | | **instance** | A collection of databases. |
17 | | **data page** | The basic unit for database management. The default size for a data page is 16 KB. |
18 | | **data file** | Used for storing data. By default, one table corresponds to one data file. |
19 | | **tablespace** | A logical storage unit. By default, one table corresponds to one tablespace. |
20 | | **transaction** | A sequence of DML operations. This sequence satisfies the atomicity, consistency, isolation, and durability (ACID) properties. A transaction must end with a submission or rollback. Implicit submission by using DDL statements are supported. |
21 | | **character set** | A collection of symbols and encodings. |
22 | | **collation** | A collation is a collection of rules for comparing and sorting character strings. |
23 | | **column-based storage** | Stores data by column to disks. |
24 | | **data compression** | A process performed to reduce the size of data files. The data compression ratio is determined by the data type, degree of duplication, and compression algorithm. |
25 | | **OLTP** | The acronym of online transaction processing. OLTP features quick response for interactions and high concurrency of small transactions. Typical applications are transaction systems of banks. |
26 | | **OLAP** | The acronym of online analytical processing. OLAP features complex analytical querying on a large amount of data. Typical applications are data warehouses. |
27 | | **HTAP** | The acronym of hybrid transaction/analytical processing. HTAP is an emerging application architecture built to allow one system for both transactions and analytics. |
--------------------------------------------------------------------------------
/docs/01-environment-requirements/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 2,
3 | "label": "Environment Requirements",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/01-environment-requirements/server-configuration-requirements.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: server-configuration-requirements
3 | sidebar_position: 2.2
4 | ---
5 | # Server Configuration Requirements
6 |
7 | This topic describes the configuration requirements for a development or test environment and a production environment.
8 |
9 |
10 | # Configuration requirements for a development or test environment
11 |
12 | The following table describes the configuration requirements for a development or test environment.
13 |
14 | | **CPU** | **Memory** | **Storage** | **Network** |
15 | | --- | --- | --- | --- |
16 | | 2 cores+ | 2 GB+ | 10 GB+ | Megabit network card |
17 |
18 | :::caution
19 |
20 | If the development or test environment is deployed on a virtual machine, the AVX instruction set must be enabled. Otherwise, StoneDB cannot be installed.
21 |
22 | :::
23 |
24 | # Configuration requirements for a production environment
25 |
26 | The following table describes the configuration requirements for a production environment.
27 |
28 | | **CPU** | **Memory** | **Storage** | **Network** |
29 | | --- | --- | --- | --- |
30 | | 8 cores+ | 8 GB+ | 100 GB+ | Gigabit network card |
31 |
32 | :::tip
33 |
34 | We recommend you use higher configuration in your production environment.
35 |
36 | :::
37 |
--------------------------------------------------------------------------------
/docs/01-environment-requirements/supported-servers-and-oss.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: supported-servers-and-OSs
3 | sidebar_position: 2.1
4 | ---
5 | # Support Servers and OSs
6 |
7 | StoneDB is an open-source hybrid transaction/analytical processing (HTAP) database designed and developed by StoneAtom based on the MySQL kernel. It can be deployed and run on 64-bit x86 servers and supports most mainstream network hardware and Linux OSs.
8 |
9 | # Supported servers
10 | The following table lists the servers on which StoneDB can run.
11 |
12 | | **Architecture** | **Supported server** |
13 | | --- | --- |
14 | | x86_64 architecture | Common x86_64 servers with AVX instruction sets enabled |
15 |
16 | :::info
17 |
18 | Support for the ARM64 or Power architecture is under testing.
19 |
20 | :::
21 |
22 | # Supported OSs
23 | The following table lists the OSs supported by StoneDB.
24 |
25 | | **OS** | **Version** |
26 | | --- | --- |
27 | | CentOS | 7.x |
28 | | Red Hat Enterprise | 7.x |
29 | | Ubuntu LTS | 20.04 or higher |
30 |
31 | :::info
32 |
33 | Compatibilities with other OSs such as Debian and Fedora are under testing.
34 |
35 | :::
36 |
37 |
--------------------------------------------------------------------------------
/docs/02-getting-started/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 3,
3 | "label": "Getting Started",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/02-getting-started/quick-deployment.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: quick-deployment
3 | sidebar_position: 3.1
4 | ---
5 |
6 | # Quick Deployment
7 |
8 | ## 1. Download the latest package
9 | Click [here](https://static.stoneatom.com/stonedb-ce-5.6-v1.0.0.el7.x86_64.tar.gz) to download the latest installation package of StoneDB.
10 | ## 2. Upload and decompress the TAR package
11 | ```shell
12 | tar -zxvf stonedb-ce-5.6-v1.0.0.el7.x86_64.tar.gz
13 | ```
14 | Upload the installation package to the directory. The name of the folder extracted from the package is **stonedb56**.
15 | ## 3. Check dependencies
16 | ```bash
17 | cd /stonedb56/install/bin
18 | ldd mysqld
19 | ldd mysql
20 | ```
21 | If the command output contains keywords **not found**, some dependencies are missing and must be installed.
22 | ## 4. Modify the configuration file
23 | ```bash
24 | cd /stonedb56/install/
25 | cp stonedb.cnf stonedb.cnf.bak
26 | vi stonedb.cnf
27 | ```
28 | Modify the path and parameters. If the installation folder is **stonedb**, you only need to modify the parameters.
29 | ## 5. Create an account
30 | ```bash
31 | groupadd mysql
32 | useradd -g mysql mysql
33 | passwd mysql
34 | ```
35 | ## 6. Execute reinstall.sh
36 | ```bash
37 | cd /stonedb56/install
38 | ./reinstall.sh
39 | ```
40 | The process of executing the script is to initialize and start the StoneDB.
41 | ## 7. Log in to StoneDB
42 | ```shell
43 | /stonedb56/install/bin/mysql -uroot -p -S /stonedb56/install/tmp/mysql.sock
44 | Enter password:
45 | Welcome to the MySQL monitor. Commands end with ; or \g.
46 | Your MySQL connection id is 1
47 | Server version: 5.6.24-StoneDB-log build-
48 |
49 | Copyright (c) 2000, 2022 StoneAtom Group Holding Limited
50 | No entry for terminal type "xterm";
51 | using dumb terminal settings.
52 | Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
53 |
54 | mysql> show databases;
55 | +--------------------+
56 | | Database |
57 | +--------------------+
58 | | information_schema |
59 | | cache |
60 | | innodb |
61 | | mysql |
62 | | performance_schema |
63 | | sys_stonedb |
64 | | test |
65 | +--------------------+
66 | 7 rows in set (0.00 sec)
67 | ```
68 | ## 8. Stop StoneDB
69 | ```shell
70 | /stonedb56/install/bin/mysqladmin -uroot -p -S /stonedb56/install/tmp/mysql.sock shutdown
71 | ```
--------------------------------------------------------------------------------
/docs/03-O&M-Guide/00-monitoring-and-alerting/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 4.2,
3 | "label": "Monitoring and Alerting",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/03-O&M-Guide/00-monitoring-and-alerting/prometheus+grafana-monitor.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: prometheus+grafana-monitor
3 | sidebar_position: 4.21
4 | ---
5 |
6 | # Use Prometheus and Grafana to Monitor MySQL or StoneDB Databases
--------------------------------------------------------------------------------
/docs/03-O&M-Guide/01-backup-and-recovery/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 4.3,
3 | "label": "Backup and Recovery",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/03-O&M-Guide/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 4,
3 | "label": "O&M Guide",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/03-O&M-Guide/regular-change-operations.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: regular-change-operations
3 | sidebar_position: 4.1
4 | ---
5 |
6 | # Regular Change Operations
7 |
8 | ## Change operations on schemas and data of tables
9 | This section describes the supported change operations on schemas and data of tables.
10 |
11 | ### Create tables using the same schema
12 |
13 | 1. Execute a `CREATE TABLE` statement to create a StoneDB table.
14 |
15 | Code example:
16 | ```sql
17 | CREATE TABLE t_name(
18 | col1 INT NOT NULL AUTO_INCREMENT,
19 | col2 VARCHAR(10) NOT NULL,
20 | ......
21 | PRIMARY KEY (`id`)
22 | ) engine=STONEDB;
23 | ```
24 |
25 | 2. Execute a `CREATE TABLE... LIKE `statement to create another table that uses the same schema as the table created in the step 1.
26 |
27 | Code example:
28 | ```sql
29 | create table t_other like t_name;
30 | ```
31 |
32 | ### Clear data in a table
33 | Execute a `TRUNCATE TABLE` statement to clear data in a table and retain the table schema.
34 |
35 | Code example:
36 | ```sql
37 | truncate table t_name;
38 | ```
39 |
40 | ### Add a field
41 | Execute an `ALTER TABLE... ADD COLUMN` statement to add a field in a given table. The added field is the last field, by default.
42 | Code example:
43 |
44 | ```sql
45 | alter table t_name add column c_name varchar(10);
46 | ```
47 |
48 | ### Drop a field
49 | Execute an `ALTER TABLE... DROP` statement to drop a field from a table.
Code example:
50 | ```sql
51 | alter table t_name drop c_name;
52 | ```
53 |
54 | ### Rename a table
55 | Execute an `ALTER TABLE... RENAME TO` statement to rename a given table.
Code example:
56 | ```sql
57 | alter table t_name rename to t_name_new;
58 | ```
59 |
60 | ## Change operations on user permissions
61 |
62 | ### Create a user
63 | Code example:
64 | ```sql
65 | create user 'u_name'@'hostname' identified by 'xxx';
66 | ```
67 |
68 | ### Grant user permissions
69 | Code example:
70 | ```sql
71 | grant all on *.* to 'u_name'@'hostname';
72 | grant select on db_name.* to 'u_name'@'hostname';
73 | grant select(column_name) on db_name.t_name to 'u_name'@'hostname';
74 | ```
75 |
76 | ### Revoke permissions
77 |
78 | Code example:
79 |
80 | ```sql
81 | revoke all privileges on *.* from 'u_name'@'hostname';
82 | revoke select on db_name.* from 'u_name'@'hostname';
83 | revoke select(column_name) on db_name.t_name from 'u_name'@'hostname';
84 | ```
85 |
86 | ### Drop a user
87 | Code example:
88 |
89 | ```sql
90 | drop user 'u_name'@'hostname';
91 | ```
92 |
--------------------------------------------------------------------------------
/docs/04-developer-guide/00-compiling-methods/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 5.1,
3 | "label": "Compiling Methods",
4 | "collapsible": true,
5 | "link": {
6 | "type": "generated-index",
7 | "slug": "/compiling-methods"
8 | }
9 | }
--------------------------------------------------------------------------------
/docs/04-developer-guide/00-compiling-methods/compile-overview.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: compile-overview
3 | sidebar_position: 5.11
4 | ---
5 |
6 | # Overview
7 |
8 | The method to compile StoneDB varies with the environment. Choose the compiling method that suits your environment.
9 |
10 | - [Compile StoneDB on CentOS 7](compile-using-centos7.md)
11 | - [Compile StoneDB on RHEL 7](compile-using-redhat7.md)
12 | - [Compile StoneDB on Ubuntu 20.04](compile-using-ubuntu2004.md)
13 | - [Compile StoneDB Using a Docker Container](compile-using-docker.md)
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/04-developer-guide/01-connect-to-stonedb/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 5.2,
3 | "label": "Connect to StoneDB",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/04-developer-guide/01-connect-to-stonedb/use-mysql-client.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: use-mysql-client
3 | sidebar_position: 5.21
4 | ---
5 |
6 | # Use mysql to Connect to StoneDB
7 |
8 | This topic describes how to use the MySQL command-line client named mysql to connect to StoneDB.
9 | ## Prerequisites
10 |
11 | - mysql has been installed and its version is 5.5, 5.6, or 5.7.
12 | - The value of environment variable **PATH** contains the directory that stores mysql.
13 | ## Procedure
14 |
15 | 1. Open mysql.
16 | 2. Specify required parameters according to the following format.
17 | ```shell
18 | mysql -u -p -h -P -S -A
19 | ```
20 | ## Parameter description
21 | The following table describes required parameters.
22 |
23 | | **Parameter** | **Description** |
24 | | --- | --- |
25 | | -h | The IP address of StoneDB. |
26 | | -u | The username of the account. |
27 | | -p | The password of the account. You can skip this parameter for security purposes and enter the password as prompted later. |
28 | | -P | The port used to connect to StoneDB. By default, the port 3306 is used. You can specify another port as needed. |
29 | | -A | The name of the database. |
30 | | -S | The name of the .sock file that is used to connect to StoneDB. |
31 |
32 |
33 | :::tip
34 |
35 | - If you want to exit the command-line client, enter** exit** and press **Enter.**
36 | - For more information about parameters, run `mysql --help`.
37 |
38 | :::
39 |
--------------------------------------------------------------------------------
/docs/04-developer-guide/01-connect-to-stonedb/use-navicat.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: use-navicat
3 | sidebar_position: 5.22
4 | ---
5 |
6 | # Use Navicat to Connect to StoneDB
7 |
8 | Navicat is a database management tool that allows you to connect to databases. You can use Navicat to connect to StoneDB and other relational databases such as Oracle, MySQL, and PostgreSQL. After you connect to StoneDB using Navicat, you can create, manage and maintain StoneDB on the Navicat graphical user interface (GUI).
9 |
10 | This topic shows you how to use Navicat to connect to StoneDB.
11 | ## Prerequisites
12 | Navicat has been installed.
13 |
14 | ## Procedure
15 |
16 | 1. Open Navicat and choose **File** > **New Connection** > **MySQL**.
17 |
18 | *Here's a picture to add*
19 |
20 | 2. In the dialog box that appears, click the **General** tab, and enter the connection name, server IP address, port, username, and password. The following figure provides an example.
21 |
22 | *Here's a picture to add*
23 |
24 | 3. Click **Test Connection**. If message "Connection successful" appears, the connection to StoneDB is established.
25 |
26 | *Here's a picture to add*
27 |
28 | :::info
29 | You cannot use Navicat to connect to StoneDB as a super administrator ('root'@'localhost').
30 | :::
31 |
--------------------------------------------------------------------------------
/docs/04-developer-guide/04-create-and-manage-database-objects/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 5.5,
3 | "label": "Create and Manage Database Objects",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/04-developer-guide/04-create-and-manage-database-objects/create-and-manage-database.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: create-and-manage-database
3 | sidebar_position: 5.51
4 | ---
5 |
6 | # Create and Manage a Database
7 |
8 | Create a database. For example, execute the following SQL statement to create a database named **test_db** that uses **utf8mb4** as the default character set:
9 |
10 | ```sql
11 | create database test_db DEFAULT CHARACTER SET utf8mb4;
12 | ```
13 |
14 | List databases by executing the following SQL statement:
15 |
16 | ```sql
17 | show databases;
18 | ```
19 |
20 | Use a database. For example, execute the following SQL statement to use database **test_db**:
21 |
22 | ```sql
23 | use test_db;
24 | ```
25 |
26 | Drop a datable. For example, execute the following SQL statement to drop database **test_db**:
27 |
28 | ```sql
29 | drop database test_db;
30 | ```
31 |
--------------------------------------------------------------------------------
/docs/04-developer-guide/04-create-and-manage-database-objects/create-and-manage-stored-procedure.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: create-and-manage-stored-procedure
3 | sidebar_position: 5.54
4 | ---
5 |
6 | # Create and Manage a View
7 |
8 | Create a stored procedure. For example, perform the following two steps to create a stored procedure named **add_user**, used to insert 1,000,000 random data records.
9 |
10 | 1. Execute the following SQL statement to create a table:
11 | ```sql
12 | CREATE TABLE t_test(
13 | id INT NOT NULL AUTO_INCREMENT,
14 | first_name VARCHAR(10) NOT NULL,
15 | last_name VARCHAR(10) NOT NULL,
16 | sex VARCHAR(5) NOT NULL,
17 | score INT NOT NULL,
18 | copy_id INT NOT NULL,
19 | PRIMARY KEY (`id`)
20 | ) engine=STONEDB;
21 | ```
22 |
23 | 2. Execute the following SQL statement to create the stored procedure:
24 | ```sql
25 | DELIMITER //
26 | create PROCEDURE add_user(in num INT)
27 | BEGIN
28 | DECLARE rowid INT DEFAULT 0;
29 | DECLARE firstname VARCHAR(10);
30 | DECLARE name1 VARCHAR(10);
31 | DECLARE name2 VARCHAR(10);
32 | DECLARE lastname VARCHAR(10) DEFAULT '';
33 | DECLARE sex CHAR(1);
34 | DECLARE score CHAR(2);
35 | WHILE rowid < num DO
36 | SET firstname = SUBSTRING(md5(rand()),1,4);
37 | SET name1 = SUBSTRING(md5(rand()),1,4);
38 | SET name2 = SUBSTRING(md5(rand()),1,4);
39 | SET sex=FLOOR(0 + (RAND() * 2));
40 | SET score= FLOOR(40 + (RAND() *60));
41 | SET rowid = rowid + 1;
42 | IF ROUND(RAND())=0 THEN
43 | SET lastname =name1;
44 | END IF;
45 | IF ROUND(RAND())=1 THEN
46 | SET lastname = CONCAT(name1,name2);
47 | END IF;
48 | insert INTO t_user(first_name,last_name,sex,score,copy_id) VALUES (firstname,lastname,sex,score,rowid);
49 | END WHILE;
50 | END //
51 | DELIMITER ;
52 | ```
53 | Call a stored procedure. For example, execute the following SQL statement to call stored procedure **add_user**:
54 |
55 | ```sql
56 | call add_user(1000000);
57 | ```
58 |
59 | Drop a stored procedure. For example, execute the following SQL statement to drop stored procedure **add_user**:
60 |
61 | ```sql
62 | drop PROCEDURE add_user;
63 | ```
64 |
--------------------------------------------------------------------------------
/docs/04-developer-guide/04-create-and-manage-database-objects/create-and-manage-table.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: create-and-manage-table
3 | sidebar_position: 5.52
4 | ---
5 |
6 | # Create and Manage a Table
7 |
8 | Create a table. For example, execute the following SQL statement to create a table which is named **student** and consists of the **id**, **name**, **age**, and **birthday** fields:
9 |
10 | ```sql
11 | create table student(
12 | id int(11) primary key,
13 | name varchar(255),
14 | age smallint,
15 | birthday DATE
16 | ) engine=stonedb;
17 | ```
18 |
19 | Query the schema of a table. For example, execute the following SQL statement to query the schema of table **student**:
20 |
21 | ```sql
22 | show create table student\G
23 | ```
24 |
25 | Drop a table. For example, execute the following SQL statement to drop table **student**:
26 |
27 | ```sql
28 | drop table student;
29 | ```
--------------------------------------------------------------------------------
/docs/04-developer-guide/04-create-and-manage-database-objects/create-and-manage-view.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: create-and-manage-view
3 | sidebar_position: 5.53
4 | ---
5 |
6 | # Create and Manage a View
7 |
8 | Create a view. For example, execute the following SQL statement to create a view named **v_s**, used to query teachers aged over 18:
9 |
10 | ```sql
11 | create view v_s as select name from teachers where age>18;
12 | ```
13 |
14 | Check the statement used for creating a view. For example, execute the following SQL statement to check the statement used for creating view **v_s**:
15 |
16 | ```sql
17 | show create view v_s\G
18 | ```
19 |
20 | Drop a view. For example, execute the following SQL statement to drop view **v_s**:
21 |
22 | ```sql
23 | drop view v_s;
24 | ```
25 |
--------------------------------------------------------------------------------
/docs/04-developer-guide/05-appendix/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 5.6,
3 | "label": "Appendix",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/04-developer-guide/05-appendix/error-codes.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: error-codes
3 | sidebar_position: 5.63
4 | ---
5 |
6 | # Error Codes
7 |
8 | This topic describes the common error codes that may be returned in StoneDB.
9 |
10 |
11 | | **Error code** | **Error message** | **Description** |
12 | | --- | --- | --- |
13 | | 2233 (HY000) | Be disgraceful to storage engine, operating is forbidden! | The error message is returned because the DDL operation is not supported. |
14 | | 1031 (HY000) | Table storage engine for 'xxx' doesn't have this option | The error message is because the DML operation is not supported. |
15 | | 1040 (HY000) | Too many connections | The error message is because the number of connections has reached the maximum number. |
16 | | 1045 (28000) | Access denied for user 'u_test'@'%' (using password: YES) | The error message is because the username or password is incorrect or the permissions are insufficient. |
17 |
18 |
--------------------------------------------------------------------------------
/docs/04-developer-guide/DML-starements.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: regular-change-operations
3 | sidebar_position: 5.3
4 | ---
5 |
6 | # DML Statements
7 |
8 | This topic describes the DML statements supported by StoneDB.
9 |
10 | In this topic, table **t_test** created by executing the following statement is used in all code examples.
11 |
12 | ```sql
13 | CREATE TABLE t_test(
14 | id INT NOT NULL AUTO_INCREMENT,
15 | first_name VARCHAR(10) NOT NULL,
16 | last_name VARCHAR(10) NOT NULL,
17 | sex VARCHAR(5) NOT NULL,
18 | score INT NOT NULL,
19 | copy_id INT NOT NULL,
20 | PRIMARY KEY (`id`)
21 | ) engine=STONEDB;
22 | ```
23 |
24 | ## INSERT
25 | ```sql
26 | insert into t_test values(1,'jack','rose','0',58,1);
27 | ```
28 | ## UPDATE
29 | ```sql
30 | update t_test set score=200 where id=1;
31 | ```
32 | ## INSERT INTO ... SELECT
33 | ```sql
34 | create table t_test2 like t_test;
35 | insert into t_test2 select * from t_test;
36 | ```
37 | ## INSERT INTO ... ON DUPLICATE KEY UPDATE
38 | ```sql
39 | insert into t_test1 values(1,'Bond','Jason','1',47,10) on duplicate key update last_name='James';
40 | ```
41 | :::info
42 | The logic of this syntax is to insert a row of data. The UPDATE statement is executed only if a primary key constraint or unique constraint conflict occurs.
43 | :::
44 |
--------------------------------------------------------------------------------
/docs/04-developer-guide/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 5,
3 | "label": "Developer Guide",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/04-developer-guide/statements-for-queries.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: statements-for-queries
3 | sidebar_position: 5.4
4 | ---
5 |
6 | # Statements for Queries
7 |
8 | ## Statements for common queries
9 |
10 | ### UNION/UNION ALL
11 | ```sql
12 | select first_name from t_test1
13 | union all
14 | select first_name from t_test2;
15 | ```
16 | ### DISTINCT
17 | ```sql
18 | select distinct first_name from t_test1;
19 | ```
20 | ### LIKE
21 | ```sql
22 | select * from t_test where first_name like 'zhou%';
23 | ```
24 | ### GROUP BY/ORDER BY
25 | ```sql
26 | select first_name,count(*) from t_test1 group by first_name order by 2;
27 | ```
28 | ### HAVING
29 | ```sql
30 | select e.id, count(e.id), round(avg(e.score), 2)
31 | from t_test1 e
32 | group by e.id
33 | having avg(e.score) > (select avg(score) from t_test1);
34 | ```
35 | ## Statements used for aggregate queries
36 | ```sql
37 | select first_name,count(*) from t_test group by first_name;
38 | select sum(score) from t_test;
39 | ```
40 | ## Statements used for pagination queries
41 | ```sql
42 | select * from t_test1 limit 10;
43 | select * from t_test1 limit 10,10;
44 | ```
45 | ## Statements used for correlated queries
46 | ### INNER JOIN
47 | ```sql
48 | select t1.id,t1.first_name,t2.last_name from t_test1 t1,t_test2 t2 where t1.id = t2.id;
49 | ```
50 | ### LEFT JOIN
51 | ```sql
52 | select t1.id,t1.first_name,t2.last_name from t_test1 t1 left join t_test2 t2 on t1.id = t2.id and t1.id=100;
53 | ```
54 | ### RIGHT JOIN
55 | ```sql
56 | select t1.id,t1.first_name,t2.last_name from t_test1 t1 right join t_test2 t2 on t1.id = t2.id and t1.id=100;
57 | ```
58 | ## Statements used for subqueries
59 | ### Statement for scalar subqueries
60 | ```sql
61 | select e.id,
62 | e.first_name,
63 | (select d.first_name from t_test2 d where d.id = e.id) as first_name
64 | from t_test1 e;
65 | ```
66 | ### Statement for derived subqueries
67 | ```sql
68 | select a.first_name, b.last_name
69 | from t_test1 a, (select id,last_name from t_test2) b
70 | where a.id = b.id;
71 | ```
72 | ### IN/NOT IN
73 | ```sql
74 | select * from t_test1 where id in(select id from t_test2);
75 | ```
76 | ### EXISTS/NOT EXISTS
77 | ```sql
78 | select * from t_test1 A where exists (select 1 from t_test2 B where B.id = A.id);
79 | ```
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/docs/05-SQL-reference/03-operators/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 6.3,
3 | "label": "Operators",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/05-SQL-reference/03-operators/arithmetic-operators.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: arithmetic-operators
3 | sidebar_position: 6.31
4 | ---
5 |
6 | # Arithmetic Operators
7 |
8 | This topic describes the arithmetic operators supported by StoneDB.
9 |
10 | | **Operator** | **Description** |
11 | | --- | --- |
12 | | `+` | Addition operator |
13 | | `-` | Minus operator |
14 | | `*` | Multiplication operator |
15 | | `/`, `div` | Division operator |
16 | | `%`, `mod` | Modulo operator |
17 |
18 | The following code provides an example of using each operator.
19 |
20 | ```sql
21 | > select 10+2 from dual;
22 | +------+
23 | | 10+2 |
24 | +------+
25 | | 12 |
26 | +------+
27 | 1 row in set (0.00 sec)
28 |
29 | > select 10-2 from dual;
30 | +------+
31 | | 10-2 |
32 | +------+
33 | | 8 |
34 | +------+
35 | 1 row in set (0.00 sec)
36 |
37 | > select 10*2 from dual;
38 | +------+
39 | | 10*2 |
40 | +------+
41 | | 20 |
42 | +------+
43 | 1 row in set (0.00 sec)
44 |
45 | > select 10/2 from dual;
46 | +--------+
47 | | 10/2 |
48 | +--------+
49 | | 5.0000 |
50 | +--------+
51 | 1 row in set (0.00 sec)
52 |
53 | > select 10 div 2 from dual;
54 | +----------+
55 | | 10 div 2 |
56 | +----------+
57 | | 5 |
58 | +----------+
59 | 1 row in set (0.00 sec)
60 |
61 | > select 10 mod 3 from dual;
62 | +----------+
63 | | 10 mod 3 |
64 | +----------+
65 | | 1 |
66 | +----------+
67 | 1 row in set (0.00 sec)
68 |
69 | > select 10 % 3 from dual;
70 | +--------+
71 | | 10 % 3 |
72 | +--------+
73 | | 1 |
74 | +--------+
75 | 1 row in set (0.00 sec)
76 |
77 | > select 10 mod 0 from dual;
78 | +----------+
79 | | 10 mod 0 |
80 | +----------+
81 | | NULL |
82 | +----------+
83 | 1 row in set (0.00 sec)
84 |
85 | > select 10 / 0 from dual;
86 | +--------+
87 | | 10 / 0 |
88 | +--------+
89 | | NULL |
90 | +--------+
91 | 1 row in set (0.00 sec)
92 | ```
93 | :::tip
94 | If the divisor is 0 in a division operation or a modulo operation, the operation is invalid and NULL is returned.
95 | :::
96 |
--------------------------------------------------------------------------------
/docs/05-SQL-reference/03-operators/assignment-operators.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: assignment-operators
3 | sidebar_position: 6.35
4 | ---
5 |
6 | # Assignment Operators
7 |
8 | In the SET clause of an UPDATE statement, the equal sign (`=`) functions as an assignment operator. In this case, the value on the right side of the operator is assigned to the variable on the right side, provided that any WHERE conditions specified in the UPDATE statement are met.
9 |
10 | The following code provides an example.
11 |
12 | ```sql
13 | mysql> select * from t;
14 | +------+------+
15 | | col1 | col2 |
16 | +------+------+
17 | | 100 | 100 |
18 | +------+------+
19 | 1 row in set (0.00 sec)
20 |
21 | mysql> update t set col1=col1+100,col2=col1+100;
22 | Query OK, 1 row affected (0.00 sec)
23 | Rows matched: 1 Changed: 1 Warnings: 0
24 |
25 | mysql> select * from t;
26 | +------+------+
27 | | col1 | col2 |
28 | +------+------+
29 | | 200 | 300 |
30 | +------+------+
31 | 1 row in set (0.00 sec)
32 | ```
--------------------------------------------------------------------------------
/docs/05-SQL-reference/03-operators/bitwise-operators.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: bitwise-operators
3 | sidebar_position: 6.32
4 | ---
5 |
6 | # Bitwise Operators
7 |
8 | This topic describes the bitwise operators supported by StoneDB.
9 |
10 | | **Operator** | **Description** |
11 | | --- | --- |
12 | | `&` | Bitwise AND |
13 | | | | Bitwise OR |
14 | | `^` | Bitwise XOR |
15 | | `!` | Bitwise inversion |
16 | | `<<` | Left shift |
17 | | `>>` | Right shift |
18 |
19 | Bitwise operators are used to operate on binary numbers. In a bitwise operation, the involved numbers are first converted to binary numbers to compute the result, and then the result is converted back to a decimal value.
20 |
21 | The following code provides an example of using each operator.
22 |
23 | ```sql
24 | > select 3&5;
25 | +-----+
26 | | 3&5 |
27 | +-----+
28 | | 1 |
29 | +-----+
30 | 1 row in set (0.00 sec)
31 |
32 | > select 3|5;
33 | +-----+
34 | | 3|5 |
35 | +-----+
36 | | 7 |
37 | +-----+
38 | 1 row in set (0.00 sec)
39 |
40 | > select 3^5;
41 | +-----+
42 | | 3^5 |
43 | +-----+
44 | | 6 |
45 | +-----+
46 | 1 row in set (0.00 sec)
47 |
48 | > select ~18446744073709551612;
49 | +-----------------------+
50 | | ~18446744073709551612 |
51 | +-----------------------+
52 | | 3 |
53 | +-----------------------+
54 | 1 row in set (0.00 sec)
55 |
56 | > select 3>>1;
57 | +------+
58 | | 3>>1 |
59 | +------+
60 | | 1 |
61 | +------+
62 | 1 row in set (0.00 sec)
63 |
64 | > select 3<<1;
65 | +------+
66 | | 3<<1 |
67 | +------+
68 | | 6 |
69 | +------+
70 | 1 row in set (0.00 sec)
71 | ```
--------------------------------------------------------------------------------
/docs/05-SQL-reference/03-operators/comparison-operators.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: comparison-operators
3 | sidebar_position: 6.33
4 | ---
5 |
6 | # Comparison Operators
7 |
8 | This topic describes the comparison operators supported StoneDB.
9 |
10 | | **Operator** | **Description** |
11 | | --- | --- |
12 | | `=` | Equal operator |
13 | | `>` | Greater than operator |
14 | | `<` | Less than operator |
15 | | `>=` | Greater than or equal operator |
16 | | `<=` | Less than or equal operator |
17 | | `!=`, `<>` | Not equal operator |
18 | | `<=>` | NULL-safe equal operator |
19 | | `BETWEEN… AND…` | Whether a value is within a value range |
20 | | `IN` | Whether a value is within a set of values |
21 | | `NOT IN` | Whether a value is not within a set of values |
22 | | `LIKE` | Simple pattern matching |
23 | | `regexp` | Regular expression |
24 | | `IS NULL` | NULL value test |
25 | | `IS NOT NULL` | NOT NULL value test |
26 |
27 | The following code provides an example of using each operator.
28 |
29 | ```sql
30 | > select 2=3;
31 | +-----+
32 | | 2=3 |
33 | +-----+
34 | | 0 |
35 | +-----+
36 | 1 row in set (0.00 sec)
37 |
38 | > select 2>3;
39 | +-----+
40 | | 2>3 |
41 | +-----+
42 | | 0 |
43 | +-----+
44 | 1 row in set (0.00 sec)
45 |
46 | > select 2<3;
47 | +-----+
48 | | 2<3 |
49 | +-----+
50 | | 1 |
51 | +-----+
52 | 1 row in set (0.00 sec)
53 |
54 | > select 2>=3;
55 | +------+
56 | | 2>=3 |
57 | +------+
58 | | 0 |
59 | +------+
60 | 1 row in set (0.00 sec)
61 |
62 | > select 2<=3;
63 | +------+
64 | | 2<=3 |
65 | +------+
66 | | 1 |
67 | +------+
68 | 1 row in set (0.00 sec)
69 |
70 | > select 2<>3;
71 | +------+
72 | | 2<>3 |
73 | +------+
74 | | 1 |
75 | +------+
76 | 1 row in set (0.00 sec)
77 |
78 | > select 2<=>3;
79 | +-------+
80 | | 2<=>3 |
81 | +-------+
82 | | 0 |
83 | +-------+
84 | 1 row in set (0.01 sec)
85 |
86 | > select 5 between 1 and 10;
87 | +--------------------+
88 | | 5 between 1 and 10 |
89 | +--------------------+
90 | | 1 |
91 | +--------------------+
92 | 1 row in set (0.00 sec)
93 |
94 | > select 5 in (1,2,3,4,5);
95 | +------------------+
96 | | 5 in (1,2,3,4,5) |
97 | +------------------+
98 | | 1 |
99 | +------------------+
100 | 1 row in set (0.00 sec)
101 |
102 | > select 5 not in (1,2,3,4,5);
103 | +----------------------+
104 | | 5 not in (1,2,3,4,5) |
105 | +----------------------+
106 | | 0 |
107 | +----------------------+
108 | 1 row in set (0.00 sec)
109 |
110 | > select '12345' like '12%';
111 | +--------------------+
112 | | '12345' like '12%' |
113 | +--------------------+
114 | | 1 |
115 | +--------------------+
116 | 1 row in set (0.00 sec)
117 |
118 | > select 'beijing' REGEXP 'jing';
119 | +-------------------------+
120 | | 'beijing' REGEXP 'jing' |
121 | +-------------------------+
122 | | 1 |
123 | +-------------------------+
124 | 1 row in set (0.00 sec)
125 |
126 | > select 'beijing' REGEXP 'xi';
127 | +-----------------------+
128 | | 'beijing' REGEXP 'xi' |
129 | +-----------------------+
130 | | 0 |
131 | +-----------------------+
132 | 1 row in set (0.00 sec)
133 |
134 | > select 'a' is NULL;
135 | +-------------+
136 | | 'a' is NULL |
137 | +-------------+
138 | | 0 |
139 | +-------------+
140 | 1 row in set (0.00 sec)
141 |
142 | > select 'a' IS NOT NULL;
143 | +-----------------+
144 | | 'a' IS NOT NULL |
145 | +-----------------+
146 | | 1 |
147 | +-----------------+
148 | 1 row in set (0.00 sec)
149 | ```
--------------------------------------------------------------------------------
/docs/05-SQL-reference/03-operators/logical-operators.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: logical-operators
3 | sidebar_position: 6.34
4 | ---
5 |
6 | # Logical Operators
7 |
8 | This topic describes the logical operators supported by StoneDB.
9 |
10 | | **Operator** | **Description** |
11 | | --- | --- |
12 | | NOT | Logical NOT |
13 | | AND | Logical AND |
14 | | OR | Logical OR |
15 | | XOR | Logical XOR |
16 |
17 | The following code provides an example of using each operator.
18 |
19 | ```sql
20 | > select not 1;
21 | +-------+
22 | | not 1 |
23 | +-------+
24 | | 0 |
25 | +-------+
26 | 1 row in set (0.00 sec)
27 |
28 | > select !0;
29 | +----+
30 | | !0 |
31 | +----+
32 | | 1 |
33 | +----+
34 | 1 row in set (0.00 sec)
35 |
36 | > select 2 and 0;
37 | +---------+
38 | | 2 and 0 |
39 | +---------+
40 | | 0 |
41 | +---------+
42 | 1 row in set (0.00 sec)
43 |
44 | > select 2 and 1;
45 | +---------+
46 | | 2 and 1 |
47 | +---------+
48 | | 1 |
49 | +---------+
50 | 1 row in set (0.00 sec)
51 |
52 | > select 2 or 0;
53 | +--------+
54 | | 2 or 0 |
55 | +--------+
56 | | 1 |
57 | +--------+
58 | 1 row in set (0.00 sec)
59 |
60 | > select 2 or 1;
61 | +--------+
62 | | 2 or 1 |
63 | +--------+
64 | | 1 |
65 | +--------+
66 | 1 row in set (0.00 sec)
67 |
68 | > select 1 xor 1;
69 | +---------+
70 | | 1 xor 1 |
71 | +---------+
72 | | 0 |
73 | +---------+
74 | 1 row in set (0.00 sec)
75 |
76 | > select 0 xor 0;
77 | +---------+
78 | | 0 xor 0 |
79 | +---------+
80 | | 0 |
81 | +---------+
82 | 1 row in set (0.00 sec)
83 |
84 | > select 1 xor 0;
85 | +---------+
86 | | 1 xor 0 |
87 | +---------+
88 | | 1 |
89 | +---------+
90 | 1 row in set (0.00 sec)
91 |
92 | > select null or 1;
93 | +-----------+
94 | | null or 1 |
95 | +-----------+
96 | | 1 |
97 | +-----------+
98 | 1 row in set (0.00 sec)
99 | ```
--------------------------------------------------------------------------------
/docs/05-SQL-reference/04-functions/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 6.4,
3 | "label": "Functions",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/05-SQL-reference/04-functions/advanced-functions.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: advanced-functions
3 | sidebar_position: 6.44
4 | ---
5 |
6 | # Advanced Functions
--------------------------------------------------------------------------------
/docs/05-SQL-reference/04-functions/aggregate-functions.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: aggregate-functions
3 | sidebar_position: 6.45
4 | ---
5 |
6 | # Aggregate Functions
--------------------------------------------------------------------------------
/docs/05-SQL-reference/04-functions/date-and-time-functions.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: date-and-time-functions
3 | sidebar_position: 6.41
4 | ---
5 |
6 | # Date and Time Functions
--------------------------------------------------------------------------------
/docs/05-SQL-reference/04-functions/mathematical-functions.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: mathematical-functions
3 | sidebar_position: 6.43
4 | ---
5 |
6 | # Mathematical Functions
--------------------------------------------------------------------------------
/docs/05-SQL-reference/04-functions/string-functions.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: string-functions
3 | sidebar_position: 6.42
4 | ---
5 |
6 | # String Functions
--------------------------------------------------------------------------------
/docs/05-SQL-reference/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 6,
3 | "label": "SQL Reference",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/05-SQL-reference/data-types.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: data-types
3 | sidebar_position: 6.2
4 | ---
5 |
6 | # Data Types
7 |
8 | The following table lists the data types supported by StoneDB.
9 |
10 | | **Category** | **Data type** |
11 | | --- | --- |
12 | | Integer | TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT |
13 | | Floating point | FLOAT, DOUBLE |
14 | | Fixed point | DECIMAL |
15 | | Date and time | YEAR, TIME, DATE, DATETIME, TIMESTAMP |
16 | | String | CHAR, VARCHAR, TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT |
17 | | Binary string | BINARY, VARBINARY, TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB |
18 |
19 | :::caution
20 |
21 | When you create a StoneDB table, do not include keyword **unsigned** or **zerofill**.
22 |
23 | :::
24 |
25 |
26 | ## Integer data types
27 | The following table provides the value range of each integer data type.
28 |
29 | | **Data type** | **Bytes of storage** | **Min. value** | **Max. value** |
30 | | --- | --- | --- | --- |
31 | | TINYINT | 1 | -128 | 127 |
32 | | SMALLINT | 2 | -32768 | 32767 |
33 | | MEDIUMINT | 3 | -8388608 | 8388607 |
34 | | INT | 4 | -2147483647 | 2147483647 |
35 | | BIGINT | 8 | -9223372036854775808 | 9223372036854775807 |
36 |
37 | On StoneDB, the precision for DECIMAL numbers cannot be higher than 18. For example, if you specify **decimal(19)** in your code, an error will be reported. **DECIMAL(6, 2)** indicates that up to 6 places are supported at the left of the decimal and up to 2 at the right, and thus the value range is [-9999.99, 9999.99].
38 |
39 | ## String data types
40 | The storage required for a string varies according to the character set in use. The length range also differs. The following table describes the length range of each string data type when character set latin1 is in use.
41 |
42 | | **Data type** | **Size** |
43 | | --- | --- |
44 | | CHAR(M) | [0,255] |
45 | | VARCHAR(M) | [0,65535] |
46 | | TINYTEXT | [0,255] |
47 | | TEXT | [0,65535] |
48 | | MEDIUMTEXT | [0,16777215] |
49 | | LONGTEXT | [0,4294967295] |
50 |
51 | ## Date and time data types
52 | The following table describes the value range of each date and time data type.
53 |
54 | | **Data type** | **Format** | **Min. value** | **Max. value** |
55 | | --- | --- | --- | --- |
56 | | YEAR | YYYY | 1901 | 2155 |
57 | | TIME | HH:MM:SS | -838:59:59 | 838:59:59 |
58 | | DATE | YYYY-MM-DD | 0001-01-01 | 9999-12-31 |
59 | | DATETIME | YYYY-MM-DD HH:MM:SS | 0001-01-01 00:00:00 | 9999-12-31 23:59:59 |
60 | | TIMESTAMP | YYYY-MM-DD HH:MM:SS | 1970-01-01 08:00:01 | 2038-01-19 11:14:07 |
61 |
--------------------------------------------------------------------------------
/docs/06-performance-tuning/02-performance-monitoring-commands/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 7.2,
3 | "label": "Performance Monitoring Commands",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/06-performance-tuning/02-performance-monitoring-commands/cpu-monitor.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: cpu-monitor
3 | sidebar_position: 7.22
4 | ---
5 |
6 | # Commands for CPU Monitoring
--------------------------------------------------------------------------------
/docs/06-performance-tuning/02-performance-monitoring-commands/disk-io-monitor.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: disk-io-monitor
3 | sidebar_position: 7.24
4 | ---
5 |
6 | # Commands for I/O Monitoring
7 |
8 | This topic describes common commands used for I/O monitoring.
9 | ## iostat
10 | The `iostat` command is used to monitor the performance of system I/O devices.
11 |
12 | Command output example:
13 |
14 | ```shell
15 | # iostat -x 1 1
16 | Linux 3.10.0-957.el7.x86_64 (htap2) 06/13/2022 _x86_64_ (64 CPU)
17 |
18 | avg-cpu: %user %nice %system %iowait %steal %idle
19 | 0.06 0.00 0.03 0.01 0.00 99.90
20 |
21 | Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
22 | sda 0.00 0.00 0.00 0.00 0.04 0.00 85.75 0.00 0.25 0.25 0.00 0.15 0.00
23 | sdb 0.06 0.11 7.61 1.10 1849.41 50.81 436.48 0.36 40.93 46.75 0.48 1.56 1.35
24 | dm-0 0.00 0.00 0.28 0.19 8.25 12.05 87.01 0.00 4.81 7.37 0.94 1.61 0.08
25 | ```
26 | Parameter description:
27 |
28 | | **Parameter** | **Description** |
29 | | --- | --- |
30 | | rrqm/s | The number of read requests merged per second. |
31 | | wrqm/s | The number of write requests merged per second. |
32 | | r/s | The number (after merges) of read requests completed per second. |
33 | | w/s | The number (after merges) of write requests completed per second. |
34 | | rkB/s | The number of kilobytes read per second. |
35 | | wkB/s | The number of kilobytes written per second. |
36 | | avgrq-sz | The average size of the requests, expressed in sectors (512 bytes). |
37 | | avgqu-sz | The average queue length of the I/O requests. |
38 | | await | The average time for I/O requests to be served. |
39 | | r_await | The average time for read requests to be served. |
40 | | w_await | The average time for write requests to be served. |
41 | | svctm | The average service time for I/O requests. |
42 | | %util | The percentage of CPU time spent on I/O requests. |
43 |
44 | ## dstat
45 |
46 | The `dstat` command is used to collect performance statistics about CPUs and I/O devices.
47 |
48 | Command output example:
49 |
50 | ```shell
51 | # dstat 1 5
52 | --total-cpu-usage-- -dsk/total- -net/total- ---paging-- ---system--
53 | usr sys idl wai stl| read writ| recv send| in out | int csw
54 | 0 0 99 0 0|9133B 1260k| 0 0 | 0 5B|1059 1009
55 | 2 0 98 0 0| 0 212k| 572B 2258B| 0 0 |1099 761
56 | 2 0 98 0 0| 0 0 | 320B 1456B| 0 0 | 919 674
57 | 2 0 98 0 0| 0 0 | 256B 1448B| 0 0 | 949 665
58 | 2 0 98 0 0| 0 0 |1366B 2190B| 0 0 |1031 812
59 | ```
60 |
61 | Parameter description:
62 |
63 | | **Parameter** | **Description** |
64 | | --- | --- |
65 | | usr | The percentage of CPU time spent in running user space processes. |
66 | | sys | The percentage of CPU time spent in running system processes. |
67 | | idl | The percentage of CPU time spent idle. |
68 | | wai | The percentage of CPU time spent in wait. |
69 | | stl | The percentage of CPU time spent on the hypervisor. |
70 | | read | The number of read requests completed per second. |
71 | | writ | The number of write requests completed per second. |
72 | | recv | The number of packets received per second. |
73 | | send | The number of packets sent per second. |
74 | | in | The number of times information is copied into memory. |
75 | | out | The number of times information is moved out of memory. |
76 | | int | The number of interruptions occurred per second. |
77 | | csw | The number of context switchover per second. |
--------------------------------------------------------------------------------
/docs/06-performance-tuning/02-performance-monitoring-commands/mem-monitor.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: mem-monitor
3 | sidebar_position: 7.23
4 | ---
5 | # Command for Memory Monitoring
6 |
7 | The `free` command can be used to monitor memory usage.
8 |
9 | Command output example:
10 |
11 | ```shell
12 | # free -g
13 | total used free shared buff/cache available
14 | Mem: 251 44 1 0 205 205
15 | Swap: 7 0 7
16 | ```
17 |
18 | Parameter description:
19 |
20 | | **Parameter** | **Description** |
21 | | --- | --- |
22 | | total | The amount of memory.
**total** = **used** + **free** + **buff/cache** |
23 | | used | The amount of used memory. |
24 | | free | The amount of free memory. |
25 | | shared | The amount of shared memory. |
26 | | buff/cache | The amount of memory used as buffers and cache. |
27 | | available | The amount of available memory.
**available** = **free** + **buff/cache** |
--------------------------------------------------------------------------------
/docs/06-performance-tuning/02-performance-monitoring-commands/network-monitor.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: network-monitor
3 | sidebar_position: 7.25
4 | ---
5 | # Command for Network Monitoring
6 |
7 | The topic describes the `netstat` command that is used to monitor network status.
8 |
9 | Command output example:
10 | ```shell
11 | # netstat -i
12 | Kernel Interface table
13 | Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
14 | docker0 1500 70712 0 0 0 131086 0 0 0 BMRU
15 | eno1 1500 124457829 0 101794 0 57907365 0 0 0 BMRU
16 | eno2 1500 0 0 0 0 0 0 0 0 BMU
17 | eno3 1500 0 0 0 0 0 0 0 0 BMU
18 | eno4 1500 0 0 0 0 0 0 0 0 BMU
19 | enp130s0 1500 0 0 0 0 0 0 0 0 BMU
20 | lo 65536 1123 0 0 0 1123 0 0 0 LRU
21 | vethed74 1500 269 0 0 0 407 0 0 0 BMRU
22 | ```
23 | Parameter description:
24 |
25 | | **Parameter** | **Description** |
26 | | --- | --- |
27 | | Iface | The name of the network adapter. |
28 | | MTU | The maximum transmission unit. Default value: 1500. |
29 | | OK | The number of error-free packets. |
30 | | ERR | The number of damaged packets. |
31 | | DRP | The number of dropped packets. |
32 | | OVR | The number of packets that exceeds the threshold. |
33 | | Flg | The flag set for the interface. The value can be:
- **B**: A broadcast address is configured.
- **L**: The interface is a loopback device.
- **M**: All packets are received.
- **R**: The interface is running.
- **U**: The interface is active.
|
34 |
35 | :::info
36 | **RX** indicates received. **TX** indicates sent.
37 | :::
--------------------------------------------------------------------------------
/docs/06-performance-tuning/02-performance-monitoring-commands/top-commands.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: top-commands
3 | sidebar_position: 7.21
4 | ---
5 |
6 | # The top command
--------------------------------------------------------------------------------
/docs/06-performance-tuning/04-database-tuning/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 7.4,
3 | "label": "Database Tuning",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/06-performance-tuning/04-database-tuning/parameter-tuning.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: parameter-tuning
3 | sidebar_position: 7.43
4 | ---
5 |
6 | # Database parameter tuning
--------------------------------------------------------------------------------
/docs/06-performance-tuning/04-database-tuning/sql-best-practices.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: sql-best-practices
3 | sidebar_position: 7.41
4 | ---
5 |
6 | # Best Practices for SQL Coding
--------------------------------------------------------------------------------
/docs/06-performance-tuning/04-database-tuning/sql-tuning.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: sql-tuning
3 | sidebar_position: 7.42
4 | ---
5 |
6 | # Optimize SQL Statements
--------------------------------------------------------------------------------
/docs/06-performance-tuning/05-architecture-tuning/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 7.5,
3 | "label": "Architecture Tuning",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/06-performance-tuning/05-architecture-tuning/read_write-splitting.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: read_write-splitting
3 | sidebar_position: 7.51
4 | ---
5 |
6 | # Read/Write Splitting
--------------------------------------------------------------------------------
/docs/06-performance-tuning/06-performance-tests/00-OLAP/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 7.61,
3 | "label": "OLAP",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/06-performance-tuning/06-performance-tests/00-OLAP/olap-performance-test-method.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: olap-performance-test-method
3 | sidebar_position: 7.611
4 | ---
5 |
6 | # OLAP Performance Test Method
--------------------------------------------------------------------------------
/docs/06-performance-tuning/06-performance-tests/00-OLAP/tcph-test-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: tcph-test-report
3 | sidebar_position: 7.612
4 | ---
5 |
6 | # TCP-H Test Report
--------------------------------------------------------------------------------
/docs/06-performance-tuning/06-performance-tests/01-OLTP/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 7.62,
3 | "label": "OLTP",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/06-performance-tuning/06-performance-tests/01-OLTP/oltp-performance-test-method.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: oltp-performance-test-method
3 | sidebar_position: 7.621
4 | ---
5 |
6 | # OLTP Performance Test Method
--------------------------------------------------------------------------------
/docs/06-performance-tuning/06-performance-tests/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 7.6,
3 | "label": "Performance Tests",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/06-performance-tuning/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 7,
3 | "label": "Performance Tuning",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/06-performance-tuning/os-tuning.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: os-tuning
3 | sidebar_position: 7.3
4 | ---
5 |
6 | # OS Tuning
--------------------------------------------------------------------------------
/docs/06-performance-tuning/overview.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: overview
3 | sidebar_position: 7.1
4 | ---
5 |
6 | # Overview
--------------------------------------------------------------------------------
/docs/07-data-migration-to-stonedb/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 8,
3 | "label": "Data Migration to StoneDB",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/07-data-migration-to-stonedb/use-otter-to-migrate.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: use-outter-to-migrate
3 | sidebar_position: 8.1
4 | ---
5 |
6 | # Use Outter to Migrate Data to StoneDB
7 |
8 |
--------------------------------------------------------------------------------
/docs/08-troubleshooting/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 9,
3 | "label": "Troubleshooting",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/08-troubleshooting/excessive-large-directory.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: excessive-large-directory
3 | sidebar_position: 9.2
4 | ---
5 |
6 | # Excessively Large Data Directory
7 |
8 | The data directory contains data files, binlogs, and error logs. If the data directory is run out of capacity, the database will be suspended and cannot provide services. To prevent this issue, monitoring on capacity usage must be strengthened in routine maintenance. This topic describes common causes of this issue.
9 | ## Big transactions
10 | If big transactions exist, a large amount of binlogs are generated. If the binlog cache is insufficient, excessive binlogs will be temporarily stored to temporary files on disks. Big transactions not only occupy too much disk space, but result in long primary/secondary replication latency. Therefore, we recommend that you split each big transactions into multiple small transactions in your production environment.
11 | ## CARTESIAN JOIN
12 | When SQL statements do not strictly follow syntaxes, for example, no condition is specified during table association, Cartesian products are generated. If the tables to associate are large, the table space will be used up. Therefore, we recommend that you check the execution plan each time you finish writing an SQL statement. If "Using join buffer (Block Nested Loop)" exists in the execution plan, check the two associated tables to see whether the association condition of the driven table is not indexed or no association condition exists.
13 |
14 | :::info
15 | You can start StoneDB to release the temporary table space.
16 | :::
17 | ## Subqueries and grouped orderings
18 | Subqueries and grouped orderings use temporary tables to cache intermediate result sets. If the temporary files run out of space, the intermediate result sets will be temporarily stored to temporary files on disks.
19 |
--------------------------------------------------------------------------------
/docs/08-troubleshooting/failed-to-connect.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: failed-to-connect
3 | sidebar_position: 9.7
4 | ---
5 |
6 | # Failed to Connect to StoneDB
--------------------------------------------------------------------------------
/docs/08-troubleshooting/failed-to-operate-table.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: failed-to-operate-table
3 | sidebar_position: 9.5
4 | ---
5 |
6 | # Failed to Operate on Data in StoneDB Tables
--------------------------------------------------------------------------------
/docs/08-troubleshooting/failed-to-start-in-kvm.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: failed-to-start-in-kvm
3 | sidebar_position: 9.6
4 | ---
5 |
6 | # Failed to Start StoneDB in a KVM
--------------------------------------------------------------------------------
/docs/08-troubleshooting/failed-to-start.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: failed-to-start
3 | sidebar_position: 9.1
4 | ---
5 |
6 | # Failed to Start StoneDB
7 |
8 | Many issues will cause start failures of StoneDB. If StoneDB cannot be started, we recommend you check whether any error information is recorded in **mysqld.log**. This topic describes common causes of a start failure of StoneDB.
9 | ## Improper parameter settings
10 | If the failure is caused by improper parameter settings, check **mysqld.log** to see which parameters are improperly configured.
11 |
12 | The following example indicates that parameter **datadir** is improperly configured.
13 |
14 | ```bash
15 | [ERROR] failed to set datadir to /stonedb/install/dataxxx/
16 | ```
17 | ## Denial to access resources
18 | If the port is occupied, the directory owner is incorrect, or the permission on the directory is insufficient, you cannot access the directory.
19 | ```bash
20 | Error: unable to create temporary file; errno: 13
21 | ```
22 | ## Damaged data pages
23 | If a relevant data page is damaged, StoneDB cannot be started. In this case, you must restore the data page from a backup.
24 |
--------------------------------------------------------------------------------
/docs/08-troubleshooting/mdl-wait.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: mdl-wait
3 | sidebar_position: 9.3
4 | ---
5 |
6 | # Metadata Lock Waits
--------------------------------------------------------------------------------
/docs/08-troubleshooting/resource-bottleneck.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: resource-bottleneck
3 | sidebar_position: 9.9
4 | ---
5 |
6 | # Diagnose System Resource Bottlenecks
--------------------------------------------------------------------------------
/docs/08-troubleshooting/slow-query.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: slow-query
3 | sidebar_position: 9.8
4 | ---
5 |
6 | # Diagnose Slow SQL Queries
--------------------------------------------------------------------------------
/docs/08-troubleshooting/stonedb-crashed.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: stonedb-crashed
3 | sidebar_position: 9.4
4 | ---
5 |
6 | # StoneDB Crashed
--------------------------------------------------------------------------------
/docs/09-FAQ/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "position": 10,
3 | "label": "FAQ",
4 | "collapsible": true
5 | }
--------------------------------------------------------------------------------
/docs/09-FAQ/install-faq.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: install-faq
3 | sidebar_position: 10.1
4 | ---
5 |
6 | # Installation FAQ
--------------------------------------------------------------------------------
/docs/09-FAQ/stonedb-faq.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: stonedb-faq
3 | sidebar_position: 10.2
4 | ---
5 |
6 | # StoneDB FAQ
--------------------------------------------------------------------------------
/docs/09-FAQ/troubleshoot-faq.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: troubleshoot-faq
3 | sidebar_position: 10.3
4 | ---
5 |
6 | # Other FAQ
--------------------------------------------------------------------------------
/docs/download.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: download
3 | sidebar_position: 100
4 | ---
5 |
6 | # Downloads
7 |
8 | ## StoneDB
9 |
10 | Click here to download the latest installation package of StoneDB.
11 |
12 | | Version | Release Date | Installation Package | MD5 |
13 | | --- | --- | --- | --- |
14 | | 1.0 | 2022-6-29 | [Download](https://static.stoneatom.com/stonedb-ce-5.6-v1.0.0.el7.x86_64.tar.gz) | 831f5799034fbb388f6ff26675b7951e |
15 | | Next Version | Coming soon~ | |
16 |
17 |
--------------------------------------------------------------------------------
/docs/release-notes.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: release-notes
3 | sidebar_position: 11.0
4 | ---
5 |
6 | # Release Notes
7 |
8 | Release time: June 30, 2022
9 |
10 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-blog-community/main.md:
--------------------------------------------------------------------------------
1 | ## 社区 {#community}
2 | StoneDB 社区由用户、贡献者和社区独有的文化所组成。他们将我们的社区团结起来,激发了许多新想法的诞生与社区成员间的协作和学习。StoneDB 是一个开放且活跃的社区,我们鼓励社区成员提交 issue 和 PR、向外宣传 StoneDB,并做出其他有利他人的贡献。
3 |
4 | 请继续往下阅读,了解你可以如何参与并成为 StoneDB 社区的一份子。
5 |
6 | ## 贡献团队 {#team}
7 | ```custom-teamList
8 | - 
9 | - 
10 | - 
11 | - 
12 | - 
13 | - 
14 | - 
15 | - 
16 | - 
17 | - 
18 | - 
19 | - 
20 | - 
21 | - 
22 | - 
23 | ```
24 |
25 |
26 | ## 加入社区 {#join}
27 | ```custom-joinList
28 | - [Github Discussion](https://github.com/stoneatom/stonedb-docs/discussions "icon:icon-a-bianzu16beifen1")
29 | - [Slack Channel](https://stonedb.slack.com/join/shared_invite/zt-1ba2lpvbo-Vqq62DJcxViyxCZmp7Rimw#/shared-invite/email "icon:icon-a-bianzu18beifen2")
30 | - [Reddit](https://www.reddit.com/user/StoneDBTeam "icon:icon-a-bianzu3")
31 | - [新浪微博](https://weibo.com/u/7756824587 "icon:icon-a-bianzu31,local:zh")
32 | - [Twitter](https://twitter.com/StoneDB2022 "icon:icon-a-bianzu2")
33 | ```
34 |
35 |
36 |
46 |
47 | ```custom-subscribe
48 | ```
49 |
50 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-blog-community/options.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "message": "Blog",
4 | "description": "The title for the blog used in SEO"
5 | },
6 | "description": {
7 | "message": "Blog",
8 | "description": "The description for the blog used in SEO"
9 | },
10 | "sidebar.title": {
11 | "message": "Recent posts",
12 | "description": "The label for the left sidebar"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-blog/options.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "message": "Blog",
4 | "description": "The title for the blog used in SEO"
5 | },
6 | "description": {
7 | "message": "Blog",
8 | "description": "The description for the blog used in SEO"
9 | },
10 | "sidebar.title": {
11 | "message": "Recent posts",
12 | "description": "The label for the left sidebar"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-docs/current.json:
--------------------------------------------------------------------------------
1 | {
2 | "version.label": {
3 | "message": "Next",
4 | "description": "The label for version current"
5 | },
6 | "sidebar.autoSidebar.category.About StoneDB": {
7 | "message": "关于StoneDB",
8 | "description": "The label for category About StoneDB in sidebar autoSidebar"
9 | },
10 | "sidebar.autoSidebar.category.Environment Requirements": {
11 | "message": "环境要求",
12 | "description": "The label for category Environment Requirements in sidebar autoSidebar"
13 | },
14 | "sidebar.autoSidebar.category.Getting Started": {
15 | "message": "快速上手",
16 | "description": "The label for category Getting Started in sidebar autoSidebar"
17 | },
18 | "sidebar.autoSidebar.category.O&M Guide": {
19 | "message": "运维管理",
20 | "description": "The label for category O&M Guide in sidebar autoSidebar"
21 | },
22 | "sidebar.autoSidebar.category.Monitoring and Alerting": {
23 | "message": "监控警告",
24 | "description": "The label for category Monitoring and Alerting in sidebar autoSidebar"
25 | },
26 | "sidebar.autoSidebar.category.Backup and Recovery": {
27 | "message": "备份与恢复",
28 | "description": "The label for category Backup and Recovery in sidebar autoSidebar"
29 | },
30 | "sidebar.autoSidebar.category.Developer Guide": {
31 | "message": "开发者指南",
32 | "description": "The label for category Developer Guide in sidebar autoSidebar"
33 | },
34 | "sidebar.autoSidebar.category.Compiling Methods": {
35 | "message": "编译方法",
36 | "description": "The label for category Compiling Methods in sidebar autoSidebar"
37 | },
38 | "sidebar.autoSidebar.category.Connect to StoneDB": {
39 | "message": "连接 StoneDB 数据库",
40 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
41 | },
42 | "sidebar.autoSidebar.category.Create and Manage Database Objects": {
43 | "message": "创建和管理数据库对象",
44 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
45 | },
46 | "sidebar.autoSidebar.category.Appendix": {
47 | "message": "附录",
48 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
49 | },
50 | "sidebar.autoSidebar.category.SQL Reference": {
51 | "message": "SQL 参考",
52 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
53 | },
54 | "sidebar.autoSidebar.category.Operators": {
55 | "message": "运算符",
56 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
57 | },
58 | "sidebar.autoSidebar.category.Functions": {
59 | "message": "函数",
60 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
61 | },
62 | "sidebar.autoSidebar.category.Performance Tuning": {
63 | "message": "性能优化",
64 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
65 | },
66 | "sidebar.autoSidebar.category.Performance Monitoring Tools": {
67 | "message": "性能相关工具",
68 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
69 | },
70 | "sidebar.autoSidebar.category.Database Tuning": {
71 | "message": "数据库优化",
72 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
73 | },
74 | "sidebar.autoSidebar.category.Architecture Tuning": {
75 | "message": "架构优化",
76 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
77 | },
78 | "sidebar.autoSidebar.category.Performance Tests": {
79 | "message": "性能测试",
80 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
81 | },
82 | "sidebar.autoSidebar.category.Data Migration to StoneDB": {
83 | "message": "向StoneDB迁移数据",
84 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
85 | },
86 | "sidebar.autoSidebar.category.Troubleshooting": {
87 | "message": "故障诊断",
88 | "description": "The label for category Connect to StoneDB in sidebar autoSidebar"
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-docs/current/00-about-stonedb/architecture.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: architecture
3 | sidebar_position: 1.2
4 | ---
5 |
6 | # 整体架构
7 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-docs/current/00-about-stonedb/intro.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: intro
3 | sidebar_position: 1.1
4 | ---
5 |
6 | # StoneDB 简介
7 |
8 | StoneDB 是由石原子科技公司自主设计、研发的国内首款基于 MySQL 内核打造的开源 HTAP(Hybrid Transactional and Analytical Processing)融合型数据库,可实现与 MySQL 的无缝切换。StoneDB 具备超高性能、实时分析等特点,为用户提供一站式HTAP解决方案。
9 |
10 | StoneDB 是 100% 兼容 MySQL 5.6、5.7协议和 MySQL 生态等重要特性,支持 MySQL 常用的功能及语法,支持 MySQL 生态中的系统工具和客户端,如 Navicat、Workbench、mysqldump、mydumper。由于 100% 兼容 MySQL,因此 StoneDB 的所有工作负载都可以继续使用 MySQL 数据库体系运行。
11 |
12 | StoneDB 专门针对 OLAP 应用程序进行了设计和优化,支持百亿数据场景下进行高性能、多维度字段组合的复杂查询,相对比社区版的 MySQL,其查询速度提升了十倍以上。
13 |
14 | StoneDB 采用基于知识网格技术和列式存储引擎,该存储引擎为海量数据背景下 OLAP 应用而设计,通过列式存储数据、知识网格过滤、高效数据压缩等技术,为应用系统提供低成本和高性能的数据查询支持。
15 |
16 | ## 产品优势
17 |
18 | - 完全兼容 MySQL
19 |
20 | StoneDB 是在原生的 MySQL 中加入的存储引擎,最终集成为 HTAP 数据库,因此是 100% 兼容 MySQL 的。支持标准数据库接口,包括 ODBC、JDBC 和本地连接。支持 API 接口,包括 C、C++、C#、Java、PHP、Perl 等。StoneDB 全面支持 ANSI SQL-92 标准和 SQL-99 扩展标准中视图和存储过程,这种支持使得现有应用程序无需修改应用代码即可使用 StoneDB,从而可实现与 MySQL 的无缝切换。
21 |
22 | - 实时HTAP
23 |
24 | 同时提供行式存储引擎 InnoDB 和列式存储引擎 StoneDB,通过 binlog 从 InnoDB 复制数据,保证行式存储引擎 InnoDB 和列式存储引擎 StoneDB 之间的数据强一致性。
25 |
26 | - 高性能查询
27 |
28 | 在千万、亿级甚至更多数据量下进行复杂查询时,相比 MySQL,其查询速度提升了十倍以上。
29 |
30 | - 低存储成本
31 |
32 | 对数据最高可实现 40 倍压缩,极大的节省了数据存储空间和企业的成本。
33 |
34 | ## 核心技术
35 |
36 | - 列式存储
37 |
38 | 列式存储在存储数据时是按照列模式将数据存储到磁盘上的,读取数据时,只需要读取需要的字段,极大减少了网络带宽和磁盘 IO 的压力。基于列式存储无需为列再创建索引和维护索引。
39 |
40 | - 高效的数据压缩比
41 |
42 | 在关系型数据库中,同一列中的数据属于同一种数据类型,如果列中的重复值越多,则压缩比越高,而压缩比越高,数据量就越小,数据被读取时,对网络带宽和磁盘 IO 的压力也就越小。由于列式存储比行式存储有着十倍甚至更高的压缩比,StoneDB 节省了大量的存储空间,降低了存储成本。
43 |
44 | - 知识网格
45 |
46 | 知识网格根据元数据信息进行粗糙集过滤查询中不符合条件的数据,最后只需要对可疑的数据包进行解压获取符合查询条件的数据,大量减少读取 IO 操作,提高查询响应时间和网络利用率。
47 |
48 | - 基于推送的矢量化查询处理
49 |
50 | StoneDB通过执行计划将矢量块(列式数据切片)从一个运算符推送到另一个运算符来处理查询,与基于元组的处理模型相比,基于推送的执行模型避免了深度调用堆栈,并节省了资源。
51 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-docs/current/00-about-stonedb/limits.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: limits
3 | sidebar_position: 1.3
4 | ---
5 |
6 | # 使用限制
7 | 由于StoneDB是在原生的MySQL中加入的存储引擎,因此是高度兼容MySQL 5.6、5.7协议和MySQL生态等重要特性,支持MySQL常用的功能及语法,但由于StoneDB本身的一些特性,部分操作和功能尚未得到支持,以下列出的是不兼容MySQL的操作和功能。
8 | ## 不支持的DDL
9 | 1. 修改字段的数据类型
10 | 2. 修改字段的长度
11 | 3. 修改表/字段的字符集
12 | 4. 转换表的字符集
13 | 5. optimize table
14 | 6. analyze table
15 | 7. lock table
16 | 8. repair table
17 | 9. CTAS
18 | 10. 重组表
19 | 11. 重命名字段
20 | 12. 设置字段的默认值
21 | 13. 设置字段为空
22 | 14. 设置字段非空
23 | 15. 添加唯一约束
24 | 16. 删除唯一约束
25 | 17. 创建索引
26 | 18. 删除索引
27 | 19. 表修改注释
28 |
29 | StoneDB是列式存储,数据是被高度压缩的,因此表和列的相关属性不易被修改,在表设计阶段尽可能定义好字符集、数据类型、约束和索引等。
30 | ## 不支持的DML
31 | 1. delete
32 | 2. update关联子查询
33 | 3. update多表关联
34 | 4. replace into
35 |
36 | StoneDB不适用于有频繁的更新操作,因为对列式存储来说,更新需要找到对应的每一列,然后分多次更新,而行式存储由于一行紧挨着一行,找到对应的page或者block就可直接在行上更新,因此StoneDB只支持了常规用的单表update和insert。
37 | ## 不支持跨存储引擎关联查询
38 | StoneDB默认不支持跨存储引擎关联查询,也就是说InnoDB存储引擎下的表和StoneDB存储引擎下的表进行关联查询会报错。可在stonedb.cnf参数文件里定义stonedb_ini_allowmysqlquerypath=1,这样就支持跨存储引擎表之间的关联查询了。
39 | ## 不支持的对象
40 | 1. 全文索引
41 | 2. 唯一约束
42 | 3. 触发器
43 | 4. 临时表
44 | 5. 含有自定义函数的存储过程
45 | 6. 含有SQL的自定义函数
46 | ## 不支持的数据类型
47 | 1. 位类型bit
48 | 2. 枚举型enum
49 | 3. 集合型set
50 | 4. decimal精度必须小于或等于18,否则不支持,如decimal(18,x)
51 | 5. 创建表时不支持使用关键字unsigned、zerofill
52 | ## 不支持事务
53 | 只有严格遵守ACID四大属性,才能真正的支持事务。而StoneDB由于没有redo和undo,是不支持事务的。
54 | ## 不支持分区
55 | 列式存储不支持分区。
56 | ## 不支持行锁、表锁
57 | 列式存储不支持行锁、表锁。
58 | ## 只支持statement的binlog格式
59 | 列式存储不支持row、mixed格式的binlog。
60 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-docs/current/00-about-stonedb/terms.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: terms
3 | sidebar_position: 1.4
4 | ---
5 |
6 | # 常见术语介绍
7 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-docs/current/01-environment-requirements/supported-servers-and-oss.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: supported-servers-and-oss
3 | sidebar_position: 2.1
4 | ---
5 |
6 | # 软硬件环境推荐
7 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-docs/current/02-getting-started/quick-deployment.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: quick-deployment
3 | sidebar_position: 3.1
4 | ---
5 |
6 | # 快速部署
7 |
8 | 为方便用户快速上手,安装包是已经编译好的,只需要检查自己的环境是否缺少依赖。
9 | ## 下载安装包
10 | 点击[此处](https://static.stoneatom.com/stonedb-ce-5.6-v1.0.0.el7.x86_64.tar.gz)下载最新的安装包。
11 | ## 上传tar包并解压
12 | ```shell
13 | tar -zxvf stonedb-ce-5.6-v1.0.0.el7.x86_64.tar.gz
14 | ```
15 | 上传至安装目录,解压出来的文件夹名是stonedb56。
16 | ## 检查依赖文件
17 | ```shell
18 | cd /stonedb56/install/bin
19 | ldd mysqld
20 | ldd mysql
21 | ```
22 | 如果检查返回有关键字"not found",说明缺少文件,需要安装对应的依赖包。
23 | ## 修改配置文件
24 | ```shell
25 | cd /stonedb56/install/
26 | cp stonedb.cnf stonedb.cnf.bak
27 | vi stonedb.cnf
28 | ```
29 | 主要修改路径,如果安装目录就是stonedb56,只需要修改其它参数。
30 | ## 创建用户
31 | ```shell
32 | groupadd mysql
33 | useradd -g mysql mysql
34 | passwd mysql
35 | ```
36 | ## 执行脚本reinstall.sh
37 | ```shell
38 | cd /stonedb56/install
39 | ./reinstall.sh
40 | ```
41 | 执行脚本的过程就是初始化实例和启动实例。
42 | ## 登录
43 | ```shell
44 | /stonedb56/install/bin/mysql -uroot -p -S /stonedb56/install/tmp/mysql.sock
45 | Enter password:
46 | Welcome to the MySQL monitor. Commands end with ; or \g.
47 | Your MySQL connection id is 1
48 | Server version: 5.6.24-StoneDB-log build-
49 |
50 | Copyright (c) 2000, 2022 StoneAtom Group Holding Limited
51 | No entry for terminal type "xterm";
52 | using dumb terminal settings.
53 | Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
54 |
55 | mysql> show databases;
56 | +--------------------+
57 | | Database |
58 | +--------------------+
59 | | information_schema |
60 | | cache |
61 | | innodb |
62 | | mysql |
63 | | performance_schema |
64 | | sys_stonedb |
65 | | test |
66 | +--------------------+
67 | 7 rows in set (0.00 sec)
68 | ```
69 | ## 关闭实例
70 | ```shell
71 | /stonedb56/install/bin/mysqladmin -uroot -p -S /stonedb56/install/tmp/mysql.sock shutdown
72 | ```
73 |
74 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-docs/current/02-getting-started/quick-start.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: quick-start
3 | sidebar_position: 3.2
4 | ---
5 |
6 | # 快速上手
7 |
8 | 本文的目的是通过简单的演示,让使用者体验StoneDB在大批量数据插入、数据压缩比和分析查询方面与InnoDB相比具有较高的性能。
9 | ## 第一步. 部署试用环境
10 | 在试用 StoneDB 功能前,请按照[快速部署](quick-deployment.md)中的步骤准备 StoneDB 测试环境并启动实例。
11 | ## 第二步. 准备测试数据
12 | 通过以下步骤,将生成一个测试数据集用于体验 StoneDB 功能。
13 | ### 1) 前提条件
14 | 在同一个测试环境,分别创建StoneDB和InnoDB存储引擎的表,并且以下三个参数也是相同的。
15 | autocommit=1
16 | innodb_flush_log_at_trx_commit=1
17 | sync_binlog=0
18 | ### 2)创建数据库
19 | 创建名为test的数据库
20 | ```
21 | create database test DEFAULT CHARACTER SET utf8mb4;
22 | ```
23 | ### 3) 创建表
24 | 在test数据库内创建名为t_user的表
25 | ```
26 | use test
27 | CREATE TABLE t_user(
28 | id INT NOT NULL AUTO_INCREMENT,
29 | first_name VARCHAR(20) NOT NULL,
30 | last_name VARCHAR(20) NOT NULL,
31 | sex VARCHAR(5) NOT NULL,
32 | score INT NOT NULL,
33 | copy_id INT NOT NULL,
34 | PRIMARY KEY (`id`)
35 | ) engine=STONEDB;
36 | ```
37 | ### 4) 创建存储过程
38 | 执行以下 SQL 语句创建存储过程
39 | ```
40 | DELIMITER //
41 | create PROCEDURE add_user(in num INT)
42 | BEGIN
43 | DECLARE rowid INT DEFAULT 0;
44 | DECLARE firstname VARCHAR(10);
45 | DECLARE name1 VARCHAR(10);
46 | DECLARE name2 VARCHAR(10);
47 | DECLARE lastname VARCHAR(10) DEFAULT '';
48 | DECLARE sex CHAR(1);
49 | DECLARE score CHAR(2);
50 | WHILE rowid < num DO
51 | SET firstname = SUBSTRING(md5(rand()),1,4);
52 | SET name1 = SUBSTRING(md5(rand()),1,4);
53 | SET name2 = SUBSTRING(md5(rand()),1,4);
54 | SET sex=FLOOR(0 + (RAND() * 2));
55 | SET score= FLOOR(40 + (RAND() *60));
56 | SET rowid = rowid + 1;
57 | IF ROUND(RAND())=0 THEN
58 | SET lastname =name1;
59 | END IF;
60 | IF ROUND(RAND())=1 THEN
61 | SET lastname = CONCAT(name1,name2);
62 | END IF;
63 | insert INTO t_user(first_name,last_name,sex,score,copy_id) VALUES (firstname,lastname,sex,score,rowid);
64 | END WHILE;
65 | END //
66 | DELIMITER ;
67 | ```
68 | 此存储过程用于随机生成一张人员信息表。
69 | ## 第三步. 插入性能测试
70 | 执行以下SQL语句调用存储过程
71 | ```
72 | > call add_user_innodb(10000000);
73 | Query OK, 1 row affected (24 min 46.62 sec)
74 |
75 | > call add_user(10000000);
76 | Query OK, 1 row affected (9 min 21.14 sec)
77 | ```
78 | 结果显示:插入1千万数据行,在StoneDB需要9分钟21秒,在InnoDB需要24分钟46秒。
79 | ## 第四步. 数据压缩测试
80 | 通过以下SQL语句验证数据压缩性能
81 | ```
82 | > select count(*) from t_user_innodb;
83 | +----------+
84 | | count(*) |
85 | +----------+
86 | | 10000000 |
87 | +----------+
88 | 1 row in set (1.83 sec)
89 |
90 | > select count(*) from t_user;
91 | +----------+
92 | | count(*) |
93 | +----------+
94 | | 10000000 |
95 | +----------+
96 | 1 row in set (0.00 sec)
97 |
98 | +--------------+---------------+------------+-------------+--------------+------------+---------+
99 | | table_schema | table_name | table_rows | data_length | index_length | total_size | engine |
100 | +--------------+---------------+------------+-------------+--------------+------------+---------+
101 | | test | t_user | 10000000 | 119.99M | 0.00M | 119.99M | STONEDB |
102 | | test | t_user_innodb | 9995867 | 454.91M | 0.00M | 454.91M | InnoDB |
103 | +--------------+---------------+------------+-------------+--------------+------------+---------+
104 | ```
105 | 结果显示:相同的数据行,在StoneDB大小为120M,在InnoDB大小为455M。
106 | ## 第五步. 聚合查询测试
107 | 通过以下语句执行聚合查询测试
108 | ```
109 | > select first_name,count(*) from t_user group by first_name order by 1;
110 | +------------+----------+
111 | | first_name | count(*) |
112 | +------------+----------+
113 | .....
114 | | fffb | 142 |
115 | | fffc | 140 |
116 | | fffd | 156 |
117 | | fffe | 140 |
118 | | ffff | 132 |
119 | +------------+----------+
120 | 65536 rows in set (0.98 sec)
121 |
122 | > select first_name,count(*) from t_user_innodb group by first_name order by 1;
123 | +------------+----------+
124 | | first_name | count(*) |
125 | +------------+----------+
126 | ......
127 | | fffb | 178 |
128 | | fffc | 161 |
129 | | fffd | 170 |
130 | | fffe | 156 |
131 | | ffff | 139 |
132 | +------------+----------+
133 | 65536 rows in set (9.00 sec)
134 | ```
135 | 结果显示:执行相同的聚合查询,在StoneDB需要0.98s,在InnoDB需要9s。
136 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-docs/current/03-O&M-Guide/regular-change-operations.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: regular-change-operations
3 | sidebar_position: 4.1
4 | ---
5 |
6 | # 常规变更
7 |
8 | ## 表结构变更
9 | StoneDB只支持以下表结构变更和数据变更操作,其它没有说明的表示不支持。
10 | ### 创建相似表
11 | 1)创建一张引擎为 stonedb 、名为t_name的表;
12 | ```sql
13 | CREATE TABLE t_name(
14 | col1 INT NOT NULL AUTO_INCREMENT,
15 | col2 VARCHAR(10) NOT NULL,
16 | ......
17 | PRIMARY KEY (`id`)
18 | ) engine=STONEDB;
19 | ```
20 | 2)创建一张与t_name结构相同的表t_other
21 | 使用 Create table like 语句
22 | ```
23 | create table t_other like t_name;
24 | ```
25 | ### 清空表数据
26 | 使用truncate table 语句可以实现保留表结构,仅清空表中的数据
27 | ```
28 | truncate table t_name;
29 | ```
30 | ### 添加字段
31 | 使用 alter table ... add column 语句实现向指定表中添加字段,新增加的字段默认置于最后一个字段。
32 | ```
33 | alter table t_name add column c_name varchar(10);
34 | ```
35 | ### 删除字段
36 | 使用 alter table ... drop 语句实现删除表中指定字段。
37 | ```
38 | alter table t_name drop c_name;
39 | ```
40 | ### 重命名表
41 | 使用 alter table ... rename to 语句实现对指定表的重命名。
42 | ```
43 | alter table t_name rename to t_name_new;
44 | ```
45 | ## 用户权限变更
46 | ### 创建用户
47 | ```
48 | create user 'u_name'@'hostname' identified by 'xxx';
49 | ```
50 | ### 给用户赋权
51 | ```
52 | grant all on *.* to 'u_name'@'hostname';
53 | grant select on db_name.* to 'u_name'@'hostname';
54 | grant select(column_name) on db_name.t_name to 'u_name'@'hostname';
55 | ```
56 | ### 回收用户权限
57 | ```
58 | revoke all privileges on *.* from 'u_name'@'hostname';
59 | revoke select on db_name.* from 'u_name'@'hostname';
60 | revoke select(column_name) on db_name.t_name from 'u_name'@'hostname';
61 | ```
62 | ### 删除用户
63 | ```
64 | drop user 'u_name'@'hostname';
65 | ```
66 |
67 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-plugin-content-docs/current/download.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: download
3 | sidebar_position: 100
4 | ---
5 |
6 | # 下载
7 |
8 | ## StoneDB
9 |
10 | 在这里您可以下载最新的 StoneDB 安装包:
11 |
12 | | 版本 | 发布日期 | 安装包 | MD5 |
13 | | --- | --- | --- | --- |
14 | | 1.0 | 2022-6-29 | [Download](https://static.stoneatom.com/stonedb-ce-5.6-v1.0.0.el7.x86_64.tar.gz) | 831f5799034fbb388f6ff26675b7951e |
15 | | Next Version | Coming soon~ | |
16 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-theme-classic/footer.json:
--------------------------------------------------------------------------------
1 | {
2 | "copyright": {
3 | "message": "Copyright © The StoneAtom-tech ALL Rights Reserved",
4 | "description": "The footer copyright"
5 | },
6 | "link.item.label.@StoneDB2022": {
7 | "message": "@StoneDB2022",
8 | "description": "The label of footer link with label=@StoneDB2022 linking to https://twitter.com/StoneDataBase"
9 | },
10 | "link.item.label.dev@stonedb.io": {
11 | "message": "dev@stonedb.io",
12 | "description": "The label of footer link with label=dev@stonedb.io linking to #"
13 | },
14 | "link.item.label. ": {
15 | "message": " ",
16 | "description": "The label of footer link with label= linking to https://stonedb.slack.com/join/shared_invite/zt-1ba2lpvbo-Vqq62DJcxViyxCZmp7Rimw#/shared-invite/email"
17 | },
18 | "link.item.label.StoneAtom/stonedb": {
19 | "message": "StoneAtom/stonedb",
20 | "description": "The label of footer link with label=StoneAtom/stonedb linking to https://github.com/StoneAtom/stonedb"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/i18n/zh/docusaurus-theme-classic/navbar.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "message": "首页",
4 | "description": "The title in the navbar"
5 | },
6 | "item.label.Download": {
7 | "message": "下载",
8 | "description": "Navbar item with label Download"
9 | },
10 | "item.label.Docs": {
11 | "message": "文档",
12 | "description": "Navbar item with label Docs"
13 | },
14 | "item.label.Community": {
15 | "message": "社区",
16 | "description": "Navbar item with label Community"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "stoneDB",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "css": "node ./scripts/css.js",
7 | "docusaurus": "docusaurus",
8 | "start": "docusaurus start",
9 | "build": "NODE_ENV=development && docusaurus build",
10 | "swizzle": "docusaurus swizzle",
11 | "deploy": "docusaurus deploy",
12 | "clear": "docusaurus clear",
13 | "serve": "docusaurus serve",
14 | "write-translations": "docusaurus write-translations",
15 | "write-heading-ids": "docusaurus write-heading-ids",
16 | "typecheck": "tsc"
17 | },
18 | "dependencies": {
19 | "@docusaurus/core": "2.0.0-beta.21",
20 | "@docusaurus/plugin-pwa": "2.0.0-beta.21",
21 | "@docusaurus/preset-classic": "2.0.0-beta.21",
22 | "@mdx-js/react": "^1.6.22",
23 | "antd": "^4.20.5",
24 | "clsx": "^1.1.1",
25 | "emailjs": "^4.0.0",
26 | "gsap": "^3.10.4",
27 | "hast-util-to-text": "^3.1.1",
28 | "js-md5": "^0.7.3",
29 | "katex": "^0.15.6",
30 | "libpag": "^4.0.5-release.7",
31 | "lottie-web": "^5.9.4",
32 | "md5": "^2.3.0",
33 | "mdast-util-definition-list": "^1.1.1",
34 | "mdast-util-math": "^2.0.1",
35 | "micromark-extension-math": "^2.0.2",
36 | "mockjs": "^1.1.0",
37 | "prism-react-renderer": "^1.3.1",
38 | "ramda": "^0.28.0",
39 | "react": "^17.0.2",
40 | "react-dom": "^17.0.2",
41 | "react-markdown": "^8.0.3",
42 | "rehype-katex": "^4.0.0",
43 | "rehype-stringify": "^9.0.3",
44 | "remark-html": "^15.0.1",
45 | "remark-math": "^3.0.1",
46 | "remark-rehype": "^10.1.0",
47 | "styled-components": "^5.3.5",
48 | "unist-util-select": "^2.0.2",
49 | "uuid": "^8.3.2"
50 | },
51 | "devDependencies": {
52 | "@docusaurus/plugin-client-redirects": "^2.0.0-beta.21",
53 | "@tsconfig/docusaurus": "^1.0.5",
54 | "@types/styled-components": "^5.1.25",
55 | "babel-plugin-import": "^1.13.5",
56 | "babel-plugin-styled-components": "^2.0.7",
57 | "docusaurus-plugin-less": "^2.0.2",
58 | "less": "^4.1.2",
59 | "less-loader": "^11.0.0",
60 | "less-vars-to-js": "^1.3.0",
61 | "style-loader": "^3.3.1",
62 | "typescript": "^4.6.4"
63 | },
64 | "browserslist": {
65 | "production": [
66 | ">0.5%",
67 | "not dead",
68 | "not op_mini all"
69 | ],
70 | "development": [
71 | "last 1 chrome version",
72 | "last 1 firefox version",
73 | "last 1 safari version"
74 | ]
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/plugins/community/index.js:
--------------------------------------------------------------------------------
1 | const pluginContentDoc = require('@docusaurus/plugin-content-docs');
2 |
3 | async function CommunityPlugin(context, options) {
4 | const communityPlugin = await pluginContentDoc.default(context, {
5 | ...options,
6 | });
7 | return {
8 | ...communityPlugin,
9 | name: 'community',
10 | docItemComponent: '@theme/CommunityItem',
11 | getThemePath() {
12 | return './theme';
13 | },
14 | }
15 | }
16 |
17 | CommunityPlugin.validateOptions = pluginContentDoc.validateOptions;
18 |
19 | module.exports = CommunityPlugin;
20 |
21 |
--------------------------------------------------------------------------------
/plugins/community/theme/CommunityItem/index.tsx:
--------------------------------------------------------------------------------
1 |
2 | import React from 'react';
3 | import type {Props} from '@theme/DocItem';
4 |
5 |
6 | export default function DocItem(props: Props): JSX.Element {
7 | const {content: DocContent, versionMetadata} = props;
8 |
9 | return (
10 | <>
11 |
59 |
21 |
30 |
39 |
48 |
57 |
66 |
28 |
34 |
41 |