I would suggest writing a small jar (or even raw WSGI ... But it's probably easier to use Flask, as it will be easier to get up and running quickly) an application that loads the genome database, then provides a simple API. Something like that:
app = Flask(__name__) database = load_database() @app.route('/get_genomes') def get_genomes(): return database.all_genomes() app.run(debug=True)
Or, you know, something more reasonable.
Also, if you need to process multiple requests at a time (I believe that app.run will only process one at a time), start streaming ... And if it's too slow, you can os.fork() after the database loads and launches several request handlers from there (thus, they will all share the same database in memory).
source share