We are in the process of redesigning a php app that uses MY SQL and cakephp as the app framework.
- One of the redesign goals is to support a multi-tenant model , where n clients , each with an identical database schema (i.e 1 database per tenant) can use the hosted application.
- Based on the login credentials, the front end (php layer) will make a call to the business layer (EJB/Web Service etc).
- The business layer will then return relevant JSON data that is then rendered by cakephp
- Today all the work is done by cakephp and this model is not scaling well for dynamic changes, suited to an individual tenant.
Questions:
- Is this a good design pattern - i.e have a php frontend serviced by a Java business tier ?
- What are some good candidates for the business tier. We would like to keep it as simple as possible - ideally use Tomcat and not go with a full fledged EJB solution if we can. I envision the business layer to consist of many session bean type of objects.
- Can we get away with a business开发者_如何学Python tier that just serves up JSON via REST Web Services ? There is no transaction beyond - reading a whole bunch of data to render a few pages, lots of AJAX updates , and some non Ajax posts.
- What features in Java EE 6 make this design possible (if any) without Spring/EJB.
- Considering Hibernate/myBatis as ORM in business tier. Solution should seamlessly support this.
All thoughts welcome.. Thanks
Web services will be more interoperable than EJBs. They use HTTP as the protocol; that's what browser based UIs use. If you go with EJBs, which are based on RMI, you'll have to wrap them to accept HTTP requests.
I would prefer a Spring/POJO approach that uses Spring "contract first" web services for the back end services. I greatly prefer Spring to EJB.
I wouldn't jump to Hibernate unless you have a solid object model to map to and the complexity warrants it. I'd bet that straight JDBC or perhaps iBatis would be more than sufficient.
精彩评论