pg_ivm
pg_ivm | mssql-changefeed | |
---|---|---|
19 | 4 | |
774 | 14 | |
9.9% | - | |
6.3 | 6.6 | |
about 1 month ago | 4 months ago | |
C | Go | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pg_ivm
- Postgres is eating the database world
-
What Is Incremental View Maintenance (IVM)?
FTA, because I don't like Jeopardy questions in headlines:
“Incremental View Maintenance (IVM) provides a method for keeping materialized views current by calculating and applying only the incremental changes, as opposed to the complete recomputation of contents performed by the REFRESH MATERIALIZED VIEW command.”
Article shows using the pg_ivm Postgres extension available here: https://github.com/sraoss/pg_ivm
- Pg_ivm: Incremental View Maintenance as a Postgres Extension
- Anyone have experience with incremental materialized views in postgres?
- Incremental View Maintenance for PostgreSQL
-
a temporary-ish table vs materialize view?
There is an extension that provides some limited incremental MVIEW refresh: https://github.com/sraoss/pg_ivm
- Features I'd Like in PostgreSQL
- IVM (Incremental View Maintenance) Implementation as a PostgreSQL Extension
-
Materialized View: SQL Queries on Steroids
There’s awesome work being done on incremental view maintenance in postgres:
https://github.com/sraoss/pg_ivm
-
Should I replace all db select query REST APIs with a single generic router ?
It makes sense to perform managed denormalization - use a materialized view or automatically refresh a table or foreign server (via FDW) using common triggers (like pg_ivm does). And it's fine to add a TTL to it and use as a read store... update on user login and make a partial index just for that. And that's how you could get CQRS...
mssql-changefeed
-
How to Listen to Database Changes Using Postgres Triggers in Elixir
We made mssql-changefeed for this purpose:
https://github.com/vippsas/mssql-changefeed
V1 requires to run a sweeper procedure in the background, but an upcoming v2 version does without the sweep loop. Unfortunately too fresh for readme to be updated, but relevant lines in tests to show it off:
https://github.com/vippsas/mssql-changefeed/blob/v1-lazy/go/...
https://github.com/vippsas/mssql-changefeed/blob/v1-lazy/go/...
https://github.com/vippsas/mssql-changefeed/blob/v1-lazy/go/...
Library itself:
https://github.com/vippsas/mssql-changefeed/blob/v1-lazy/mig...
-
Push-Based Outbox Pattern with Postgres Logical Replication
Not OP, but there is an approach here of using a dedicated loop worker to assign post-commit ID sequence. I.e. using the outbox pattern once, simply to assign a post-commit ID.
https://github.com/vippsas/mssql-changefeed/blob/main/MOTIVA...
I wish DBs had this more built in, it seems a critical feature of a DB these days and the commit log already have very similar sequence numbers internally...
-
The Next Generation of Materialize
We do something similar, but in 2), instead of using the outbox pattern, we make use (in several different settings) of integers that are guaranteed to increment in commit order, then each consumer can track where their cursor is on the feed of changes. This requires some more coordination but it means that publishers of changes don't need one outbox per consumer or similar.
Then you can have "processes" that query for new data in an input table, and update aggregates/derived tables from that simply by "select * ... where ChangeSequenceNumber > @MaxSequenceNumberFromPreviousExecution"...
The idea here implemented for Microsoft SQL for the OLTP case:
https://github.com/vippsas/mssql-changefeed
What are some alternatives?
prawn-stack - A pageview counter using the AWS free tier, Postgres, Node and React
marmot - A distributed SQLite replicator built on top of NATS
materialize - The data warehouse for operational workloads.
supavisor - A cloud-native, multi-tenant Postgres connection pooler.
pg_hint_plan - Extension adding support for optimizer hints in PostgreSQL
pgcat - PostgreSQL pooler with sharding, load balancing and failover support.
contour - Contour is a Kubernetes ingress controller using Envoy proxy.
zeroeventhub
pg_jsonschema - PostgreSQL extension providing JSON Schema validation
rust-postgres - Native PostgreSQL driver for the Rust programming language
OpenLogReplicator - Open Source Oracle database CDC
postgrex_pubsub - A helper to turn postgres mutations into a pubsub channel