Best practices for a multi-app architecture

0
Hello Mendix Community, Our team is planning a significant architectural shift. We are moving from a single application to a multi-app landscape, with the core goal of improving scalability, maintainability, and reusability of our components.   For example, we might have a "Core" app for shared data, and then other apps for specific business areas like "Manufacturing" or "Quality." The biggest challenge we see is how to keep the data consistent between all these new apps. For instance, if a customer's details are updated in the "Core" app, all other apps need to see that change.   We are trying to decide between using OData or building our own REST services to share data between the apps. We would love to get some advice from the community.   Here are our main questions: Is this a good idea? Has anyone else split a large application like this? We would be pleased to hear about your experience, including any problems you faced. How to keep data in sync? What is the best way to handle updates? For example, if an object is deleted in one app, how do you make sure it's also removed from the others? When to use OData vs. REST? Our initial idea is to use REST when special logic (like a microflow) needs to run after a data change. For simple data sharing, OData seems easier. However, we are worried that relying heavily on REST for every update might be slow and impact performance. Is this a valid concern, and is this the right way to think about it? How to build the pages? We're looking for the practical approach to handling our front-end. The "ideal" architectural solution seems to be rebuilding all our pages to fetch data directly via APIs, but the required development effort would be enormous for our team. A much more achievable path is to sync the data locally and adapt our existing pages. How common is this "local sync" pattern in real-world Mendix projects? Are we making a reasonable trade-off, or are there critical downsides we're not seeing? How to filter OData? We are worried that using OData will mean we have to download all the data from an entity, which could be very inefficient. Is there a way to filter the data and only get what we need? For example, can we get just the "Customers" from a specific city, instead of all customers? Are there any examples? Are there any good tutorials, blog posts, or example projects that show the best practices to build a multi-app solution in Mendix?   Any advice or examples would be a great help. Thanks in advance  
asked
2 answers
1

Hello Adrian Żyła,

 

The best way to find out is to try it out in small, in use case like yours i would advice to use OData this is cleanest way to do it and does a lot of the synchronisation by itself. 

With mendix you can easily consume and publish odata, so i really think this is the way to go for you.

 

Hope this helps,

 

Good luck

answered
1

We are in process of building our solution using multi-app architecture.  AS of now , we are successful in  running few apps and implemented different strategies , depending on the situations. 

 

OData as external entities (data hub) allows you to expose data from one app to another without replicating the data in full. You essentially get a "view" or "read-only" access to the shared entity in the other app.  You can treat them as regular entities in the domain model and build pages , have associations ,etc. ( there are certain restrictions though on the owners) . It should be manageable.  This is pretty simple to do. 

 

We use REST API , in certain situations. 

 

OData is internally as API call . 

 

When dealing with high-volume data (such as in batch processes), making API calls for each record or set of data can be inefficient. Replicate the customer info in the app that you are running the batch process.  By syncing shared data into the app running the batch process before initiating the batch logic, you can avoid the performance hit of frequent API calls.

 

When you split into multiple apps , try to limit dependency across apps. 

 

 

 

answered