I skimmed over the code in the Redis DMC client, and did not see any
place where we could do a MGET there. Not sure if that's relevant to
Nick's use case, but it would be relevant to that general pattern
going forward. It wouldn't be hard to add a bulk get method to the DMC
interface and provide a default interface that just loops and does
multiple get operations and stacks them together. Then the Redis
version could do a MGET and stack them together.

That said, AFAIK we'd need to create a new enrichment process or
extend something like ScriptedTransformRecord to integrate with a DMC.

I have the time to work on this, but would like to hear from
committers and users before I start banging out the code to make sure
I'm not missing something.

On Mon, Mar 7, 2022 at 7:18 AM <[email protected]> wrote:
>
> Redis does allow multiple gets in the one hit with MGET. If you search for 
> all keys the response is an ordered list of matching values, with null in 
> place where there is no match.
>
>
>
> Steve Hindmarch
>
>
>
> From: Nick Lange <[email protected]>
> Sent: 07 March 2022 04:46
> To: [email protected]
> Subject: Records - Best Approach to Enrich Record From Cache
>
>
>
> HI all -
>
>  I have a record set of objects that each need enrichment of about 10/20 
> fields of data from a Redis Cache. In a perfect world, I'd hit the cache once 
> and return a json blob for further extraction  - ideally in a single hop.  I 
> don't see an easy way to do this with the record language, but perhaps I've 
> missed something.
>
>
>
> Lacking any better sophistication, I'm currently doing this brute-force with 
> 10-20 hits to the cache for each field. I'm hoping that the mailing list has 
> better suggestions.
>
>
>
> Thank you
>
> Nick
>
>

Reply via email to