Ability to watch tables in real-time
Created by: jmealo
Is there any interest in allowing users to subscribe to insert, update and delete events on a given table without triggers or notify/listen?
I'm the creator of Lapidus and have been using it in production since the summer with excellent performance and reliability.
I'll be happy to do a pull request adding this functionality, however, it makes use of logical decoding and streaming replication which require additional configuration:
- Lapidus requires
pg_recvlogical
to be present on the system, it usespg_config
to find the correct location of the binary if it cannot be found on the path - Logical replication must be configured
- A logical decoding plugin must be installed (decoding_json)
- When Massive connects and does it's introspection, it's advisable that it checks for logical replication slots that it created that are inactive and delete them or throw an error or warning when they reach a certain size, it's possible to run out of disk space
- A user with replication permission and the relevant bits in
pg_hba.conf
I think this amount of configuration/complexity is a bit of a turn off for some massive users, and other than making use of introspection to allow filtering of events by primary keys, Lapidus has no dependencies on having a connection to the database (pg_recv_logical
does that part).
I think that it'd be easy enough for introspection to make sure that the server is configured properly and that the provided credentials have replication permissions and provide exact instructions on what files to edit, lines to add or changes to make in order for watch
to be enabled. It could be a skeleton function that throws a helpful error if you try to use it when it's not configured.