Hello,

On 3/17/15 3:13 AM, Jay Jayswal wrote:
Hello,
i am GSoC Participant. i am interested in Synchronization Project. 

what i understood is we have to build PHP Scripts which connect to Remote Machine and Synchronize data.
which means same database structure at both end and we are coping each end's new row's to another end. Right?

Yes

i have started with my proposal. i wanted to ask what should be length of proposal? 7 or 8 page is okay or Do i have to make it short?

There's no firm limit on length. I think some of the technical information for this project in particular will require it to be a bit longer than others, but having a proposal that's too short (or too long) is not a disqualifying factor. If we require more information, we can ask for clarification and you'll be able to revise the proposal until the submission deadline.

Actually, i already did something like this in my past project.i can't disclose code because i signed Non-Disclosure Agreement of that company. it was two platform project. web-application(PHP) and Desktop application(C# WPF). data is stored at desktop database(SQLite) locally, so user can view, update, delete data offline. and when internet available, system will run script to synchronize data. 

Sounds like useful experience, provided our Non-Disclosure Agreement doesn't prohibit you from working on this :)

I have faced many problems while solving the problem that i have listed below. can you send me your expected solution for those problem so that i can understand your expectations and project requirement.

Problems:

Insert:


Case 1: insert at DB1

DB1

DB2

Before Synchronization

Step1: Two record with ID 1 & 2 in inserted

Current rows :1,2

Current rows : null

After Synchronization

Current rows :1,2

Two record with ID 1 & 2 in inserted

Current rows :1,2

 









Correct

Case 2: insert at DB2

DB1

DB2

Before Synchronization

Current rows :1,2

Step1: Two record with ID 3 & 4 in inserted

Current rows :1,2,3,4

After Synchronization

Two record with ID 3 & 4 in inserted

Current rows :1,2,3,4

Current rows :1,2,3,4












Correct again

Case 3: Insert at Both DB1&DB2

DB1

DB2

Before Synchronization

Current rows :1,2,3,4

Current rows :1,2,3,4

Step 1: one new record inserted with id 5

Current rows :1,2,3,4,5(of DB1)

Current rows :1,2,3,4

Current rows :1,2,3,4,5(of DB1)

Step 2: one new record inserted with id 5

Current rows :1,2,3,4,5(of DB2)

After Synchronization

 

 

What should happen in this case? If we want to sync this we need some differentiate to identify both DB. 
In my past project I provided Device ID. Means PRIMARY KEY and DEVICE ID both will make Composite Key which make it unique to identify.

What is your preferred solution?













 




This is the difficult solution; my opinion is that in cases like this we must prompt the user for which side is correct.


Update:  in this case we required updated row timestamp, I am assuming there is update_timestamp column in each table



Case 1:  update at DB1

DB1

DB2

Before Synchronization

Step1: updating row with id 1

Current rows :1(updated),2,3,4

Current rows :1(old),2,3,4

After Synchronization

Current rows :1(updated),2,3,4

update row with id 1

Current rows :1(updated),2,3,4











Right

Case 2:  update at DB2

DB1

DB2

Before Synchronization

Current rows :1(updated),2(old),3,4

Step1: updating row with id 2

Current rows :1(updated),2(updated),3,4

After Synchronization

update row with id 2

Current rows :1(updated),2(updated),3,4

Current rows :1(updated),2(updated),3,4

 








Right again



Case 3: update at both side but different timestamp

DB1

DB2

Before Synchronization

Step1: updating row with id 2

Current rows :1,2(updated),3,4

Current rows :1,2(old),3,4

Current rows :1,2(updated),3,4

Step1: updating row with id 2

Current rows :1,2(updated),3,4

After Synchronization (both update is different and timestamp is also different)

 

 

In this case both side update is different, what should be final record. I think I should be last one updated. Right?

What is preferred solution?

 










In this case, I again think we must prompt the user, but we can also provide the information that DB2 is more recent.





Case 4: update at both side but same timestamp

DB1

DB2

Before Synchronization

Step1: updating row with id 2

Current rows :1,2(updated),3,4

Step1: updating row with id 2

Current rows :1,2(updated),3,4

After Synchronization (both update is different but time stamp is same)

 

 

In this case both side update is different and time stamp is same!! So here again we need  DEVICE ID by which we can identify that both update is different.

And what should I store finally, because which one we have to finally store is depends on timestamp, which is SAME for BOTH DB!!! What is preferred solution?

 
















Probably the same as the Insert case where we prompt the user. Note that each time we prompt the user, we should also offer them the option to cancel, synchronize all A to B, and all B to A for other conflicts during this specific run.

Delete:

Case 1: deleted at DB1

DB1

DB2

Before Synchronization

Step1: row with id 3 is deleted.

Current rows :1,2,4

Current rows :1,2,3,4

After Synchronization

In this case row with id 3 will be added at DB1 because for SYSTEM it’s newly added row at DB2.

To handle this problem in my past project I maintained Activity logs. Which stores that row with id 3 is deleted, so when synchronization take place, I fetch logs from activity log and first delete row with ID 3 in DB2.

What is your preferred Solution?

Current rows :1,2,3,4

Current rows :1,2,3,4

 















I think the activity log or some form of that it going to be the only way to do this reliably.



Regards,

Jay Jayswal


Regards
~isaac


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/


_______________________________________________
Phpmyadmin-devel mailing list
Phpmyadmin-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel