For retrieve from database , microflow or nanoflow ?

0
Hello,   Retreive from database can be performed on nanoflow and microflow. As nanoflow works on client side and microflow works on server side. Both interacts with database. For only activity of retrieve, which one is preferred 
asked
2 answers
0

Hi Sarang,

Nanoflows are designed with offline-first applications in mind, as they allow you to model application logic that works in offline apps.

Therefore it is recommended to use nanoflows where no connection is needed .

Yes indeed you can perform a retrieve from database in the nanoflow but it will not be as per  best practice suggested by Mendix and also will generate a database connection similar to microflow.

In these scenarios I would suggest to think about below questions:

1)  Do you want the local In-memory objects and do not want to perform following actions :
 

  • Create
  • Commit
  • Retrieve
  • Rollback

    For example changing the object or performing a custom JavaScript action on the page 

    You can go with a nanoflow !

2.If you need the database objects and want to commit the change then you can go for Microflows.

3. If you need to have a nanoflow for some custom page action  and also a retrieve or any action with database , try to combine such activity in sub-microflow called from a nanoflow on logic need basis as per best practice .

For use case and impact on usage of different flows , you can try to see the below document as well.

https://docs.mendix.com/refguide/nanoflows/#2-when-to-use-nanoflows

answered
0

Hi,

If you want to retrieve data from the database use the microflow retrieve. As nanoflows run in the client thus you would need to call a microflow in a nanoflow to retrieve data from the database.

answered