Domanda

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.

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.

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?

Thanks

È stato utile?

Soluzione

The second approach is commonly called 3-tier or n-tier architecture. There are many benefits chief among them being scalability (by distributing the API module on many servers or even cloud), caching, centralised update and version management, security etc. In many companies the database is firewalled from client machines and you cannot even connect to it.
The issues are more system complexity, more components to develop and support etc. You should google on N-tier architecture for more details and judge if it suitable for you.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top