Can anyone please elaborate which is the faster way of fetching data. Fetching it from the database directly or fetching it from a List?
Suppose, in a java web application some data need to be operated on which are in databas, and they are also in a list and saved in a session or context. Now when the user sends a request it send some parameter as well, now on the basis of that parameter some data need to be fetched, which are in the list or in the database. As the application is a multi user application there will be lots of request coming towards the server, so interacting with database for each request is not seem like a good option, and fetching it from the list seems like a slow way.