title: Direct vs indirect database access
body: <p>I'll take as example the following scenario. A company develops a component A deployed in its clients (this component is located in the client area, and this client may not be trusted by the company). The component needs to access data stored in a database server located in the company area (trusted area).  One of the core modules developed by the company is the data model, using Hibernate as ORM. </p>
  
  <p>One approach is that component A depends directly on the data model module and accesses the database directly (through Hibernate). The second approach is to access the database indirectly, using an intermediary module that interfaces component A and the database server.</p>
  
  <p>Which problems may appear by connecting the component directly to the database server? What are the advantages of using an API? What do you recommend?</p>
  
  <p>Thanks</p>