Skip to content

Commit 14d5ac5

Browse files
authored
chore: improve readme (#44)
1 parent 19c8aab commit 14d5ac5

2 files changed

Lines changed: 81 additions & 13 deletions

File tree

README.md

Lines changed: 73 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,88 @@
1-
<div align="center">
1+
<p align="center">
22
<img src="docs/media/logo.png" alt="Postgres Stream" width="300">
3+
</p>
34

4-
# Postgres Stream
5+
<h1 align="center">Postgres Stream</h1>
6+
7+
<p align="center">
58
Reliably stream Postgres table changes to external systems with automatic failover and zero event loss.
9+
</p>
610

7-
[Documentation](https://pg-stream.dev/)
8-
</div>
11+
## What is Postgres Stream?
912

13+
Postgres Stream captures changes from your Postgres tables and delivers them to external systems like Kafka, RabbitMQ, Redis, Webhooks, and cloud services. It uses Postgres native logical replication and stores events durably in the database itself.
1014

11-
## Features
15+
## Key Features
1216

1317
- **Single binary** - No complex infrastructure or high-availability destinations required
1418
- **Postgres-native durability** - Events are stored in the database, WAL can be released immediately
1519
- **Zero data loss** - As long as downtime is less than partition retention (7 days by default)
1620
- **Automatic recovery** - Handles both sink failures and slot invalidation without operator intervention
1721

22+
## How It Works
23+
24+
Events are inserted into the `pgstream.events` table and streamed via logical replication to your sink.
25+
26+
**Two ways to create events:**
27+
28+
1. **Subscriptions** (optional) - Define triggers that automatically capture table changes
29+
2. **Manual inserts** - Insert directly into `pgstream.events` from your application or database functions
30+
31+
## Trade-offs
32+
33+
While Postgres Stream provides strong durability guarantees, there are some considerations:
34+
35+
- **Small overhead** - Additional INSERT into `events` table on every subscribed operation
36+
- **Partition management** - Monitor partition growth if event volume is very high
37+
- **Not for dynamic subscriptions** - Each subscription change recreates database triggers
38+
39+
## Supported Sinks
40+
41+
| Sink | Use Case |
42+
|------|----------|
43+
| [Kafka](https://pg-stream.dev/sinks/kafka) | High-throughput event streaming |
44+
| [NATS](https://pg-stream.dev/sinks/nats) | Lightweight pub/sub messaging |
45+
| [RabbitMQ](https://pg-stream.dev/sinks/rabbitmq) | Enterprise message broker |
46+
| [Redis Strings](https://pg-stream.dev/sinks/redis-strings) | Key-value caching |
47+
| [Redis Streams](https://pg-stream.dev/sinks/redis-streams) | Append-only event log |
48+
| [Webhook](https://pg-stream.dev/sinks/webhook) | HTTP POST delivery |
49+
| [AWS SQS](https://pg-stream.dev/sinks/sqs) | Managed queue service |
50+
| [AWS SNS](https://pg-stream.dev/sinks/sns) | Managed pub/sub service |
51+
| [AWS Kinesis](https://pg-stream.dev/sinks/kinesis) | Real-time data streaming |
52+
| [GCP Pub/Sub](https://pg-stream.dev/sinks/gcp-pubsub) | Google Cloud messaging |
53+
| [Elasticsearch](https://pg-stream.dev/sinks/elasticsearch) | Search indexing |
54+
| [Meilisearch](https://pg-stream.dev/sinks/meilisearch) | Search indexing |
55+
56+
## Quick Start
57+
58+
```yaml
59+
# config.yaml
60+
stream:
61+
id: 1
62+
pg_connection:
63+
host: localhost
64+
port: 5432
65+
name: mydb
66+
username: postgres
67+
password: postgres
68+
tls:
69+
enabled: false
70+
batch:
71+
max_size: 1000
72+
max_fill_secs: 5
73+
74+
sink:
75+
type: kafka
76+
brokers: localhost:9092
77+
topic: events
78+
```
79+
80+
```bash
81+
# Run with Docker
82+
docker run -v $(pwd)/config.yaml:/config.yaml \
83+
ghcr.io/psteinroe/postgres-stream:kafka-latest
84+
```
85+
1886
## License
1987

2088
MIT

docs/index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ Events are inserted into the `pgstream.events` table and streamed via logical re
2828
1. **Subscriptions** (optional) - Define triggers that automatically capture table changes
2929
2. **Manual inserts** - Insert directly into `pgstream.events` from your application or database functions
3030

31+
## Trade-offs
32+
33+
While Postgres Stream provides strong durability guarantees, there are some considerations:
34+
35+
- **Small overhead** - Additional INSERT into `events` table on every subscribed operation
36+
- **Partition management** - Monitor partition growth if event volume is very high
37+
- **Not for dynamic subscriptions** - Each subscription change recreates database triggers
38+
3139
## Supported Sinks
3240

3341
| Sink | Use Case |
@@ -75,14 +83,6 @@ docker run -v $(pwd)/config.yaml:/config.yaml \
7583
ghcr.io/psteinroe/postgres-stream:kafka-latest
7684
```
7785

78-
## Trade-offs
79-
80-
While Postgres Stream provides strong durability guarantees, there are some considerations:
81-
82-
- **Small overhead** - Additional INSERT into `events` table on every subscribed operation
83-
- **Partition management** - Monitor partition growth if event volume is very high
84-
- **Not for dynamic subscriptions** - Each subscription change recreates database triggers
85-
8686
## Next Steps
8787

8888
- [Getting Started](getting-started.md) - Set up your first stream

0 commit comments

Comments
 (0)