title: Increasing speed of rest api
body: <p>I have a set of APIs written in <strong>JERSEY</strong>, and all working fine. 
  Now lets say the API is to be consumed by millions of people with test case of 10 million requests on an URI per second.</p>
  
  <p>So how can I speed up the overall performance and reduce the latency of my API.
  Consider below code as example for most of my APIs</p>
  
  <pre><code>    @GET
      @Path("/path/{id}")
      public Response getUserData(@PathParam("id")final long id){
          chechAuthencticationAndAuthorization();
          Userdetails userDetails = dbDao.getUserDetailsFromId(id);
          return Response.status(200).entity(userDetails).build();
      }
  </code></pre>
  
  <p>how can I speed up database read and writes and over all reponse time to scale up to millions of request per second.</p>