Hi,
We have a requirement wherein we have to call 3-4 REST Web Services on a single page. It's bound to hit by performance issue owning to the number of service calls. Is there any workaround possible for this situation ?
Thanks in advance
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
As already written, you can move the problem to the clientside and do the calls from there. Otherwise you can try to execute these backend calls in parallel on the server side if they are not dependent on each other.
But this is not an AEM (not even Java) specific question, but a rather generic one.
kind regards,
Jörg
You can code your own Restful service within an OSGi service. Make the 3-4 Restful calls and pass back to the client page. The client page can display the results.
Views
Replies
Total Likes
You can cache the webservice responses either in AEM or use a reverse proxy like varnish for this. You can set ttls like every few hours clear the cache and refetch..
You can run these services in author once and push to publish as nodes. This depends on the type of data.
Views
Replies
Total Likes
You can try below options to improve the performance.
Views
Replies
Total Likes
Hi,
As already written, you can move the problem to the clientside and do the calls from there. Otherwise you can try to execute these backend calls in parallel on the server side if they are not dependent on each other.
But this is not an AEM (not even Java) specific question, but a rather generic one.
kind regards,
Jörg
Thanks for your response Jörg and I agree with you that it is not AEM. But the reason why I put it into AEM was because the questions were being raised on AEM here at my workplace. People were of the opinion that AEM was not good for the dynamic stuff and I found that argument silly. I was wondering if there is a certain way that AEM community can show me and I can come up with the best possible solution. Just one quick question. How do I execute backend calls in parallel on server side ?
Views
Replies
Total Likes
Thanks for your response. Unfortunately that's not an option since there is a separate back end team for this.
Views
Replies
Total Likes
Interesting. Do you have any examples of this, any document or any tutorial.
Thanks.
Views
Replies
Total Likes
Hi,
Well, as said, this is a generic question, and my answer to it would be "use Java futures and an executor service"; on my first search I've found [1].
To the statement "AEM is not good for dynamic stuff": It highly depends, how you did "dynamic stuff" in the past. In the AEM world you don't have technologies like spring and hibernate in the first place, but different technologies. And in the developer training you are told how you leverage the AEM technology stack to implement an authorable site. You are not told in these trainings how to build a highly dynamic site, that's true. But it's totally possible and also not that hard. You still have Java, you have at least a servlet engine, an OSGI container, a content repository plus lot of other stuff. You still can build dynamic sites, just the technology piece might be a bit different from what you used to work with. But the architecture of AEM does not prevent you from doing it.
kind regards,
Jörg
[1] http://www.vogella.com/tutorials/JavaConcurrency/article.html#futures
Views
Replies
Total Likes
I did some research on the whole Dynamic stuff and I found Single Page Application to be suitable for that. AngularJS looks like to be the most suitable JS framework but being a Java developer it is not something that I can be expert at. Are you able to provide any insights into SPA approach on AEM.
Thanks
Views
Replies
Total Likes
Based on the suggestions if we consider even to have parallel processing on the server side still the client has to wait for the process to complete and the page is not going to available until then. Having the process in backend makes sense if there is more processing that needs to be done after the service response.The problem here is that the client should not wait or see a blank screen until the data is ready for display. In my opinion this needs to be done in a two step process using lazy loading from the client side. The same parallel processing can be done having each component making the calls via AngularJS or JQuery(ajax) to the services. The backend services servers should be capable of processing these requests in parallel and each component can start displaying the data without dependency on other services. As I have mentioned earlier the dispatcher can be used to cache these responses as needed to improve performance as required.
Views
Replies
Total Likes