1.PolarDB-X 是一款面向超高并发、海量存储、复杂查询场景设计的云原生分布式数据库系统。
2.PolarDB-X采用 Shared-nothing 与存储计算分离架构,支持水平扩展、分布式事务、混合负载等能力,具备企业级、云原生、高可用、高度兼容 MySQL 系统及生态等特点。
PolarDB-X 采用 Shared-nothing 架构进行设计,支持多种 Hash 和 Range 数据拆分算法,通过隐式主键拆分和数据分片动态调度,实现系统的透明水平扩展。
PolarDB-X 采用 MVCC + TSO 方案及 2PC 协议实现分布式事务。事务满足 ACID 特性,支持 RC/RR 隔离级别,并通过一阶段提交、只读事务、异步提交等优化实现事务的高性能。
PolarDB-X 通过原生 MPP 能力实现对分析型查询的支持,通过 CPU quota 约束、内存池化、存储资源分离等实现了 OLTP 与 OLAP 流量的强隔离。
PolarDB-X 为企业场景设计了诸多内核能力,例如 SQL 限流、SQL Advisor、TDE、三权分立、Flashback Query 等。
PolarDB-X 在阿里云上有多年的云原生实践,支持通过 K8S Operator 管理集群资源,支持公有云、混合云、专有云等多种形态进行部署,并支持国产化操作系统和芯片。
通过多数派 Paxos 协议实现数据强一致,支持两地三中心、三地五副本等多种容灾方式,同时通过 Table Group、Geo-locality 等提高系统可用性。
PolarDB-X 的目标是完全兼容 MySQL ,目前兼容的内容包括 MySQL 协议、MySQL 大部分语法、Collation、事务隔离级别、Binlog 等。
[root@node ~]# docker version
Client: Docker Engine - Community
Version: 20.10.17
API version: 1.41
Go version: go1.17.11
Git commit: 100c701
Built: Mon Jun 6 23:05:12 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.17.11
Git commit: a89b842
Built: Mon Jun 6 23:03:33 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.6
GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc:
Version: 1.1.2
GitCommit: v1.1.2-0-ga916309
docker-init:
Version: 0.19.0
GitCommit: de40ad0
[root@node ~]# docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
compose: Docker Compose (Docker Inc., v2.6.0)
scan: Docker Scan (Docker Inc., v0.17.0)
Server:
Containers: 18
Running: 16
Paused: 0
Stopped: 2
Images: 70
Server Version: 20.10.17
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc version: v1.1.2-0-ga916309
init version: de40ad0
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-957.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.62GiB
Name: node
ID: EIOB:6IAO:NQTR:AJBA:O6KS:SNWP:JEDK:GXBG:55FP:IOSK:WRH3:QOAU
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Registry Mirrors:
https://sp4mg57h.mirror.aliyuncs.com/
Live Restore Enabled: false
[root@node ~]# docker pull polardbx/polardb-x
Using default tag: latest
latest: Pulling from polardbx/polardb-x
2d473b07cdd5: Pull complete
764f8dbcccbf: Pull complete
802af989135a: Pull complete
9e171b6eee06: Pull complete
dc37b9fd8a16: Pull complete
Digest: sha256:7a29520f6a77b7adcb0ead5ac62c0134172ffb072acc9b6e5daca81652e14aec
Status: Downloaded newer image for polardbx/polardb-x:latest
快速启动一个具有一个 CN、一个 DN 和一个 CDC 进程的 PolarDB-X
[root@node ~]# docker run -d --name some-polardb-x -p 8527:8527 polardbx/polardb-x
1b94143ae90b8d52f71b1a5bbf870d4567cfe162ff60afb0cbc0edcdae4c64ed
[root@node ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1b94143ae90b polardbx/polardb-x "/bin/sh -c /home/ad…" 10 hours ago Up 10 hours 0.0.0.0:8527->8527/tcp, :::8527->8527/tcp some-polardb-x
[root@k8s-node01 ~]# mysql -h192.168.3.167 -P8527 -upolardbx_root -p123456
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.6.29 Tddl Server (ALIBABA)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
MySQL [(none)]> CREATE USER 'user'@'%' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.23 sec)
MySQL [(none)]> SET PASSWORD FOR 'user'@'%' = PASSWORD('654321');
Query OK, 0 rows affected (0.05 sec)
MySQL [(none)]> grant all on *.* to 'user'@'%' with grant option;
Query OK, 0 rows affected (0.09 sec)
MySQL [(none)]> flush privileges;
Query OK, 0 rows affected (0.03 sec)
MySQL [(none)]> select user,host from mysql.user;
+---------------+------+
| user | host |
+---------------+------+
| polardbx_root | % |
| root | % |
| user | % |
+---------------+------+
3 rows in set (0.01 sec)
DROP USER 'user'@'%';
[root@k8s-node01 ~]# mysql -h192.168.3.167 -P8527 -uuser -p654321
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.6.29 Tddl Server (ALIBABA)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]> show databases;
+--------------------+
| DATABASE |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.00 sec)
MySQL [(none)]>
MySQL [(none)]> show grants for user@'%';
+-------------------------------------------------------------+
| GRANTS FOR 'USER'@'%' |
+-------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' WITH GRANT OPTION |
+-------------------------------------------------------------+
1 row in set (0.10 sec)
MySQL [(none)]> show databases;
+--------------------+
| DATABASE |
+--------------------+
| information_schema |
| phpmyadmin |
+--------------------+
2 rows in set (0.00 sec)
MySQL [(none)]> create database testdata;
Query OK, 1 row affected (0.21 sec)
MySQL [(none)]> show databases;
+--------------------+
| DATABASE |
+--------------------+
| information_schema |
| phpmyadmin |
| testdata |
+--------------------+
3 rows in set (0.00 sec)
MySQL [(none)]> use testdata;
Database changed
MySQL [(none)]> use testdata;
Database changed
MySQL [testdata]> show tables;
Empty set (0.02 sec)
MySQL [testdata]> CREATE TABLE IF NOT EXISTS `student`(
-> `id` INT UNSIGNED AUTO_INCREMENT,
-> `name` VARCHAR(100) NOT NULL,
-> `gender` TINYINT NOT NULL,
-> `age` INT UNSIGNED,
-> `class` INT UNSIGNED,
-> `score` INT UNSIGNED,
-> PRIMARY KEY ( `id` )
-> )ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.54 sec)
MySQL [testdata]> show tables;
+--------------------+
| TABLES_IN_TESTDATA |
+--------------------+
| student |
+--------------------+
1 row in set (0.00 sec)
alter table student rename aaa;
MySQL [testdata]> insert into student ( name, gender, age, class, score ) values ( "李萌萌", "0", "17", "3", "98" );
Query OK, 1 row affected (0.01 sec)
MySQL [testdata]> select * from student;
+------+-----------+--------+-----+-------+-------+
| id | name | gender | age | class | score |
+------+-----------+--------+-----+-------+-------+
| 1 | 李萌萌 | 0 | 17 | 3 | 98 |
| 2 | 王强 | 1 | 18 | 1 | 88 |
| 3 | 李萌萌 | 0 | 17 | 3 | 98 |
| 4 | 王强 | 1 | 18 | 1 | 88 |
| 5 | 李一 | 1 | 16 | 2 | 88 |
| 6 | 陈飞 | 1 | 18 | 4 | 90 |
| 7 | 张静 | 0 | 16 | 1 | 92 |
+------+-----------+--------+-----+-------+-------+
7 rows in set (0.01 sec)