Hi, Perhaps broadcast state is natural fit for this scenario. https://ci.apache.org/projects/flink/flink-docs-release-1.12/dev/stream/state/broadcast_state.html
Thanks, Selvaraj C On Fri, 22 Jan 2021 at 8:45 PM, Kumar Bolar, Harshith <hk...@arity.com> wrote: > Hi all, > > The external database consists of a set of rules for each key, these rules > should be applied on each stream element in the Flink job. Because it is > very expensive to make a DB call for each element and retrieve the rules, I > want to fetch the rules from the database at initialization and store it in > a local cache. > > When rules are updated in the external database, a status change event is > published to the Flink job which should be used to fetch the rules and > refresh this cache. > > What is the best way to achieve what I've described? I looked into keyed > state but initializing all keys and refreshing the keys on update doesn't > seem possible. > > Thanks, > > Harshith > -- Regards, Selvaraj C