web services - Ideas on sync between iPhone and website -


I have to sync an iPhone app with the website using a webservice, the sync process I'm using , It is the following:

  1. Send items which need to be synchronized to the website from the iPhone
  2. Add items to the website MySQL database
  3. IOS Send items that need to be synced from the website from
  4. Add items to the iPhone SQL database

This is done on a server using a request. Users often have some items (& lt; 20) to sync, but sometimes the user can have up to 2000 items to sync. Adding 2000 items to a MySQL database can take some time. I am using the transaction and I am committed to the website on adding items, something like this:

  mysqlTransaction.BeginTransaction (); The forehand item is sent from iPhone {mysql.CommandText = // Sql query mysql.ExecuteNonQuery; } MysqlTransaction.Commit ();  

Sometimes when there are so many things to add to a user, it can take longer than a long time. So my idea is to change the sync process a bit and instead of using a larger request, I divide the requests into sections, possibly sending and receiving 50 items at a time. This will cause faster requests, what are your thoughts on this? How do you solve it? Is this the right thing to use the transaction and commit to the server?

I will try to update "from server to iPhone" and "from server to iPhone" if possible So concurrent and asynchronous This way the sync will be faster and the iPhone app will not wait to complete the entire process.

In addition to splitting the updates into frames, if the update is bigger than a given size, then it is a good idea.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -