title: Improve Authorization flow for common wallet belonging to multiple users
body: <p>I have an implementation where I have one wallet (wallet per client/company) and a number of users belonging to one wallet.
  I have hundreds of API calls per second for Authorization from users. When I get authorization API calls from users and following activities are done,</p>
  <ul>
  <li><p>Lock the wallet belonging to the current user.</p>
  </li>
  <li><p>Make sure validation rules are passed.</p>
  </li>
  <li><p>Wallet has sufficient balance for the transaction to be successful.</p>
  </li>
  <li><p>Update wallet balance.</p>
  </li>
  <li><p>Unlock the wallet belonging to the current user.</p>
  </li>
  </ul>
  <p>There are other calculations, and updates on different tables as well and the total time taken could be anywhere between 500 to 1000 milliseconds.</p>
  <p>This works fine when we have fewer users per wallet and fewer simultaneous calls per second from users, belonging to one wallet.</p>
  <p>How can I scale this architecture or changes to this implementation so that I can support hundreds of requests per second belonging to the same wallet?
  The issue is when I have lots of requests per second because of the lock on the wallet requests will be in the queue and they will timeout.</p>
  <p>I was reading about event-based systems but here every auth call is sync API call, so not sure how to adapt to event-based architecture.</p>