1 Star 0 Fork 0

幸运的米粥912 / PolarDB-for-PostgreSQL

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
arch.md 3.63 KB
一键复制 编辑 原始数据 按行查看 历史
Crystal-db 提交于 2021-07-28 21:46 . Update arch.md

Architecture and Main Functions

PolarDB for PostgreSQL implements a share-nothing architecture using PostgreSQL as the main component. Without specific mention, we use PolarDB as a short name for PolarDB for PostgreSQL. PolarDB is fully compatible to PostgreSQL and supports most of PostgreSQL SQL functions. As a distributed database system, PolarDB achieves the same data consistency and ACID as a standalone database system. PolarDB implements Paxos-based replication, which offers high availability, data redundancy, and consistency across nodes, in case of node failure and cluster reconfiguration. Fine-grained sharding and application-transparent shard relocation allow PolarDB to efficiently utilize the cloud-wise resources to adapt to varying computation and storage requirements. PolarDB's distributed SQL engine achieves fast processing of complex queries by combining the comprehensiveness of the PostgreSQL optimizer and the efficiency of parallel execution among or inside nodes.

Overall, PolarDB provides scalable SQL computation and fully-ACID relational data storage on commodity hardware or standard cloud resources, such as ECS and block storage service.

Architecture of PolarDB

Sharding and Plug-in

PolarDB cluster consists of three main components: database node (DN), cluster manager (CM), and transaction & time service (TM). They are different processes and can be deployed in multiple servers or ECS. DNs are the main database engines, which receive SQL requests from clients or load balancer and processes them. Each DN can act as a coordinator to distribute queries and coordinate transactions across many DNs. Each DN handles part of the data stored in a database. Any operations, including read and write, to those data, are processed by their corresponding DN. The data in one DN is further partitioned into shards. Those shards can be relocated to other DNs when PolarDB scales out or re-balances workload. DNs have their replicas storing the same data through Paxos-based replication. DNs and their replicas form a replication group. In such a group, a primary DN handles all write requests and propagates their results to replica DNs (or follower DNs). Our Paxos replication also supports logger DNs, which only stores log records rather than data.

TM is a centralized service to support globally consistent and in-order status or counters. Ascending timestamp and global transaction ID are two examples.

CM monitors each DN's status and maintains the cluster configuration. CM also supports tools and commands to manage a PolarDB cluster, such as starting or stopping DNs, upgrading, taking backup, and balancing workload.

PolarDB is in evolution. The functions of the above three components are gradually opened. The roadmap can be found here.

Main Functions of PolarDB

  • ACID capable distributed OLTP
  • Full SQL Compatibility of PostgreSQL
  • Distributed SQL execution
  • Fast upgrading with latest PostgreSQL versions
  • Paxos based replication for data consistency
  • Fine-grained Sharding
  • Online shard relocation
  • High performance
  • Scalability & Elasticity
    • Hybrid logic clock
    • Scalable coordination
    • Single-node Tx optimization
    • ...
  • High Availability
    • Online cluster expansion
    • Low RTO failover
    • Zero-interruption & user-transparent switchover
    • Cross-AZ/DC zero-RPO deployment
    • On-the-fly repairment of page corruption
    • ...

Copyright © Alibaba Group, Inc.

C
1
https://gitee.com/lucky912_admin/PolarDB-for-PostgreSQL.git
git@gitee.com:lucky912_admin/PolarDB-for-PostgreSQL.git
lucky912_admin
PolarDB-for-PostgreSQL
PolarDB-for-PostgreSQL
master

搜索帮助