Architecting RESTful app ... out of ... Java Web app
Our current Web Application Architecture consists of following :
Java 6, JBOss 5, MySQL 5.6
Presentation Layer (ZK Framework)
Delegate + Service + DAO Layers (Spring & Hibernate)
Packaging : Single War file containing all the above layers
Business Requirement :
Create mobile app for few modules of above mentioned web application, using HTML5 and Native iOS library.The mobile app would be able to perform CRUD, download/upload files and send emails.
Question :
We are in the process to determine the architecture for the above business requirement. Keeping in mind the following attributes
Data Logic sharing (Implemented in DAO layer using Hibernate)
Business Logic sharing (Implemented in Service layer using Spring)
QoS - Performance, Scalability
Some of our thoughts :
Create a separate delegate layer within the web app and expose it as a REST API. The underlying, objects of service and DAO layer can be used as it is.
Create a common project (Jar) for common functionalities, and share it with 2 different project, one for web app, and the other for mobile-app.
I would really appreciate any advice/opinion about the above.
Thanks
In my opinion, you should сonsider using of the MQ systems (RabbitMQ eg) and split your app in 3 layers:
This is what you described in 2nd option. But i think it would be better to have intermediate layer (MQ) to avoid coupling.
I think Hibernate needs to be configured with distributed 2nd level cache (EhCache eg), to make backend scalable.
With this architecture you can simple scale throughput of your app by adding backend server and subscribing it on queue in MQ.
上一篇: 如何将文本追加到Java中的现有文件