DB Web Services provide methods for storing and searching chemical structures in a persistent database, currently in MapDB. MapDB works with collections, but in this documentation the terminology table is used instead of collection .
There are methods provided for
creating / deleting tables
inserting / deleting / modifying structures and data in the tables
executing duplicate, substructure and similarity searches
This documentation describes installation, administration and usage of DB Web Services.
DB Web Services application is available in two modes:
In microservices system mode the DB Web Service runs together with Config service, Discovery service and Gateway service. These three services are mandatory and optionally other services can also be part of the system. All configuration must be done in the Config module.
The default configuration applies to the microservices system mode.
The web application runs on host <server-host> and listens on port <gateway-server-port>.
In standalone web application mode the DB Web Service runs alone, without the Config service, Discovery service and Gateway service (however the installer installs them, as well).
The default configuration must be changed according to the standalone web application mode; set eureka.client.enabled=false
in application.properties file and spring.cloud.config.failFast=false
and spring.cloud.config.uri=
(so to empty) in bootstrap.properties file.
All configuration must be done in the DB module.
The web application runs on host <server-host> and listens on port <server-port>.
See here.
See here
See here.
Module is installed into folder: jws/jws-db
See here.
Additionally, IUPAC naming plugin license is required for the usage of Name file format.
Default configuration:
Performance tuning can be executed by doing some cache related settings. Please use our JChem PostgreSQL Cartridge Xmx Calculator page (take into account that superstructure search is not available) to calculate the appropriate settings.
All properties calculated by the Xmx calculator must be copied into the application.properties file (not into the file specified on the calculator page) and the prefix ' com.chemaxon.jchem.psql' in keys must be substituted with prefix ' com.chemaxon.zetor.settings' like
com.chemaxon.zetor.settings.runtime.label.cachePolicy=DISABLEDcom.chemaxon.zetor.settings.runtime.label.cachedObjectCount=0com.chemaxon.zetor.settings.runtime.molecule.cachePolicy=DISABLEDcom.chemaxon.zetor.settings.runtime.molecule.cachedObjectCount=0com.chemaxon.zetor.settings.runtime.fingerprint.cachedObjectCount=1320000 |
---|
The infix ' .runtime ' in keys is not used from version 19.11 on.
Using version 19.11 or newer, the following configuration may be used:
com.chemaxon.zetor.settings.label.cachePolicy=DISABLEDcom.chemaxon.zetor.settings.label.cachedObjectCount=0com.chemaxon.zetor.settings.molecule.cachePolicy=DISABLEDcom.chemaxon.zetor.settings.molecule.cachedObjectCount=0com.chemaxon.zetor.settings.fingerprint.cachedObjectCount=1320000 |
---|
bootstrap.properties |
---|
spring.cloud.config.failFast=truespring.cloud.config.uri=${CONFIG_SERVER_URI:http\://localhost\:8888/}spring.cloud.config.retry.initialInterval=3000spring.cloud.config.retry.multiplier=1.2spring.cloud.config.retry.maxInterval=60000spring.cloud.config.retry.maxAttempts=100 |
For more settings possibilities see spring documentation page.
HA and load balancing is provided for DB Web Services, for the only stateful web service in JChem Microservices.
Running more instances of the db service ensures HA and load balancing.
In HA mode, Hazelcast is used for distributed caching of the data.
It can be optionally set that all nodes present in the system have their own cache ('Near' cache). By default, near cache is switched on.
Features when near cache is switched on:
quicker structure search
increased memory usage
in the case of data update, the system eventually becomes inconsistent; it can take a few seconds to get back again consistent.
HA mode needs PostgreSQL database installed, user and database created
HA mode must be configure in /jws-config/common-config/application.properties file
Example configuration:
/jws-config/common-config/application.properties |
---|
# This is the default MapDB setting, until postgres does not work: # #com.chemaxon.zetor.settings.indexDir=data/chemical-data/store #com.chemaxon.zetor.settings.scheme=mapdb #com.chemaxon.zetor.settings.forcePurge=true #com.chemaxon.zetor.additional.scheme=mapdb #com.chemaxon.zetor.additional.indexDir=data/extra-data/ #com.chemaxon.zetor.additional.forcePurge=true# Postgres does not work yet. When it does, uncomment the following lines: # com.chemaxon.zetor.settings.indexDir=data/chemical-data/store com.chemaxon.zetor.settings.scheme=crdb com.chemaxon.zetor.settings.forcePurge=true com.chemaxon.zetor.settings.crdb.sqlBuilderProvider=POSTGRESQL com.chemaxon.zetor.settings.crdb.jdbcUrl=jdbc:postgresql://localhost:5432/zetor com.chemaxon.zetor.settings.crdb.user=chemaxon com.chemaxon.zetor.settings.crdb.password=chemaxon com.chemaxon.zetor.additional.scheme=crdb com.chemaxon.zetor.additional.indexDir=data/extra-data/ com.chemaxon.zetor.additional.crdb.sqlBuilderProvider=POSTGRESQL com.chemaxon.zetor.additional.crdb.jdbcUrl=jdbc:postgresql://localhost:5432/zetor com.chemaxon.zetor.additional.crdb.user=chemaxon com.chemaxon.zetor.additional.crdb.password=chemaxon |
Here you find a load balanced example application on GitHub.
Prerequisites in case of microservices system mode:
Config service is running
Discovery service is running
Gateway service is running
Run the service in command line in folder jws/jws-db/ :
jws-db-service --start (on Windows)
jws- db -service start (on Linux)
or
run-jws- db .exe (on Windows)
Find and try out the API on the Swagger UI.
Mode | URL of Swagger UI | default URL of Swagger UI |
---|---|---|
microservices system | <serverhost>:<gateway-port>/jwsdb/API/ | localhost:8080/jwsdb/API/ |
standalone web application mode | <serverhost>:<server-port>/API/ | localhost:8062/API/ |
For detailed description check out the JWS DB demo site:
https://jchem-microservices.chemaxon.com/jwsdb/api/index.html
Follow the guidelines, examples on the Demo site or on the Swagger UI API documentation of your installed module.
DB Web Services provides method for getting the available molecule types.
Every table has a Molecule type: this is a descriptor that is used by the search engine. It contains information about how structures are handled during search. The application has two very simple built in types called: sample (search with aromatization) and taumol (tautomer search).
Table operations
Structure Insert/Delete methods
Duplicate search methods
Substructure search methods
The data apparently stored in tables (collections) are stored in the file system under jws-db/data/ folder. The content of that folder must be stored as backup. Furthermore, the application.properties file(s) also should be saved.