Getting data from ERP in mobile APP how to do it properly? - javascript

I’m building an app and I need to communicate with the ERP that uses webservices and is most of the time reliable.
My backend is a Graphql api I’m wondering how should I get the data from ERP?
The options I’m considering:
Fetch the data from ERP on every request from the app and save it to my separate DB.
Create a cron job and copy the data every X time to separate DB.
Create a microservices server and update the data in the queue on every request.
Or is there another solution I’m not seeing?
The problem is that the ERP web services are not as reliable as my separate DB.
Right now I have the 3 packages the backend the server that gets the data from EPR and react native client.

Related

Deploying a Machine Learning Model by developing a web application without sharing the patient data i.e. without sending the data to the server

I have a machine learning model that has been trained using patient data. Now I want to deploy this model via a web application, so that doctors can use it!
I know I can use Flask and Django for this but there is a problem that the patient data should not be sent anywhere because of data privacy.
The patient data entered in the application should only remain on the end user's device as all data processing should be done locally in the application or web browser environment.
I know it is possible to do this with native app. But I want to avoid a native app as much as possible. I would like to have the model as a web page.
Please does anyone have an idea of how I can deploy a Machine Learning Model, so that the data entered by the user for the model to make the prediction also happens on the user's browser? I.e. no server, no anything like that. Everything (Input of new data, Predictions ) has to happen on the end user's device
Thanks in advance

How to pull new data from API using node / electron desktop application?

I'm creating a private desktop application for my Shopify store and was wondering what the best way to continuously pull new order data down from their API? While the application is open do I query the API for new orders at a set interval? Is there a way to use webhooks with a desktop application (not a server)? Any suggestions would be appreciated!
You definitely need a server to receive webhooks, but if you don't want to manage a server, you can use a serverless solution such as Amazon EventBridge.
For example, you can do something like the following:
EventBridge receives your order data through the Shopify webhook.
The order data is added to an SQS queue.
Your desktop app connects to the SQS queue to receive the order data.
Here is a tutorial from Shopify that explains this approach:
https://shopify.dev/tutorials/manage-webhook-events-with-eventbridge

Nodejs GET REST API and frequent access to MongoDb database

I'm implementing a web app using the MERN framework (MongoDB, Express and Node.js for the back-end, React for the front-end).
In a section of my web app, I need to access a collection of the Mongo database very frequently (every 50 ms).
I need to synchronize this data with a video player.
I'd like to know which is the best way to handle this situation.
The options I came up with right now are:
Send a single GET request to the collection and save the whole content of that collection in a variable of the front-end (but I think it's the worst solution, since the size of this collection is 350MB)
Send a GET request every 50 ms
Send a GET request every N seconds based on the current time of the video player, and save the content of the request dynamically in a variable of the front-end
I'm sure there are better ways to handle this situation.
i think correct approach to achieve that is to open sockets in you application as it will poll you server automatically.here is the link socket.io

Push new data from Node REST API to React-Native

Problem
I've created a REST API using Node and a client app using React-Native.
So far I've configured it so the client app makes HTTP requests to the server.
Now I need to push new data from the server to the client as soon as it is available. I need to push different data to the client app depending on which user is logged in.
I haven't done this before and I've been having trouble finding a good solution online, partially because I don't know the correct terminology.
The server will pull the data from an external API, save it to MongoDB via Mongoose. I then need to push the new data to the client
If anyone has any suggestions that would be great!
Environment
Node.js with Express v4.16.4
React-Native v0.58.0-rc.2
Mongoose v5.4.5
Firebase is already installed in the react-native app. I'm proficient with both Mongoose and Firebase so either one could be good for the push queue if applicable.
Thanks!
1. can use socket.io
Server send data to client using Web socket(socket.io).
2. can use firebase push notification.
Server can create new notification to firebase, and client can received signal from firebase, and get data from server via REST api.

Is it possible to load structure and data to angular-storage(or another storage) from a SQLite file from server?

I think what I'm trying to do is very simple, but I'm having a really bad time trying to search this on the internet. I have this populated sqlite db file in my server, and I want to import its structure and data into my web application. This file is generated from another server-side app in a path which is accessible to the web application.
Your web application should access the database with its proper adapter (depending on the language and the framework) and then provide the data to the front-end as a set of services. It strongly depends on the amount of data and its variability whther you want to serialize all the data at application load time, or just to provide data access using several endpoints (by using the sqlite database as the repository for your application models).
It's not much different from a normal web application, provided you don't want to write on the sqlite database and so consider all your models read-only.

Categories

Resources