江郎才尽,毫无创意!Aurora PostgreSQL Limitless Database
参考文档点击文末阅读原文打开; 推荐《最好的PostgreSQL学习镜像》;
江郎才尽,毫无新意! Aurora PostgreSQL Limitless Database GA了
Aurora PostgreSQL Limitless Database GA了, 看了一眼文档, 名字很高大上,仔细阅读发现毫无新意.
从术语和用例来分析, 这不就是citus + aurora 集中版拼凑起来的产品? 很多的概念和开源citus、PGXC几乎一样. 难道aws玩了一招组合创新?
来看一下术语对比:
1、DB shard group 对应 PGXC DN NodeGroups , 主要目的是方便将业务和数据节点进行映射, 实现DBaaS化, 同时减少不同业务数据相互干扰.
A container for Limitless Database nodes (shards and routers).
2、Router 对应 PGXC CN 节点
A node that accepts SQL connections from clients, sends SQL commands to shards, maintains system-wide consistency, and returns results to clients.
3、Sharded table 对应 PGXC sharding table, 数据分布于某个DN NodeGroup.
A table with its data partitioned across shards.
4、Shard key , 分布键
A column or set of columns in a sharded table that's used to determine partitioning across shards.
5、Shard , sharding table 的分片.
A node that stores a subset of sharded tables, full copies of reference tables, and standard tables. Accepts queries from routers, but can't be connected to directly by the clients.
6、Collocated tables 对应 citus Co-Location tables, 这些表的shard key 类型相同, 并且这些表shard key内容相同的shard(分片)被放置在相同的DN节点. 当这些表按shard key JOIN时不需要跨DN节点重分布数据.
Two sharded tables that share the same shard key and are explicitly declared as collocated. All data for the same shard key value is sent to the same shard.
7、Reference table , 类似 广播表, 在所有DN NodeGroups内都有一份拷贝. 通过2pc或逻辑复制同步数据.
A table with its data copied in full on every shard.
8、Standard table , 对应本地表概念. 只存储在某一个DN节点内.
The default table type in Aurora PostgreSQL Limitless Database, stored on one of the shards chosen internally by the system. A standard table is like a table in Aurora PostgreSQL. You can convert standard tables into sharded and reference tables.
例子
1、For example, create a sharded table named items with a shard key composed of the item_id and item_cat columns.
SET rds_aurora.limitless_create_table_mode='sharded';
SET rds_aurora.limitless_create_table_shard_key='{"item_id", "item_cat"}';
CREATE TABLE items(item_id int, item_cat varchar, val int, item text);
2、Now, create a sharded table named item_description with a shard key composed of the item_id and item_cat columns and collocate it with the items table.
SET rds_aurora.limitless_create_table_collocate_with='items';
CREATE TABLE item_description(item_id int, item_cat varchar, color_id int, ...);
按 shard KEY JOIN 两个collocate表, 不需要跨节点重分布数据.
3、You can also create a reference table named colors.
SET rds_aurora.limitless_create_table_mode='reference';
CREATE TABLE colors(color_id int primary key, color varchar);
JOIN reference表不需要跨节点重分布数据.
4、You can find information about Limitless Database tables by using the rds_aurora.limitless_tables view, which contains information about tables and their types.
postgres_limitless=> SELECT * FROM rds_aurora.limitless_tables; table_gid | local_oid | schema_name | table_name | table_status | table_type | distribution_key
-----------+-----------+-------------+-------------+--------------+-------------+------------------
1 | 18797 | public | items | active | sharded | HASH (item_id, item_cat)
2 | 18641 | public | colors | active | reference |
(2 rows)
5、提供shard key进行查询时, 路由到单个节点.
postgres_limitless=> SET rds_aurora.limitless_explain_options = shard_plans, single_shard_optimization;
SET postgres_limitless=> EXPLAIN SELECT * FROM items WHERE item_id = 25;
QUERY PLAN
--------------------------------------------------------------
Foreign Scan (cost=100.00..101.00 rows=100 width=0)
Remote Plans from Shard postgres_s4:
Index Scan using items_ts00287_id_idx on items_ts00287 items_fs00003 (cost=0.14..8.16 rows=1 width=15)
Index Cond: (id = 25)
Single Shard Optimized
(5 rows)
参考
https://git.postgresql.org/gitweb/?p=postgres-xl.git;a=summary
https://git.postgresql.org/gitweb/?p=postgres-xl.git;a=tree;f=doc/src/sgml;h=905b7b2e2303f80b7b18271483b2b10c1a590a2b;hb=31dfe47342eabe8ad72c000a103e54a94b49c912
https://www.citusdata.com/product
https://aws.amazon.com/cn/blogs/aws/amazon-aurora-postgresql-limitless-database-is-now-generally-available/
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/limitless-architecture.html
今日荐书
彩蛋:国产数据库周边生态
当然一款数据库要流行起来, 除了自己要强大, 还离不开生态. 用好周边生态工具, 管理水平战胜90%老司机!!! 下面简单介绍一下国产数据库周边生态.
1、管控软件
鸣嵩(前阿里云数据库总经理 / 研究员)等大佬们创业创办的云猿生, 核心产品是KubeBlocks. 他们的理念是让管理数据库和搭积木一样简单, 如果你要管理很多套并且种类(OLTP\OLAP\NoSQL\KV\TS\MQ等)很多的数据库产品, 推荐首选.
https://github.com/apecloud/kubeblocks
PG中文社区核心委员唐成老师的公司乘数开源的Clup, 专用管理PostgreSQL和PolarDB的集群管理软件, 如果你要管理很多套数据库, 推荐选择. 并且Clup还提供了企业版、自研的连接池、分布式存储、一体机、备份平台等, 是企业用户推荐之选.
https://www.csudata.com/
若航开源的pigsty, 集成了300多个PG插件的PG集群和PolarDB集群管理软件, 如果你要管理很多套PG或PolarDB数据库, 且对插件有特别多的需求, 推荐选择.
https://pigsty.cc/zh/
2、审计监控诊断优化
翟总(曾经是我背后的男人)到海信聚好看后研发的 DBdoctor, 采用ebpf技术, 在对数据库几乎没有影响的情况下实时监控数据库和服务器的各项指标, 发现和诊断问题根因非常方便.
https://www.dbdoctor.cn/
天舟老哥的核心产品Bytebase 是位于您和数据库之间的中间件。它是数据库 DevOps 的 GitLab/GitHub,专为开发人员、DBA 和平台工程师打造。
https://bytebase.cc/docs/introduction/what-is-bytebase/
PawSQL, SQL优化和诊断产品.
D-Smart, Oracle老前辈白老大出品, 专注企业级市场, 将业界顶级DBA经验的产品化作品, 产品功能包括数据库监控、诊断、优化等.
https://www.modb.pro/db/567140
3、国产数据库IDE
IDE是开发者的必备工具,例如社区有pgAdmin, 国产IDE则可以看看老程序猿达刚老师的DeskUI:
https://www.deskui.com
4、数据同步&迁移&备份恢复
NineData, 老领导出去创业做的产品, 产品涵盖了数据同步、迁移、备份、比对、devops、chatDBA等.
https://www.ninedata.cloud/home
DSG, 非常老牌的数据库同步迁移企业级产品, 支持各种数据库的异构和同构迁移, 用他们的话说, 没有dsg搞不定的迁移, 比goldengate还牛.
https://www.dsgdata.com/
公开课
如果你对PolarDB学习感兴趣可以阅读这个公开课系列:
除了PolarDB还非常值得关注的几款PG栈国产数据库:
HaloDB(基于PG兼容PostgreSQL、Oracle、MySQL. http://www.halodbtech.com/ )、 IvorySQL(基于开源PG兼容PG、Oracle. https://www.ivorysql.org/zh-cn/ )、 ProtonBase(云原生分布式数仓. https://protonbase.com/ )、 成都文武数据库(https://ww-it.cn)
参考文档点击阅读原文获得
感谢关注我的github (https://github.com/digoal/blog) 及视频号: