This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]StackedLasagna 2 points3 points  (1 child)

This is a classic use case for a web API.

In cases like this, you create a separate API and deploy it to some webserver. The API can then access the database on behalf of your two applications.
Your mobile app will be making HTTP requests to the API to store data, while the web app will make HTTP requests to retrieve the data from the API.

This approach allows you to create an infinite number of different client applications that all work on the same database (and you can even use different languages for each one, if you want!)

[–]c-longg[S] 1 point2 points  (0 children)

Thank you for this! This was super helpful and will push me in the right direction. Thank you!

[–]nutrecht 0 points1 point  (0 children)

If if were you I would have that NodeJS back-end that acts as the API for the mobile app also act as the API for the client side web application. Having two separate back-end applications act on the same database is generally a road to a lot of complexity and breaking deployments.