891
Views
6
Comments
Solved
Common database in web and mobile app
Question

Does anyone have an example of using a common database in both a web app and a mobile app? I need to know how to have a web app (or mobile app) update the server database so the updated data is available to the mobile app (or web app).

2020-02-28 09-46-54
Eduardo Jauch
Solution

Hello Jae,

Just to add some explanation to what was already told.

You can share many things between mobile and web applications. The limitation is User Interfaces, as both are worked differently under the hood.

But not visual elements, like server side Entities, can be made Public and shared with any module (web or mobile).
This way, you can have your entities being updated through the wewb application and you can use them directly in your mobile.

Usually the entities are in their own modules (and even own applications), for the sake of architecture, like in the example Vera showed.

Cheers.

UserImage.jpg
Anand Das

Eduardo Jauch wrote:

Hello Jae,

Just to add some explanation to what was already told.

You can share many things between mobile and web applications. The limitation is User Interfaces, as both are worked differently under the hood.

But not visual elements, like server side Entities, can be made Public and shared with any module (web or mobile).
This way, you can have your entities being updated through the wewb application and you can use them directly in your mobile.

Usually the entities are in their own modules (and even own applications), for the sake of architecture, like in the example Vera showed.

Cheers.

Hii Eduardo,
Vera suggested to use db as shared component service, but my question is  can I access my web app's  entity in mobile app. Like i have 2 custom entities for web app, now i have made mobile app for same thing.
So is it possible to use the same db ?    Considering i have initially not designed db as shared component service ?


UserImage.jpg
Davidk

It's just a question of refreshing data when you feel it's required.  When I walked through the OS Tutorial for creating a Web and Mobile app I used my own MySQL database via an External Connection.  Both applications consuming and updating the same MySQL tables.

2021-05-05 07-35-47
Vera Tiago
Staff

Hi Jae

If you search for "Directory" in the Forge, you'll find 3 components: EmployeeServices(a shared component that implements core Employee data model and logic services), DirectoryMobile (that consumes EmployeeServices) and DirectoryWeb (that consumes EmployeeServices as well).

So, basically, you have two apps, mobile and web, that connects to the same DB (EmployeeServices) - you can install them on your server and check how the logic is implemented. 

(Note: DirectoryMobile also works offline, as it loads all contacts and synchronizes changes when connected).


Hope that helps :)

Vera


2020-02-28 09-46-54
Eduardo Jauch
Solution

Hello Jae,

Just to add some explanation to what was already told.

You can share many things between mobile and web applications. The limitation is User Interfaces, as both are worked differently under the hood.

But not visual elements, like server side Entities, can be made Public and shared with any module (web or mobile).
This way, you can have your entities being updated through the wewb application and you can use them directly in your mobile.

Usually the entities are in their own modules (and even own applications), for the sake of architecture, like in the example Vera showed.

Cheers.

UserImage.jpg
Anand Das

Eduardo Jauch wrote:

Hello Jae,

Just to add some explanation to what was already told.

You can share many things between mobile and web applications. The limitation is User Interfaces, as both are worked differently under the hood.

But not visual elements, like server side Entities, can be made Public and shared with any module (web or mobile).
This way, you can have your entities being updated through the wewb application and you can use them directly in your mobile.

Usually the entities are in their own modules (and even own applications), for the sake of architecture, like in the example Vera showed.

Cheers.

Hii Eduardo,
Vera suggested to use db as shared component service, but my question is  can I access my web app's  entity in mobile app. Like i have 2 custom entities for web app, now i have made mobile app for same thing.
So is it possible to use the same db ?    Considering i have initially not designed db as shared component service ?


2018-03-07 17-26-51
Jae Evans

Thanks all. I got it to work and it was very simple. Thanks again for pointing me in the right direction.

2020-02-28 09-46-54
Eduardo Jauch

Hi Anand,

The answer is yes. Basically, everything "server side", like entities and server actions, that can be shared, can be used in Mobile.

:)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.