Search code examples
ignite

Read Through and Write Through in Ignite


The read through means that if the cache is missed, then Ignite will automatically get down to the underlying db(or persistent store) to load the corresponding data.

If there are new data inserted into the underlying db table, then I do a query like select * from persons against the cache,will the cache get down to load the newly inserted data from the db table automatically?

It looks to me that the answer is no. I think The cache is missed here means when performing something like cache.get(key), and if it returns null,then it will goes down to the underlying db to load the data, and the read through won't work for other cases like sql query?


Solution

  • Your understanding is correct. For read-through you need to know set of keys to load in advance, which is not possible when running SQL query. For SQL you need all data be loaded in memory prior to query execution.