kafgres
kafgres : Kafka protocol broker embedded in PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 9440 | kafgres | kafgres | 0.3.0 |
SIM | Elastic-2.0 | Rust |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-- | No | Yes | Yes | Yes | no | no |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.3.0 |
18 17 16 15 14 | kafgres |
- |
| RPM | PIGSTY | 0.3.0 |
18 17 16 15 14 | kafgres_$v |
- |
| DEB | PIGSTY | 0.3.0 |
18 17 16 15 14 | postgresql-$v-kafgres |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| el8.aarch64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| el9.x86_64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| el9.aarch64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| el10.x86_64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| el10.aarch64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| d12.x86_64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| d12.aarch64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| d13.x86_64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| d13.aarch64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| u22.x86_64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| u22.aarch64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| u24.x86_64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| u24.aarch64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| u26.x86_64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
| u26.aarch64 | N/A | N/A | PIGSTY 0.3.0 | N/A | N/A |
Source
github.com/RayElg/kafgres
kafgres-0.3.0.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
Sources:
kafgres embeds a Kafka protocol broker in PostgreSQL. Upstream release 0.3.0 builds and tests PostgreSQL 13–18. It needs superuser installation, shared preload and a restart. Its license is Elastic License 2.0.
Enable the broker
Kafka clients connect to the configured broker port. SQL production participates in the caller’s transaction. Configure TLS, authentication and ACLs before exposing the listener beyond a trusted local environment.
Storage and CDC
kafgres.storage_engine defaults to segment; its log uses separate files and requires the extension’s replication and archive procedures. Configure kafgres.segment_archive_command and monitor kafgres_archive_status() before relying on segment retention and recovery. Ordinary PostgreSQL WAL/PITR does not cover the entire segment log. The table engine keeps its log in PostgreSQL tables; changing engines does not migrate existing records.
CDC additionally requires wal_level = logical; some PostgreSQL builds also require an output_plugin_libraries allowlist. Version 0.3.0 supports SQL CDC mappings with projection and filtering. Review the mapping and recovery procedures before deployment; the tagged CI matrix and release artifacts cover PostgreSQL 13–18.
Durability Settings
Version 0.3.0 defaults kafgres.fsync_before_ack to on and kafgres.relaxed_produce_commit to off. Relaxing the first can lose acknowledged segment records on a power failure; relaxing the second can lose the newest idempotent-producer state after a crash and permit duplicates after retries. These settings have narrower scope than transactional SQL production and do not apply uniformly to the table engine. Preserve the strict defaults until the durability tradeoff is deliberate.
0.3.0 Upgrade
Install the matching 0.3.0 library, restart, then run ALTER EXTENSION kafgres UPDATE in the broker database. The SQL update restricts administrative-function grants and pins the producer search path. The first segment-engine start removes old-format timestamp indexes from 0.2.0; old segments remain readable by scanning, while new segments receive current indexes.