Data from external database - best practice

0
Is there any best practices to be applied when we bring data from external database into Mendix?   I developed a Mendix App that pulls data from a SQL database and display to the user in a datagrid. I'm saving the data coming from SQL in a persistent entitie, just because I think it's easier use data grid with persistent entities, and after the user select the row, I'm calling a microflow to delete the rest of the information from Mendix database. Since it's a lot of data, and everything is already saved in the SQL, it doesn't make sense for me to keep in Mendix DB (not sure if I'm doing correctly).   Initially, I tried to import the data from SQL using non persistent entities, but I started to struggle a bit because when I want to display the data using a datagrid, you only can retrieve information from non persistent entities by association. So I had to use the datagrid datasource as microflow. But when we use datasource as microflow, the data grid controls (e.g. next page, filters, etc...) also don't work as it works with persistent entities, so it requires additional logic to work.   So my questions are:   1. Am I doing wrongly by bringing data from SQL (or any other external database) and saving in persistent entitie, so the user can select which information will be used, and then I'm calling a microflow to delete the rest of the data from Mendix database?   2. Is there any best practice to be shared? Because I know the recommended would be to bring data from external database to non persistent entities, but it's a bit challenge to use data grid with non persistent entities and requires additional logic.
asked
0 answers