ShardingSphere是apache顶级开源项目,旨在构建异构数据库上层的标准和生态。它关 注如何充分合理地利用数据库的计算和存储能力,而并非实现一个全新的数据库。ShardingSphere 站在 数据库的上层视角,关注他们之间的协作多于数据库自身。
连接、增量和可插拔是 Apache ShardingSphere 的核心概念。
连接:通过对数据库协议、SQL方言以及数据库存储的灵活适配,快速的连接应用与多模式的异构数据库;
增量:获取数据库的访问流量,并提供流量重定向(数据分片、读写分离、影子库)、流量变形(数据加密、数据脱敏)、流量鉴权(安全、审计、权限)、流量治理(熔断、限流)以及流量分析(服 务质量分析、可观察性)等透明化增量功能;
可插拔:项目采用微内核+三层可插拔模型,使内核、功能组件以及生态对接完全能够灵活的方式 进行插拔式扩展,开发者能够像使用积木一样定制属于自己的独特系统。
(base) gengdeMacBook-Pro:conf js2thon$ mysql -h127.0.0.1 -uroot -P3308
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 8.0.20-Sharding-Proxy 4.1.0
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show tables;
+----------------------+------------+
| Tables_in_encrypt_db | Table_type |
+----------------------+------------+
| t_encrypt | BASE TABLE |
+----------------------+------------+
1 row in set (0.03 sec)
mysql> select * from t_encrypt;
+----------+---------+-------------+
| order_id | user_id | phone |
+----------+---------+-------------+
| 10 | 0 | 18516014911 |
| 11 | 1 | 18516014922 |
| 12 | 2 | 18516014933 |
| 13 | 3 | 18516014944 |
| 14 | 4 | 18516014955 |
+----------+---------+-------------+
5 rows in set (0.09 sec)
mysql> select * from t_encrypt;
+----------+---------+--------------------------+-------------+
| order_id | user_id | phone_cipher | phone |
+----------+---------+--------------------------+-------------+
| 10 | 0 | uFZ1RGQfxsUM+GUJqI5rlQ== | 18516014911 |
| 11 | 1 | SGxnMaUHY/HR50hJcYp6Vg== | 18516014922 |
| 12 | 2 | Z5NBefdS9WN3Bl6p45R1Dw== | 18516014933 |
| 13 | 3 | SKqYOUF4dxloUH5M9t/wEg== | NULL |
| 14 | 4 | 4q+dOa+bxUTFSzX6AOjvUg== | NULL |
+----------+---------+--------------------------+-------------+
(向右滑动,查看更多)
Key-Value:简单的静态键值对 动态生成的凭据:由Vault根据客户端请求生成 加密密钥:用于使用客户端数据执行加密功能
(base) js2thondeMacBook-Pro:Downloads js2thon$ mysql -u v-my-r-owFmZ3LFu -pM8DdaYZXYRU-rNIm2CbQ
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1379
Server version: 5.6.41-log MySQL Community Server (GPL)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
(向右滑动,查看更多)
mysql> use mysql_test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+----------------------+
| Tables_in_mysql_test |
+----------------------+
| account |
+----------------------+
mysql> select * from account;
+------+------+
| id | name |
+------+------+
| 100 | abc |
+------+------+
1 row in set (0.00 sec)
mysql> insert into account values(101,'def');
ERROR 1142 (42000): INSERT command denied to user 'v-my-r-owFmZ3LFu'@'localhost' for table 'account'
4. 问题和思考
精彩推荐