aws-greengrass-nucleus icon indicating copy to clipboard operation
aws-greengrass-nucleus copied to clipboard

com.aws.greengrass.mqttclient.spool: New persistent storage spooler(s) : sqlite spool / filespool

Open kris-sum opened this issue 4 years ago • 14 comments

Feature Description Add new spoolers with persistent storage - either sqlite spool or a filesystem spool. These would be drop-in replacements for the InMemorySpool.

Use Case Where greengrass devices operate in conditions where they may be offline without network access for long periods of time (days, weeks) the InMemorySpool may not be sufficient for storing proxied IoT MQTT messages. Additionally, large MQTT messages will quickly fill up the default size of the InMemoryPool even when offline for short periods of time.

Proposed Solution A basic filesystem spool would be the simplest to write, with each message stored as a file. But persisting many small messages could potentially fill up available inodes and have poor throughput performance. An sqlite database spool would allow persistent storage to a single datastore.sqlite file, but with more CPU overhead.

The sqlite spool would be my preferred implementation.

Some limits should still be enforced on the persistent spoolers - potentially

  • maxNumberOfMessages
  • maxSizeOnDisk (harder to evalute for sqlite?)

Other Would this be something that the AWS team would work on internally / would you accept a PR if we implemented the feature?

  • [x] :wave: I may be able to implement this feature request

kris-sum avatar Jan 22 '21 10:01 kris-sum

Hi Kris, This feature is definitely on our roadmap. I don't have an ETA for you right now, but we're certainly aware of the case and we'll work to address it soon.

MikeDombo avatar Jan 22 '21 18:01 MikeDombo

That's great :)

We'll be needing this for production in the next 6 months so we might start coding this and raise a PR, unless you know it'll be addressed before then.

kris-sum avatar Jan 26 '21 11:01 kris-sum

@MikeDombo Sorry to chase this up, but is there a rough roadmap ETA? (and would you accept a PR for it?)

kris-sum avatar Mar 15 '21 14:03 kris-sum

Yes we would consider a PR for this feature. I cannot share any ETA at this time, sorry.

MikeDombo avatar Mar 15 '21 16:03 MikeDombo

We also need this feature. Would you now be able to share an ETA, by any chance? :)

plafer avatar Jul 27 '21 21:07 plafer

@plafer No, sorry I do not have any ETA to share at this time.

MikeDombo avatar Jul 27 '21 21:07 MikeDombo

@kris-sum Do you have any developments to share regarding this topic? This is a very useful feature i believe :) and the only workaround i found by far is using MQTT bridge (like in this training https://catalog.us-east-1.prod.workshops.aws/v2/workshops/5ecc2416-f956-4273-b729-d0d30556013f/en-US/chapter6-mqtt-broker). As far as i see, Mosquitto broker has persistent option to write to the disk https://pagefault.blog/2020/02/05/how-to-set-up-persistent-storage-for-mosquitto-mqtt-broker/#:~:text=The%20persistent%20storage%20in%20Mosquitto,true%20in%20the%20Mosquitto%20configuration.&text=If%20true%2C%20connection%2C%20subscription%20and,the%20location%20dictated%20by%20persistence_location. But that looks way harder than native spooler configuration

TamoshaytisV avatar Jan 26 '22 16:01 TamoshaytisV

@TamoshaytisV This is quite far down on my work backlog :( Hopefully someone else will be able to implement this!

kris-sum avatar Jan 27 '22 13:01 kris-sum

Hi @MikeDombo - has there been any progress or updates on this at all?

tim-davenport avatar Mar 02 '22 09:03 tim-davenport

Hi Tim, sorry but there are no updates here. We'll keep this issue updated for when work begins.

MikeDombo avatar Mar 02 '22 13:03 MikeDombo

+1 to this being very useful. Since it's been a few months @kris-sum / @MikeDombo / anyone have an update here? I like the idea of a sqlite db with a max # of rows / size. Thank you :)

dflatow avatar Sep 23 '22 13:09 dflatow

Does it worth mentioning this PR here? https://github.com/aws-greengrass/aws-greengrass-nucleus/pull/1277 However, i don't understand what is persistence spool plugin and where to find it to read about

vladas-tamosaitis-tfs avatar Oct 03 '22 09:10 vladas-tamosaitis-tfs

+1 to this being very useful. Since it's been a few months @kris-sum / @MikeDombo / anyone have an update here? I like the idea of a sqlite db with a max # of rows / size. Thank you :)

Feature is still in our roadmap, no major updates or an ETA as of now, we'll keep this thread posted

Does it worth mentioning this PR here? #1277 However, i don't understand what is persistence spool plugin and where to find it to read about

There's no documentation currently--when the feature is released, we'll update this thread with the new docs

jcosentino11 avatar Oct 05 '22 00:10 jcosentino11

+1 to this being very useful. Since it's been a few months @kris-sum / @MikeDombo / anyone have an update here? I like the idea of a sqlite db with a max # of rows / size. Thank you :)

Feature is still in our roadmap, no major updates or an ETA as of now, we'll keep this thread posted

Does it worth mentioning this PR here? #1277 However, i don't understand what is persistence spool plugin and where to find it to read about

There's no documentation currently--when the feature is released, we'll update this thread with the new docs

Thanks for the update :)

dflatow avatar Oct 20 '22 17:10 dflatow

Hey @jcosentino11! Any updates here? Sorry for the bother, but we're doing some development planning dependent on whether this would happen soon or not. Thank you so much!

dflatow avatar Mar 27 '23 16:03 dflatow

We're hoping to get to this in the coming months, but cannot provide any ETA or guarantees at this time. This issue will be updated when there is more to share.

MikeDombo avatar Mar 27 '23 16:03 MikeDombo

Thank you @MikeDombo

dflatow avatar Mar 27 '23 16:03 dflatow

So happy to see that the spooler persistence feature is being merged into nucleus main! When is the next release?

MartinLoeper avatar May 19 '23 17:05 MartinLoeper

So happy to see that the spooler persistence feature is being merged into nucleus main! When is the next release?

The change in nucleus allows discovery of the plugin---we're actively developing the plugin itself. I can't provide a specific release date but it's an active project, stay tuned :) Thanks for your patience!

jcosentino11 avatar May 19 '23 17:05 jcosentino11

Where can we keep tabs on the development of the plugin itself @jcosentino11 ? Thank you

dflatow avatar May 22 '23 16:05 dflatow

There will be a repo once it's open source, but until then we'll keep this thread updated

jcosentino11 avatar May 22 '23 16:05 jcosentino11

Thanks!

On Mon, May 22, 2023 at 9:24 AM Joseph Cosentino @.***> wrote:

There will be a repo once it's open source, but until then we'll keep this thread updated

— Reply to this email directly, view it on GitHub https://github.com/aws-greengrass/aws-greengrass-nucleus/issues/825#issuecomment-1557532043, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKCHIZDSLR2N4XQKP25P43XHOHLJANCNFSM4WOIHF3Q . You are receiving this because you commented.Message ID: @.***>

dflatow avatar May 22 '23 18:05 dflatow

happy to announce the release of aws.greengrass.DiskSpooler https://docs.aws.amazon.com/greengrass/v2/developerguide/disk-spooler-component.html! (requires nucleus 2.11.0)

jcosentino11 avatar Jun 29 '23 17:06 jcosentino11