deepak parmar
deepak parmar

Reputation: 701

Overhead to using composer-rest-server over JavaScript / Node SDK?

We are trying to figure out best design practice while using hyper-ledger composer. We have following questions :

1) if We are using composer-rest-server, then will have to manage two server side components. i) running composer-rest-server ii) running application which will send request to composer-rest-server to communicate to network.

Isn't it overhead? what additional advantages we are getting by using composer-rest-server? in fact, probably client will have to authenticate two times i guess.

2) If we are using JavaScript SDK, then will have to manage only one server side application, kindly correct me in case of misunderstanding.

3) When i generated angularjs application using yo generator, its also asking me information of composer-rest-server, but I am not planning to use composer-rest-server and want to use 'composer-client' and 'composer-admin' only.

Upvotes: 1

Views: 398

Answers (1)

Dan Selman
Dan Selman

Reputation: 2297

  1. Yes, there will be some overhead of running the composer-rest-server in its own process, however it will allow you to secure and scale your rest servers independent of your application. Depending on your scenario that may be an overhead worth paying.

Another option would be to generate a LoopBack application (using the lb tools) that uses the loopback-connector-composer LoopBack connector directly. This may give you access to the underlying Express server and would allow you to merge your application and the REST server.

  1. You are correct, however you would have to build the REST API for your business network yourself, and manage authentication and certificates.

  2. The generated Angular application uses the REST API exposed by the composer-rest-server to interact with HLF.

Here is a DRAFT topology diagram that I am working on for contribution to the documentation.

DRAFT topology for Hyperledger Composer Solution

Upvotes: 1

Related Questions