Mobile sync with remote sql server

Solarion

Honorary Master
Joined
Nov 14, 2012
Messages
28,051
Reaction score
17,804
So after a few days busting my balls with code I decided to go the replication route.

http://robtiffany.com/simple-mobile-sync-with-sql-server-2012-and-sql-server-compact-episode-i/

I have a local SQL Server Compact Edition database and the idea is that this will sync with the remote SQL Server via the web. One thing though is that I am unable to browse to Sql CE in any way/shape or form (This is the type of shitty problems I run into). In the article he (did you just assume gender :confused:) is able to browse to a management environment for CE. Where I find this thing?
 
Last edited:
Sqlce sync with sql is terrible. In fact, sqlce is terrible. I recommend you ‘sync’ via a webapi that talks to sql server. That way you control access to db. What device are you using?
 
Sqlce sync with sql is terrible. In fact, sqlce is terrible. I recommend you ‘sync’ via a webapi that talks to sql server. That way you control access to db. What device are you using?

I'm using a winform app. Say you want to deploy it on someone's machine that doesn't have or want Sql Server locally. What if connectivity is lost via the webapi or are working off site in a location without any connectivity but they want to be able to keep working on a local copy in the meantime instead of the app just tanking it. I'm experimenting mostly with this to see if it's a possibility or even practical.

To be able to sync the local copy of SqlCE or even SQLite once connectivity is restored. If there is another alternative I'm all ears. I've been looking at the Sync Framework mostly for now.

As I said I don't have to do this but just experiment with this at the moment. If it doesn't come right or is not practical then I'll just pull the plug on it.
 
Last edited:
Well then for the app you use another persistence mechanism. Depends on what type of data. You can use json files if data not too complex. If you need relational then use sqlite or firebird embedded. The latter is excellent. You just deploy the dllls with the app. Then when you sync, you simply post to webapi. I.e. the app works in disconnected fashion. Webapi is stateless. I.e. there is no ‘connection’ that is maintained. The connection is only for the duration of the http call. Or you can run in semi-connected fashion where you select data from webapi and store locally until sync. Just depends on the use case.

Edit: you have to evaluate the likelyhood of the network connection dying and design accordingly. I have done both disconnected apps with sync as well as winforms apps always connected’ via webapi. Disconnected apps do pose problems wrt data integrity and concurrency but you have to design the system for your use case
 
I had a hunch SQLite was the way to go. I just see a lot of people using it.

Or you can run in semi-connected fashion where you select data from webapi and store locally until sync. Just depends on the use case.

Something along those lines sounds great. I think that is what I'm aiming for. I'll do a bit more reading up and put something together, something small for now and come back and post some of my findings and see what you guys think.
 
Top
Sign up to the MyBroadband newsletter
X