lightningstream icon indicating copy to clipboard operation
lightningstream copied to clipboard

Proposal: Sync notifications adapter

Open Zetanova opened this issue 1 year ago • 4 comments

The current Simpleblob interface for the storage backend can be paired with an Simplenotify interface.

The new interface could abstract away the current S3 storage_poll_interval mechanism and maybe extended later by a MQTT implementation.

This would make it possible that the producer would publish the URI of the new snapshot to mqtt and the consuming nodes would use the URI (can be presigned) to get the new snapshot.

Zetanova avatar Jan 07 '25 11:01 Zetanova

AWS S3 and MinIO support 'bucket event' notifications already, which can be delivered in a variety of ways. It might be better to leverage that instead of creating a mechanism that risks inconsistency with the actual storage.

kpfleming avatar Jan 07 '25 11:01 kpfleming

Storj does not and even witht he bucket event feature from aws or minio, LS does not utilize it.

Zetanova avatar Jan 07 '25 11:01 Zetanova

What a dedicated pub-sub call would enable is to use the FileStorage backend.

LN could use the FileStorage backend and to drop the snapshots without any changes to the current implementation into a directory and then generate an URL provided with with an simple template from the config.

The directory could be a public folder of a webserver like apache secured with basic-auth and the url could include the auth args. The receiver could then simple use it to directly download the snapshot over a http-get.

Zetanova avatar Jan 09 '25 14:01 Zetanova

I think this is the best way to go because listing S3 every second racks up a lot of cost without much benefit. Bucket notifications are way cheaper and a lot easier on the backend. I don't think it would be difficult to throw together a small PR that does this.

cholcombe973 avatar Oct 16 '25 03:10 cholcombe973