Access static lookup data from javax REST service

103 Views Asked by At

I have a javax rest service that needs to retrieve data from an object database. Additionally, it always needs to perform a lookup in a table (key is a string, value is an integer). There are 250 values in the lookup table, which I am currently accessing and choosing from, using a "normal" database query. The values never change, so access can be purely read-only based.

What would be the fastest way to achieve this lookup ? I thought of either a static map that belongs to the service's class (hard-coded) or a file on the server's file system. I must admit that I don't fully understand the memory allocation model (static/non-static) when the rest service is invoked, and to what extent things like the static keyword have an influence on, or override things - which, I suppose, would have an impact on what the ideal tradeoff between speed and memory consumption is.

0

There are 0 best solutions below