title: Best place to keep secure information in java spring web application
body: <p>I have web application implemented using java spring.Basically each user in application can store some critical information. Once user enters that data , it should be persisted .Is there any standard way to store that secure information. I can think of following places to store that information</p>
  
  <pre><code>1) In database
  2) On Webserver as different files for each user. We can encrypt data in those files using some key.
  </code></pre>
  
  <p>I prefer for webserver as files for each user.But I have following questions:</p>
  
  <pre><code>1) Where can we store those files on webserver
  2) How can we restrict access to those files?
  3) Is there something available in spring to achieve this?
  4) What kind of encryption library I can use to achieve this. And where I can store key for each user.
  5) How we can sync those files on multiple instances. Is there some standard library for this also?
  </code></pre>