I am new to Mendix and have a similar issue. I am reading all my data from an SAP system via REST calls and so it would seem wrong to store it in a persistent entity. I want a single source of truth and I don’t want to have to clean up persistent entities at the start/end of a process.
I find Mendix state management confusing and I am never sure what is in scope at any one time but my suggestion would be to try to pass in the top level entity into your pages if you can and drill down from there via associations in your screen via data views/list views. That seems to work best for me but I am a beginner too so YMMV!
-Less/no need to synchronize master data between databases (as you already indicated)
-Security: even if someone were to obtain a database snapshot, it would contain a lot less sensitive data :)
-If the API is down, your entire application will be useless as it will depend on the API's for showing data.
-Working with only non-persistent objects causes challenges that might hurt overall development speed. For example, maintaining the (size of the) client state and the inability to use Xpath constraints and/or entity access to filter data.
I am sure there are more, but these are the ones that came to mind first!
Just some thoughts on this:
Be careful with functions that delete objects, since that may still lead to unwanted behavior if someone else in the meantime saved changes using that object.
Not storing your data makes data-integrity more likely, but it is no guarantee. The longer the session takes, the bigger the chance of data-integrity getting violated.
Some nice reading: an old blog post from the time non-persistent entities got introduced in Mendix: https://www.mendix.com/blog/persistence-is-futile.
Build this in Mendix’ latest release Native app. That has some neat tricks that will certainly help you. Even calling services from frontend instead of from the server.
I've seens several systems trying to go completely non-persistent. Some with more success than others.
One major issue these apps have been struggling with is that every search/sort/pagination function can not be done using xpath or database queries. This lead to not using many of the default search/sort/pagination features of datagrids, a lot of custom code and looping through lists in microflows. This often leads to an explosion of complexity.
In one of the apps i have refactored the non-persistent entities to persistent entities for many of those entities. I then used entity access based on owner to hide the data of different users from each other. I'm still not sure if that was the best approach, but it reduced complexity a lot.