0
votes

I currently use MySQL as a persistent data store and I'd like to introduce data grid layer between my application and MySQL to handle database outages. I'd like to do it as non-invasively to the current application structure as possible.

Apache Ignite is shipped with two features related to my problem: write-behind caching strategy with 3rd party persistence and custom JDBC driver.

I would like to combine these two features as follows:

  • the application will use Ignite JDBC driver to persist data.
  • Ignite will query/update data in memory and will asynchronously flush data to the MySQL database (write-behind caching strategy).
  • when MySQL becomes unavailable Ignite will batch the updates until MySQL restores and will still serve queries/updates without affecting the client app.

Is this setup possible with only configuration changes like replacing the DataSource implementation and configuring the Ignite cache?

1

1 Answers

1
votes

I don't think that 3-rd point is available from out of the box.The CacheStore implementation (for example, CacheJdbcPojoStore) assumes that connection to the underlying database is reliable and can be established at any time. The write-behind mechanism works in the same way, i.e. it can establish a connection when the internal buffer is overflowed, a timeout occurs, the back-pressure mechanism is triggered.

Thus, you have to implement your own CacheStore, which takes care of the accumulation of data, while the MySQL database is disabled for some reason.

Perhaps, the following links will be helpful: