What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello, is there an existing machanism to store a module’s state/config? For example to store a times

s.kroll
s.kroll Posts: 118 🪐 - Explorer
edited February 2020 in Help

Hello, is there an existing machanism to store a module’s state/config? For example to store a timestamp when a process run the last time, or which was the last offset it used to call an external api? So basically a simple (persisted) key-value store for zed?

Comments

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 🧑🏻‍🚀 - Cadet

    I am not sure if I understand your question correctly but from Zed you can access Redis or DB and store whatever you need there.

  • s.kroll
    s.kroll Posts: 118 🪐 - Explorer

    Ok, but there is no ready-to-use mechanism to simply store key-value-datasets, right? So if I want to do this, I have to create an entity, table and stuff do this. I’m asking, because this could be a usefull feature for more than one module and so I hoped that there is already “something” which did this for me.

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 🧑🏻‍🚀 - Cadet

    Excuse for my ignorance but what are key value datasets you are referring to?

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 🧑🏻‍🚀 - Cadet

    if you are referring to something like https://redis.io/commands#set you have no limitation to use that.

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 🧑🏻‍🚀 - Cadet

    If you have a look at StorageClientInterface you can found some of it already available. For example setMulti uses https://redis.io/commands/mset in the background

  • Unknown
    edited February 2020

    i think he just wants to quickly drop something somewhere. but tbh, that sounds like a recipe for abuse, @UM0EZB9GT 😉

  • those values probably have meaning, right? why not wrap it into a business model that represents this meaning?

  • what’s your scenario?

  • s.kroll
    s.kroll Posts: 118 🪐 - Explorer

    Hey Marco, the sceanario would be to store an offset/state for an incremental importer which continuously checks an external API if theres is something new. If so, it does the import and saves the new offset to ask for in the next round. All I need to store in this case is a simple Integer so I thought there might be an existing mechanism for this like a simple persisted key/value-storage

  • s.kroll
    s.kroll Posts: 118 🪐 - Explorer

    @UKHD8KTMF I also thought about the redis, but somehow I think the redis is not the right place to store this kind of information.