I am building a web application for chemical industry. Its basically searching in database of chemical structures. A lot of cheminformatics calculations is needed and there are many open source solutions to do it written in Java.
I am currently wondering what programming language to use. I need to use some functions in Java and I dont want to write whole system in Java because I am not familiar with writing web apps in it.
So I have this idea to prepare some .jar files with needed functions and use them in PHP through command line. I wonder about scalability of this solution.
Is it fast to call .jar file in PHP for example 1000 times in one cycle?
How long the parameter passed to .jar can be? I assume large arrays converted to string as parameters.
I have doubts if this is a good idea in general and why I sould not do this?
Thank you for your ideas.
It can be done
You mention parameters. I assume you mean command line parameter. You are correct that is probably not scaleable. Instead, use stdin for input and stdout for output.
You mention calling the jar file 1000 times. I assume you mean calling the main method of the jar file. This will be very slow. Instead implement as much as you can in java, so you start the jar file few times per request. A handfull calls could be acceptable. Just not anything in a loop.
Basicly prepare all the data for an entire requuest inside java and print it to stdout which you read from php.
Of course running in a servlet container is faster if you have time to learn jsp+servlet.