I have an application in which I have a database using SQLite and an external service using MySQL. Basically it is a task application, in which I can create a task in offline mode . When the user owns internet it will already automatically send to MySQL.
I have to do the synchronization treatment and I can not resolve this.
USER 1
- Create a task
- Synchronize the task with external bank
USER 2
- Check for foreign bank jobs
- Synchronize tasks
Problem
After user 2 completes his / her task, he / she must synchronize again with MySQL, and then user 1 (USER 1) must also receive this update in his / her database.
In the simplest possible way, the tables would be:
tbl_task in SQLite
- internal_id ----------- (unique identifier for internal control)
- task_name ---------- (task name)
- status --------------- (status of completion of the pending / done task)
- user_id ----------- (user who will perform the task)
- author_id ------------- (user creating the task)
- external_id ----------- (external identifier if you have already synched)
tbl_task in MySQL
- id ------------------- (unique identifier)
- task_name ---------- (name of the task to be performed)
- status --------------- (status of completion of the pending / done task)
- user_id ----------- (user who will perform the task)
- author_id ------------- (user creating the task)
My initial idea would be to create a column in the table with the name SYNC
, in which I would have control if it was synchronized or not. But after USER 2 finishes a task, how will USER 1 verify this?