title: Kafka persistent statestore vs in memory state store
body: <p>We are facing an issue where we are using kafka persistent state store and its often runs out of space (8gb) so we are thinking of moving to in memory state store</p>
  
  <blockquote>
    <p>Stores.persistenKeyValueStore("name");</p>
  </blockquote>
  
  <p>To</p>
  
  <blockquote>
    <p>Stores.inMemoryKeyValueStore("name");</p>
  </blockquote>
  
  <p>Just have few question if we change to in memory</p>
  
  <ol>
  <li>Do we loose any data in case of broker/consumer restart?</li>
  <li>How does consumer get the previous data in case the old data from memory is flushed, does it get that data from broker?</li>
  <li>If it may fetch the data from broker is it not a performance impact as its a network call rather than fetching the data locally in case of persistent state store.</li>
  </ol>
  
  <p>Is there any other disadvantage of switching to in memory.</p>
  
  <p>Please note that we have streaming applications (KTable) and have around 2M unique messages.</p>
  
  <p>Size of each msg would be around 2kb
  Frequency 500msg/sec avg</p>