How are structure caches build and emptied?

User 773d472e7f

15-05-2013 08:46:40

We have build on a Linux server a remote 15 million compound MySQL database. If I make a structure search using ICJ a local cache of ca. 3.6 GB is created before I can make searches. These searches are then fast, but building the local cache takes a night.


This does not make sense to me that a local cache is needed to make a search on a remote database. What do I do wrong?


How does this work with the caches?


When is the structure cache build on the remote system?


When is it emptied on the remote system. Can one avoid emptying it?


When is it rebuild on the remote system.


When is the structure cache build on the local system?


When is it emptied on the local system. Can one avoid emptying it?


When is it rebuild on the local system.


Alex

ChemAxon 2bdd02d1e5

16-05-2013 13:22:26

I can't answer all your questions. But I'll try at least few of them.


From what I know, structure cache is build on local system in IJC, which is only on local machine. This is not true if JChem Cartridge on Oracle server is used.


IJC uses permanent cache registration. There is a timeout set to 24hours, so if there is no queriying (or updating/inserting) activity in IJC for that amount of time, the registration to the cache is lost. Then I suppose cache has to be rebuild completely.
[1] http://www.chemaxon.com/jchem/doc/dev/java/intro/index.html#cachereg


Structure cache is incrementaly updated when you edit your data. It does not need to be rebuild completely.
[2] http://www.chemaxon.com/jchem/doc/dev/dbconcepts/index.html#structurecache


Also the cache is always rebuild when your restart IJC.


Well, 15 Mio coumpound is quite a lot for MySQL as a remote database. I would recommend to use our solution for Oracle, JChem Cartridge. It is run on the server as an application server and the structure cache is build in JChem server only for the first search after the server is started. Then searching in IJC is immediate.


I'm sorry for not complete answers. My knowledge of JChem caching is limited. I'll forward your questions to the JChem developers, they could add some more details.


Filip

User 773d472e7f

16-05-2013 16:07:56

First thanks Filip for trying to answer.


Before we use ORACLE on the Internet provider's system , we would like to see if we could avoid another license fee for ORACLE. Once we are in production, we will access the MySQL system only via web services. We plan to update the system not more than once in a month.


The major remaining questions are:


Are there any timeouts for the cache on the MySQL system?


Why would I build a local cache if I do a remote search on MySQL with IJC?


Alex


--------


This is what I understand from your anwer:



When is the structure cache build on the remote system? - The same is true for Oracle and MySQL - the structure cache is build in JChem server only for the first search after the server is started.


When is the structure cache rebuild on the remote system. - On restart of the JChem server.


When is it emptied on the remote system. Can one avoid emptying it? - On stopping the JChem server.


When is the structure cache build on the local system? - When starting a search on the local system, and it seems also when starting a search on a remote system.


When is it emptied on the local system. Can one avoid emptying it? - After 24hrs the cache is not accessible any more. The memory is not released from the system.


When is it rebuild on the local system. - Each time one starts ICJ and starts a search.

ChemAxon aa7c50abf8

16-05-2013 16:46:29

Why would I build a local cache if I do a remote search on MySQL with IJC?

As a desktop application, IJC doesn't do remote searches. It locally searches the local cache. All the remoting IJC does in this configuration consists of building, and keepig up-to-date, the local cache from a remote source.


Peter

ChemAxon aa7c50abf8

17-05-2013 12:12:21

Are there any timeouts for the cache on the MySQL system?

If a given IJC desktop instance is inactive for more than 24 hours, the cache registration associated with the instance will be invalidated.


Peter

ChemAxon aa7c50abf8

17-05-2013 12:24:42

When is the structure cache build on the remote system? - The same is true for Oracle and MySQL - the structure cache is build in JChem server only for the first search after the server is started.

Incorrect. When IJC connects as a desktop application, it builds a local structure cache and searches locally against this local cache.  AFAIK, currently the only option for using IJC with "remote searches" is the connecting it to JChem Cartridge -- as Filip mentioned. (I think IJC may be used in mixed mode, meaning that one IJC instance may be able to search both locally and using JChem Cartridge. Not sure how relevant this is, though...)



When is the structure cache rebuild on the remote system. - On restart of the JChem server.

Incorrect. See above.


When is it emptied on the remote system. Can one avoid emptying it? - On stopping the JChem server.

Incorrect. See above.


When is the structure cache build on the local system? - When starting a search on the local system, and it seems also when starting a search on a remote system.

Incorrect. IJC, as a desktop applicatoin, searches only locally.


When is it emptied on the local system. Can one avoid emptying it? - After 24hrs the cache is not accessible any more. The memory is not released from the system.

Broadly correct.


When is it rebuild on the local system. - Each time one starts ICJ and starts a search. 

For the first time an IJC instance searches in a table, the chemical index data is cached for the table. If the IJC instance has enough memory, all the searched tables can be held in the cache. If it doesn't, caching the chemical index data of a table may result in evicting the chemical index data of the least recently used table from the cache.


Peter


User 773d472e7f

17-05-2013 16:43:05

back to the question: How is the cache build on the remote system?


Remember, we want to use webservices for searching the MySQL database on Linux. We started with IJC trying to test what is going on on the remote system.Obviously, this was the wrong approach. We were not aware about the big difference between the Oracle and MySQL installation. We used IJC to access remotely the Oracle installation.


The programmer has tested the MySQL system programatically, but all what he gets back so far is the number of hits. He has not programmed more.The first time he searched it took more than 3 hrs. We don't know how long it took, he let it run overnight. This seemed to me slow for building the cache. My local system with Derby is faster.


I wanted to help testing, but I am only a user. Is there an out-of-the box GUI with which I could test the MySQL system on the Linux server.


Alex

ChemAxon aa7c50abf8

17-05-2013 18:10:18

Moved to the approprıate forum.

User 773d472e7f

22-05-2013 16:57:42

Is the cache rebuilt each time, or is it stored on disk and then loaded in RAM?


Alex

ChemAxon e07e2a364b

27-05-2013 07:49:42

Hi Alex, 


    Which product you using actually? The "new" webservices does not destroy the JChem Base cache. (Actually, cache is a bit missleading, becuase it is an in-memory copy of fingerprints). We use real caches for queries and those are expire in 5 mins.


    Respect to your earlier question: If you are an enduser, I would recommend to use Plexus (it is based on JChem Web Serivces, so you can experiment the WS behavior).