简体   繁体   中英

How global state store differ from normal state store in kafka?

How Global State Store differ from normal state store?

Is Global state store has copy of data in all the instance running on different machine? How it behave in case of restart because global state store doesn't use any change-log topic for restore in my scenario the source topic from the global store has no key.

  1. Is Global state store has copy of data in all the instance running on different machine?

    Yes.

  2. How it behave in case of restart because global state store doesn't use any change-log topic for restore in my scenario the source topic from the global store has no key:
    • GlobalKTable disable logging by default so it'll not push changelog to the changelog topic for GlobalKTable (it still creates the changelog topic though). You have to re-populate data to GlobalKTable from an input topic which enables log compaction (cleanup.policy=compact) which message's key is the key you want to lookup in your GlobalKTable . Kafka Stream will just re-populate data from the input topic to GlobalKTable when you restart application.
    • in my scenario the source topic from the global store has no key: you have to map your source topic to the new topic which I mentioned above using a KeyValueMapper, and enable log compaction on the output topic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM