guys, I am running into an issue. I am working on a project which is a mobile application on react native and its backend is on AWS dynamodb. The mobile application is a sort of uber model. Where the user raises a request for a car mechanic and the admin panel will search is there any driver available within a specific distance and the admin panel will assign a mechanic to the user. The problem when the users raise a request there are rest APIs that trigger a lambda function and the request is then saved to dynamodb. Another rest API for the admin panel to check is there any request available in the database. Admin panel needs to call that rest API after every 5 seconds to check any update in a database which is costing a lot and I think it's not an appropriate way. So I need a solution whenever there is an updation in the database admin panel immediately knows the update either user create a request or delete it any help would be appreciated
CodePudding user response:
Rather than AWS or any REST or DB, your problem statement is around right architecture. How to sync data with mobile application on changes at the backend is the better problem statement. Assuming I got it right, you have these solutions:
Send a push notification from backend every time data is available. Let mobile app do an API call to fetch the data
Implement Polling. Periodically call the APIs to check if data is available or not
Implement something like XMPP or sockets in your application which transfers the data as soon as it's available on the other side of pipe
Implement Firebase Realtime Database. It sync the data to mobile devices without you doing https://firebase.google.com/docs/database
