title: Microservices resource management
body: <p>Assume we have a group microsericervices (each service has its own DB ). Our clients are other companies. Each client wants to have his own database. </p>
  
  <p>In this case we have many databases for each service. Is exist best practice for managemnt resources?</p>
  
  <p>I think that all services can be stateless. And any company (our client) must have its own config with resources description. Example: DB, files storage and etc. </p>
  
  <p>Calling any serivce must activate the resource context. And all next services must work using this context.</p>
  
  <p>Example. 
  Someone open in his browser site: clientCompany.com.
  Our first service (example AuthenticationService) check this config and found host name "clientCompany.com" in section "hosts". 
  Then it activate this context and whole chain of services use storage, DB and other resources from this context.</p>
  
  <p>Resource config:</p>
  
  <pre><code>[  
     {  
        "contextName":"ClientCompanyName",
        "hosts":[  
           "clientCompany.com",
           "client-company.com"
        ],
        "storage":{  
           "path":"/mnt/ClientCompanyName"
        },
        .....
     },
     .....
  ]
  </code></pre>
  
  <p>Is this a good practice?
  I'm interested in the possibilities of creating such a system using Java and Spring?
  Please share links to sources and tools for implementing this task.
  And tell what do you think about such implementation?</p>