2 ms·
Good point about sequence IDs. Another, mroe recent method that's bound to be more foolproof is to track the actual transaction log. Postgres exposes an API fo
by lobster_johnson 10y ago
Good point about sequence IDs.
Another, mroe recent method that's bound to be more foolproof is to track the actual transaction log. Postgres exposes an API for "logical decoding" of said log. The downside is that it's fairly new, Postgres-specific, and I also suspect it puts more burden on the client, which has to interpret the entries and determine if/how they should be indexed. But in theory it gives you a completely data-loss-proof, application-independent way of streaming changes from Postgres.
- ngrilly 10y agoI agree, using PostgreSQL logical decoding is a good solution. MySQL can do something similar using a replication stream (https://github.com/siddontang/go-mysql-elasticsearch https://github.com/siddontang/go-mysql-elasticsearch) and MongoDB by tailing the oplog.