The Cloud strategy

Cloud deployment is more popular than ever. Nowadays, most enterprise applications are designed to run either on-premise or in the cloud. You can create an application that offers the same services to different clients, while isolating the client data from each other. There are several motivational factors behind this strategy and one of those is to save licensing costs. This is common when creating Software-as-a-Service (SaaS).

Licensing

In a cloud architecture, you only use and pay for the things that you need. You can create an application that only requires a database, and you don't need content management, image processing, message queuing, or other services. Even if you deploy on-premise, some vendors offer licensing models to enable features only if you pay for them.

Furthermore, some application servers and database vendors charge per instance or even per schema. You can use various techniques to reduce your cost so you don't have to pay the additional fee, one is multi-tenancy, and Hibernate offers the tools to implement it.

Multi-tenancy

When you create an application and offer it as a service, you can deploy it on premise and charge your customers individually, or you can deploy it in the cloud and reduce the cost and maintenance fees for your clients. However, you will still have to isolate the client data from each other.

There are three ways of making a multi-tenant application:

  • One application, multiple databases
  • One application, one database, multiple schemas
  • One application, one database, one schema

The first two are implemented using a multi tenant connection provider, which maintains multiple connection pools for multiple databases, or one connection pool for multiple schemas hosted on the same database. Some database drivers don't support the latter, in which case, you are forced to use multiple connection pools for different schemas on the same database instance.

The last model is implemented in such a way that each table in the schema has a tenant ID associated with it, and Hibernate composes the SQL queries while being aware of the multi-tenant model. This feature is not fully implemented yet but should be available in future releases of Hibernate.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.137.117