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.

  • Will need to scale application, to handle the load of both web app and mobile app !
  • 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.

  • Will Hibernate will be OK , to share the same database with 2 applications, without any concurrency issues ?
  • 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:

  • Frontend - accepts client requests (one for browsers, second for mobile apps etc.) and transmit them to MQ.
  • Intermediate (transport) - MQ system. Transports messages.
  • Backend - accepts inbound messages from MQ, processes request and gives the answer back.
  • 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.

    链接地址: http://www.djcxy.com/p/44050.html

    上一篇: 如何将文本追加到Java中的现有文件

    下一篇: 构建RESTful应用程序...出于... Java Web应用程序