Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

How to get external data from DB into AEM

Avatar

Level 1

Hi,

 

The requirement is that there is some data that is stored in traditional database, but they doesn't want to expose this data through APIs. Instead, they can give this data as a file or as a feed process. What are the different ways this can get into AEM. For example I have a component which displays vehicle information(as authored), but the price details has to come from the database. Please let me know in your experience how this can be handled.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@jayan_acharya76 You can connect to DB directly from AEM, please check out this documentation[1]. Once you connect to db, you can read and create necessary nodes in AEM and read it through sightly/model and by using services. 

In your case you have mentioned the dynamic part of content which is pricing, for that i would not use this approach since the pricing could be very dynamic. Please check SSI [2]. or API from DB side would be a better approach.

 

[1]https://docs.mktossl.com/docs/experience-manager-learn/cloud-service/networking/examples/sql-datasou...

[2] https://medium.com/tech-learnings/sling-dynamic-include-deep-dive-dynamically-include-page-component...

 

 

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

@jayan_acharya76 You can connect to DB directly from AEM, please check out this documentation[1]. Once you connect to db, you can read and create necessary nodes in AEM and read it through sightly/model and by using services. 

In your case you have mentioned the dynamic part of content which is pricing, for that i would not use this approach since the pricing could be very dynamic. Please check SSI [2]. or API from DB side would be a better approach.

 

[1]https://docs.mktossl.com/docs/experience-manager-learn/cloud-service/networking/examples/sql-datasou...

[2] https://medium.com/tech-learnings/sling-dynamic-include-deep-dive-dynamically-include-page-component...

 

 

Avatar

Community Advisor

Hello @jayan_acharya76 

 

One approach is to connect DB directly, as suggested by @Saravanan_Dharmaraj .

 

Incase, that isn't allowed you can use the file. Sharing link of a discussion where an excel is processed to stores information in /var nodes. 

Solved: Re: Is there a technical solution to import an Exc... - Adobe Experience League Community - ...


Aanchal Sikka

Avatar

Administrator

@jayan_acharya76 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni

Avatar

Community Advisor

Another alternative could be to periodically synchronize the file containing the necessary information with AEM to a fixed location. You (or someone else) will manage the process of generating a file with the required information from the DB in AEM, which will be made available to be imported into AEM. There are multiple ways to import the file into AEM, so the choice depends on various factors, such as network capabilities, infrastructure, security policies, and more. Once you have that file in AEM, you can easily process it as needed and when needed. Again, there's a wide variety of options available, including creating a node structure, converting it into a different format, consuming it directly, and more.



Esteban Bustamante