Desktop and cloud system integration

Asked

Viewed 128 times

1

I have a desktop system where I need to send some data to the service Firebase of Google. I would like an idea of what would be the best way to send this data to the Firebase, and it can sometimes happen that there is no internet connection.

A brief explanation of what will be integrated is the following:
A customer registration where if a customer happens to be registered or changed the same should be sent to Firebase.

So far what I’ve been able to imagine is this::

  1. Create a table in the local "queue" BD where it will store the data to be sent;
  2. If you have an internet connection, send the queue data to Firebase;
  3. Getting positive response from Firebase the queue table is emptied, otherwise keep the data in the queue until there is connection available;

1 answer

0


Good evening, I also think it is a good exit this yours, even because, if you do not have internet connection at the moment I see no other way to send the data instantly. I have some similar systems and Apps, although I don’t use Google’s Firebase but remote Mysql on an Amazon Cloud. In my case, an example of an Android APP, there is a synchronization to the database through a Webservice that I developed and that makes the uploads and loads the information on mobile in case of active connection keeping it always updated, however, in places where there is no internet connection it stores in a local "table" and makes the subsequent sending, through an Android service that is running in the background, all in a transparent way to the user. For me it works well, including, I have developed Pdvs with fiscal integration with a similar principle for tax data transmission.

For creating records in the database works perfectly for me like this.

One precaution you should take is to change the registration by two or more users at the same time without it being updated on one or both Pcs, if your system is multi-user. I agreed to this, in a certain way, by putting a field with the latest version of the registry edition in the database and whether when sending to the server, the APP checks if it is the same as the one loaded on the phone before the change and if it is not sent a message to the user asking if he wants to subscribe or not. But that would solve for me, it might not solve for you, it all depends on the need and functionality of the system that is creating.

  • Good morning, in case this service on android running in the background is all the time doing connection check to send the data?

  • Good morning. In my case, as it is a mobile phone I do persistent verification through the JNI.Network of Android itself that can be implemented by Delphi. I made a simple method that first checks for data to be updated and then triggers the check, if it has no data, it does nothing. In your case, I believe you’ll have to check if you have data to update and if you do, then check the internet, perhaps using a timer with a few minutes interval. I would use a thread to sync in another process and not lock the application at the time of checking.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.