Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Need Suggestions to implement custom API to expose assets and metadata for third Party Portal

Avatar

Level 4

I have to create  one API which will provide dam assets [I am using dynamic media to expose assets] along with metadata to third party systems [assuming pagination will be there at both ends and will get max 50 assets in one call] . Let's say there is a huge load of concurrent users on a third party portal where my API is used , just want to know if anything needs to be done for caching or make my API optimized.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Anoop_Garg 

Sitemap generator is one of the example where sitemap generator by scheduler. https://experienceleague.adobe.com/docs/experience-manager-learn/sites/seo/sitemaps.html?lang=en 

For memory cache you can use ACS Commons or guava cache https://www.linkedin.com/pulse/enhancing-aem-performance-http-cache-acs-commons-divanshu-goyal/  



Arun Patidar

View solution in original post

6 Replies

Avatar

Level 5

Hi Anoop,

 

There are lot of things that you can keep in your mind while designing and developing your APIs. Some of the important once are

: CDN based caching (it will allow the data to load faster)

: Use of Load Balancing tool 

: Compress responses to reduce transfer time

: Abuse Prevention - The best way to avoid these problems is to implement a rate-limiting strategy. By measuring the number of transactions per second, per IP address, or token (if each client is authorized before accessing the API), you can cut off API clients that make excessive requests and prevent DDoS-like slowdowns from accidentals.

: Perform load test of APIs on tools such as  Jmeter, webLoad

: Code optimization

Here are some useful articles on the same:

https://prismic.io/blog/api-response-times

https://loadninja.com/articles/optimize-api-performance/

 

Avatar

Community Advisor

Hi Anoop

   You will be serving meta data from publishers and binary from dynamic media?

 

Thanks

Dipti

Avatar

Level 4

Thanks Dipti !

Yes,  assets from Dynamic Media and Metadata from Publisher instance. 

 

Third party portal is looking

  1. API having dynamic media URL of assets along with metadata for render
  2. API to perform search operations on metadata
  3. Assets download API- This can be manageable either using dynamic media or AEM download service.

Looking for pointers to design in more optimized and performance oriented.

 

Note: User don't want to use asset share commons portal. 

Avatar

Community Advisor

Hi @Anoop_Garg 
Addition to @poojac35931336 's response :

During off-peak hours, consider pre-generating responses and then caching them, either in memory cache or JCR, for complete sets of asset JSONs.



Arun Patidar

Avatar

Correct answer by
Community Advisor

Hi @Anoop_Garg 

Sitemap generator is one of the example where sitemap generator by scheduler. https://experienceleague.adobe.com/docs/experience-manager-learn/sites/seo/sitemaps.html?lang=en 

For memory cache you can use ACS Commons or guava cache https://www.linkedin.com/pulse/enhancing-aem-performance-http-cache-acs-commons-divanshu-goyal/  



Arun Patidar