How to sync offline data?

i tried working with mysql database using @Taifun mysql tutorial and it was wonderful. What i am facing problem with is.
I need to upload almost 100 entries a day all within an hour or less.
So it will be difficult to send data to online server for every entry.
If there is any way we can save the data in any offline database and can sync it with online database when we wish to (or when we provide the data connection to app).

Local database Sqllite wirh tour database MySQL. Maybe using component network.

1 Like

@Rogerio_Rios not finding a way/ process to send data from sqlite to mysql from kodular or any app inventor fork. Searched a lot online but no outcome. Any way or tutorial u can suggets?

Its not like that when network connection is open
The data gets automatically sync… No it can’t.
U have to set queries
And probably u may need to set a loop
That can get data one by one and start saving in mysql… So its not easy as u r thinking
I advice u to directly upload it to mysql bcz its not a long process it may take just a few seconds depending upon your network

Use web component as advised by @Rogerio_Rios and then set your procedures /queries to achieve this

1 Like

100 entries per day? Little. All connected? So there is no need to create this offline routine.

As @Zia_Choudhary said, it is not a small job. Check if you have a connection to see if you record online or offline If it is recording offline, take the relevant data (if the offline database is deleted at the end of the routine we will not need filtering to upload the data) and have it inserted in the online database … and some more treatments in the routine.

1 Like

A note: these software are converters. They transform one type of database into another. I have one that I developed that turns DBF (type of tables) into MySQL. In this case above, we need to take the data from the database offline to the other database (online).

Converter DBF to MySQL

Edit
In addition to creating another database with the same structure as the original, I also take the data (converters do that).

1 Like

Yes that’s why i removed that part of my post

1 Like

@Zia_Choudhary i may need to run individual query everytime i need to incert a record into online mysql database… what i want to achieve is to save individual entry in offline database and when the work is finished or when i get the data connection then to sync the offline db with the cloud mysql db… is there any possible way?

1 Like

yes there is first check connection with web component connection block
if its true then use slect query to get data from sqlite and set a loop that after getting data starts inserting in online database
after when data is stored for one query in mysql successfuly then the loop starts again and this continues until all the data gets uploaded in mysql

just give it a try and if you found some issues or stuck somewhere then post your blocks here we will be heliping you.

I already explained about this:
Check if you have a connection to see if you record online or offline If it is recording offline, take the relevant data (if the offline database is deleted at the end of the routine we will not need filtering to upload the data) and have it inserted in the online database … and some more treatments in the routine.

1 Like

We already understood from the beginning. This is already known.

  • if there is no connection
    ---- record offline
  • if you have a connection
    ----- record online
  • if you click sync button…

Could you please let me know how this is done? I know how to update, delete and read from google sheets. I also know how to store and read from tiny db. I also learned how to sync with airtable but if you could please show me how this is done I will be very greatful.
Thank you

1 Like

@userx.
You will have to use SQL commands to insert, update, delete and select data in the SQLite Database.