oriole
OrioleDB 内核,提供无膨胀的 OLTP 增强存储引擎
oriole 配置模板使用 OrioleDB 存储引擎替代 PostgreSQL 默认的 Heap 存储,提供无膨胀、高性能的 OLTP 能力。
配置概览
- 配置名称:
oriole - 节点数量: 单节点
- 配置说明:OrioleDB 无膨胀存储引擎配置
- 适用系统:
el8,el9,u22,u24 - 适用架构:
x86_64 - 相关配置:
meta
启用方式:
./configure -c oriole [-i <primary_ip>]
配置内容
源文件地址:pigsty/conf/oriole.yml
all:
children:
infra: { hosts: { 10.10.10.10: { infra_seq: 1 }} ,vars: { repo_enabled: false }}
etcd: { hosts: { 10.10.10.10: { etcd_seq: 1 }} ,vars: { etcd_cluster: etcd }}
#----------------------------------------------#
# OrioleDB Cluster
#----------------------------------------------#
pg-meta:
hosts:
10.10.10.10: { pg_seq: 1, pg_role: primary }
vars:
pg_cluster: pg-meta
pg_users:
- {name: dbuser_meta ,password: DBUser.Meta ,pgbouncer: true ,roles: [dbrole_admin] ,comment: pigsty admin user }
- {name: dbuser_view ,password: DBUser.Viewer ,pgbouncer: true ,roles: [dbrole_readonly] ,comment: read-only viewer }
pg_databases:
- name: meta
baseline: cmdb.sql
comment: pigsty meta database
schemas: [pigsty]
extensions: [{ name: orioledb }] # 启用 OrioleDB 扩展
pg_hba_rules:
- {user: dbuser_view , db: all ,addr: infra ,auth: pwd ,title: 'allow grafana access'}
node_crontab: [ '00 01 * * * postgres /pg/bin/pg-backup full' ]
# OrioleDB 专用配置
pg_mode: oriole # OrioleDB 模式
pg_packages: [ orioledb, pgsql-common ] # 安装 OrioleDB 内核
pg_libs: 'orioledb, pg_stat_statements, auto_explain'
vars:
version: v4.0.0
admin_ip: 10.10.10.10
region: default
infra_portal:
home : { domain: i.pigsty }
nodename_overwrite: false
node_repo_modules: node,infra,pgsql
node_tune: oltp
pg_version: 17 # OrioleDB 基于 PostgreSQL 17
pg_conf: oltp.yml
#----------------------------------------------#
# PASSWORD
#----------------------------------------------#
grafana_admin_password: pigsty
grafana_view_password: DBUser.Viewer
pg_admin_password: DBUser.DBA
pg_monitor_password: DBUser.Monitor
pg_replication_password: DBUser.Replicator
patroni_password: Patroni.API
haproxy_admin_password: pigsty
minio_secret_key: S3User.MinIO
etcd_root_password: Etcd.Root
配置解读
oriole 模板使用 OrioleDB 存储引擎,从根本上解决 PostgreSQL 表膨胀问题。
关键特性:
- 无膨胀设计:使用 UNDO 日志而非多版本并发控制 (MVCC)
- 无需 VACUUM:消除 autovacuum 带来的性能抖动
- 行级 WAL:更高效的日志记录和复制
- 压缩存储:内置数据压缩,减少存储空间
适用场景:
- 高频更新的 OLTP 工作负载
- 对写入延迟敏感的应用
- 需要稳定响应时间(消除 VACUUM 影响)
- 大表频繁更新导致膨胀的场景
使用方法:
-- 创建使用 OrioleDB 存储的表
CREATE TABLE orders (
id SERIAL PRIMARY KEY,
customer_id INT,
amount DECIMAL(10,2)
) USING orioledb;
-- 对现有表无法直接转换,需要重建
注意事项:
- OrioleDB 基于 PostgreSQL 17
- 需要将
orioledb添加到shared_preload_libraries - 部分 PostgreSQL 特性可能不完全支持
- 不支持 ARM64 架构