Ignite and RDMS integration in client mode

205 views Asked by At

I am using https://apacheignite-mix.readme.io/v1.7/docs/automatic-persistence to load data from database into Ignite cache.

I run my code with Ignite client mode, and want to load the data into Ignite Cluster.

It looks that I have to put my user code jar and dependent jars into $IGNITE_HOME/libs to make my code work?

I would ask:

  1. Did I do the right thing to put these jars to $IGNITE_HOME/libs to make my code work?
  2. If I have to put my jars into $IGNITE_HOME/libs, it looks that if I have more tables need to be loaded after I have loaded some tables into the cache, should I have to shutdown the cluster and restart for the server to load these new classes? If so, then the data in the cache will be lost since they reside in memory,and have to reload?
1

There are 1 answers

3
Valentin Kulichenko On BEST ANSWER

There are two ways to load the data, through IgniteDataStreamer and through CacheStore implementation. See this page for details: https://apacheignite.readme.io/docs/data-loading

In case of IgniteDataStreamer you will load the data from DB on the client and stream it into the cluster. In this case you don't need to add any classes to server classpath.

In case of CacheStore you will load data from DB on server side. In this case you need to explicitly deploy (add to libs folder) the implementation of the CacheStore and anything it depends on. If you're using Automatic Persistence, the implementation is already there and nothing to deploy as well.

You're never required to have model classes on server classpath and you can dynamically change the schema without cluster restart. See this page for more information: https://apacheignite.readme.io/docs/binary-marshaller