<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Steve Lasker's Web Log - www.SteveLasker.com/Blog : Microsoft Synchronization Platform</title><link>http://blogs.msdn.com/stevelasker/archive/tags/Microsoft+Synchronization+Platform/default.aspx</link><description>Tags: Microsoft Synchronization Platform</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Evolution or Revolution for moving to offline architectures</title><link>http://blogs.msdn.com/stevelasker/archive/2008/10/18/evolution-or-revolution-for-moving-to-offline-architectures.aspx</link><pubDate>Sat, 18 Oct 2008 03:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9003995</guid><dc:creator>Steve.Lasker</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/stevelasker/comments/9003995.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevelasker/commentrss.aspx?PostID=9003995</wfw:commentRss><description>&lt;P&gt;There's been a lot of talk, momentum and questioning for where and how occasionally connected designs fit into the application landscape.&amp;nbsp; There have been a lot of questions for "if and how" developers can take their existing apps "offline".&amp;nbsp; There have been a number of efforts for enabling offline apps and some longer term plans.&amp;nbsp; In VS 2008 (Orcas) we introduced Sync Services for ADO.NET as a developer focused way to synchronize data.&amp;nbsp; The roadmap continues with the Microsoft Sync Framework releases.&amp;nbsp; We've started to show "Astoria Offline" as a means to enable sync over REST based HTTP protocols enabling more generic services.&amp;nbsp; But do any of these "solve the problem".&amp;nbsp; It's been a while since I've done a brain dump on some thoughts related to the evolution vs. revolution of app models, so what better way to dump thoughts than a blogicle.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Can you take your current app and make it offline?&lt;BR&gt;&lt;/B&gt;The reality is "it depends".&amp;nbsp; There are so many app designs, it's hard to say definitely what works and what doesn't.&amp;nbsp; There are some well established things that have worked and haven't, but it's not fair to say these apply 100% of the time.&amp;nbsp; One size doesn't fit all.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Intercept/fall back&lt;BR&gt;&lt;/B&gt;Do you go with the intercept model?&amp;nbsp; When online and connected, the app communicates directly to the service.&amp;nbsp; (Note I'm using "service" here to represent any remote source.&amp;nbsp; It could be a database "service" a Web Service, a WCF service, or some other API that's only available when your device is connected to "the network").&amp;nbsp; When the network falls away, the app &lt;B&gt;"falls back"&lt;/B&gt; to a local "cache".&lt;/P&gt;
&lt;P&gt;This is generally a bad (opinion), or complicated (fact) model.&amp;nbsp; This assumes one of two things.&amp;nbsp; Either your user knows they're going offline and they synchronize before they yank the cable or they predict when the network fails.&amp;nbsp; Of course the application can constantly synchronizing data in the background.&amp;nbsp; Crystal ball? When do you really know or have time to sync beforehand?&amp;nbsp; You're working in your office, and Outlook pops up reminder.&amp;nbsp; Or worse, you get an IM or Text message asking "where are you".&amp;nbsp; You grab your laptop and run... oh, wait, you forgot to sync.&amp;nbsp; Do you have the info needed for the meeting?&amp;nbsp; &lt;/P&gt;
&lt;P&gt;For the background sync, one of two things could be happening.&amp;nbsp; When you "fall offline", your view of data suddenly changes because your local copy is so out of date compared to the data you were just looking at, or your synching often enough that there's no difference, asking why you're even trying to work online in the first place.&amp;nbsp; Or, you've effectively created a denial of service attack by asking, has anything changed, has anything changed, has anything changed?&lt;/P&gt;
&lt;P&gt;Outlook 2003 (I think that was the version) tried this fallback model.&amp;nbsp; It was awful.&amp;nbsp; You're sitting in your office, writing an email, looking at your inbox.&amp;nbsp; The network goes down, your inbox view completely changes, or worse Outlook froze, and you lost that message you were carefully wording.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Always work locally&lt;BR&gt;&lt;/B&gt;In this model, you synchronize everything you need, and make all your interactions against the local store.&amp;nbsp; This is sort of the Outlook model today (Outlook 2007).&amp;nbsp; There are equal problems here.&amp;nbsp; Is it realistic to have all the data locally?&amp;nbsp; Even Outlook data can be significantly large, and that's clearly your data.&amp;nbsp; What about public folders?&amp;nbsp; By default, these are only available online.&amp;nbsp; If you're online, they work.&amp;nbsp; If you're not, they don't.&amp;nbsp; Fairly straight forward; but what about historical data for all the products the company has shipped?&amp;nbsp; What about your list of customers, or the current list of stocks and their prices?&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The reality is data volume is growing at an exponential rate.&amp;nbsp; Storage continues to get cheaper and faster.&amp;nbsp; 1TB disks and Solid State storage are becoming mainstream.&amp;nbsp; The problem is while connectivity is getting better; the bandwidth isn't increasing at the same rate.&amp;nbsp; And, even as it does, is it realistic to have everything local?&amp;nbsp; Do you keep one of everything that Home Depot or Safeway keeps in stock?&amp;nbsp; Would be really nice, but not all that practical.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;One size fits nobody&lt;BR&gt;&lt;/B&gt;The reality is there's no easy answer.&amp;nbsp; This is really an architectural and user model change is required to make this happen.&amp;nbsp; We've been through these before.&amp;nbsp; In the "old times", families ate what they grew.&amp;nbsp; Corn, milk, meat, etc.&amp;nbsp; Others only had Ice or Milk that was delivered to their house daily.&amp;nbsp; You could think of this as the "online model".&amp;nbsp; Today, we go shopping to &lt;A href="http://www.safeway.com/"&gt;Safeway&lt;/A&gt;, &lt;A href="http://dagnyc.com/"&gt;D'Agostino&lt;/A&gt;, or your local grocery store.&amp;nbsp; The stores don't grow anything locally.&amp;nbsp; They stock goods they get from somewhere else.&amp;nbsp; You take stuff home and stock it in your pantry, frig, freezer.&amp;nbsp; When you throw out the garbage it goes into the can.&amp;nbsp; The can gets picked up on Thursday.&amp;nbsp; It gets taken to &lt;A href="http://www.beavertonoregon.gov/departments/recycling/information/graphics/garbpath.jpg"&gt;the transfer station&lt;/A&gt;, and then off to the dump.&amp;nbsp; The point is we have lots of "store and forward"/sync models already in place.&amp;nbsp; What's really interesting is the "online" things are actually more expensive.&amp;nbsp; It turns out it's cheaper to stock goods that may be used, and accept a percentage of loss for things that don't sell than it is to create on demand.&amp;nbsp; Why do we think electronic bits and bytes should be "online" only?&amp;nbsp; Why are 1's and 0's more expensive than physical goods?&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Evolutionary approach: Mapping concepts&lt;BR&gt;&lt;/B&gt;If we look at the concepts we have today in web/service/stateless models, they break down into two common, and one advanced models:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Get&lt;BR&gt;&lt;/B&gt;Get maps very easily to HTTP:Get.&amp;nbsp; Essentially you make a request to a domain, application and method.&amp;nbsp; You likely pass parameters and of course all the authentication goo.&amp;nbsp; The result of the get is returned and you now have a copy of information relevant to that point in time, and the specific question you've asked.&amp;nbsp; Most likely, but no guarantee it's accurate by the time you quickly display it on your 64bit, quad laptop with a gigabit connection to the internet.&amp;nbsp; Even historical data is subject to "correctness"- remember the Florida elections J&amp;nbsp; But, we live with "copies" all the time.&amp;nbsp; Copies are tangible, things that are "just there".&amp;nbsp; There's a separate question of how "out of date" the copy is.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Submit&lt;BR&gt;&lt;/B&gt;You have some information you're sending back.&amp;nbsp; You expect some action to be taken on the data you're submitting.&amp;nbsp; That submit can be accepted, rejected or modified.&amp;nbsp; You get an immediate response, but no guarantee what you've submitted will be accepted.&amp;nbsp; That might happen later on, it might not.&amp;nbsp; You hope, or expect to be notified if something changes.&amp;nbsp; But is that concept built into our app models?&amp;nbsp; Or, do we just assume the world is globally connected, and everything is always running so things can be asked and answered immediately, with 100% accuracy, in one big transaction so no two people can allocate the same "goods".... Whew, that's as ridiculous to assume as it is to type.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Can Get and Submit evolve?&lt;BR&gt;&lt;/B&gt;With &lt;B&gt;Get&lt;/B&gt;, you &lt;I&gt;can&lt;/I&gt; implement a "caching" model.&amp;nbsp; Rather than Get directly from the source, imagine you &lt;B&gt;Get&lt;/B&gt; through an abstraction layer.&amp;nbsp; For each Get the abstraction layer keys off the domain/app/method and name/value pairs for parameters.&amp;nbsp; Let's say I make a service call to: &lt;A href="http://acmeservices.com/Books/GetBookByName.asmx"&gt;http://AcmeServices.com/Books/GetBookByName.asmx&lt;/A&gt;.&amp;nbsp; I pass in:&amp;nbsp; Title=SQL Server Compact&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In the GetCache, it looks for the service and name/value pairs that match.&amp;nbsp; If it finds a result, it may not have to actually make the network call.&amp;nbsp; It &lt;I&gt;could&lt;/I&gt; just return the cached result.&amp;nbsp; But what about stale data?&amp;nbsp; You can put an expiration policy on the cache.&amp;nbsp; For a list of states, a day is likely more than generous.&amp;nbsp; For pricing, maybe an hour.&amp;nbsp; The point is you can customize this per source.&amp;nbsp; For many things, one could argue most queries, the data is fairly static and the app could benefit immensely by caching the "gets".&amp;nbsp; If, however, you were to look online first, than only if the resource wasn't available look in the local cache than what benefit are you getting?&amp;nbsp; Sure, the app would "work offline", but you don't see any benefit in the online mode.&amp;nbsp; Each request still takes the time to roundtrip.&amp;nbsp; If you implement a smart caching model you can provide dramatically faster user responses. ...and in most cases, the data is perfectly accurate.&amp;nbsp; Now it would sure be nice to know when something changes, so if California does sink, Iraq or Canada become the 51&lt;SUP&gt;st&lt;/SUP&gt; state, you don't have to watch CNN and ask all your clients to either wait for the cache to update, or "invalidate" the cache.&amp;nbsp; I talked about notifications a bit &lt;A href="http://blogs.msdn.com/stevelasker/archive/2007/08/10/notification-to-pull.aspx"&gt;here&lt;/A&gt;, so I'll keep going. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Submit&lt;BR&gt;&lt;/B&gt;This one gets interesting as well.&amp;nbsp; You have an order to submit for some widgets.&amp;nbsp; Sure, you can submit directly to a "Web Service", or web page.&amp;nbsp; But in many situations the order submission doesn't actually mean the order will ship.&amp;nbsp; Accounting needs to verify your credit.&amp;nbsp; The products that were supposed to be in stock may have been routed to a bigger customer, or "fell off the truck".&amp;nbsp; Again, the point is just because you may get an immediate acknowledgement the order was accepted, doesn't mean it will be fulfilled.&amp;nbsp; So, why not accept this as the model, and when it works, it just works.&amp;nbsp; When a problem occurs, it's not really a problem because it's built into the system.&amp;nbsp; What if you "queued it up" for sending?&amp;nbsp; In this case we save the message locally, in a "logical queue", and when the service is available, we send it on its way.&amp;nbsp; I used the term "logical queuing" as I'm not implying you must use something like SQL Server Broker, MSMQ or WCF Queues, etc.&amp;nbsp; These tend to be a bit over complicated for what you need on the client, and it makes it difficult to act, query or evaluate the data in its transient state.&amp;nbsp; A while back I wrote a blogicle on and some samples for &lt;A href="http://blogs.msdn.com/stevelasker/archive/2007/08/21/sync-services-forado-net-and-sql-server-compact-presentation.aspx"&gt;Logical Queuing&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;&lt;B&gt;Sync&lt;BR&gt;&lt;/B&gt;This is what some might assume is the answer to all of these problems.&amp;nbsp; If I can synchronize changes from other nodes (the server and other clients) with my local store, and I can make changes locally and have them synchronize back "up" to the other nodes, doesn't that solve everything?&amp;nbsp; In the land of demos, sure.&amp;nbsp; But in the real world there are just too many complications.&amp;nbsp; The volume of data, requirements for business logic, and workflow make it difficult to assume Sync can solve all the problems.&amp;nbsp; Where sync does do really well is for synchronizing reference data.&amp;nbsp; That list of states, codes, or even larger volumes like the product catalog.&amp;nbsp; The &lt;A href="http://blogs.msdn.com/stevelasker/archive/2007/08/21/sync-services-forado-net-and-sql-server-compact-presentation.aspx"&gt;Logical Queuing&lt;/A&gt; blogicle and sample demonstrate some thoughts here.&amp;nbsp; I recently saw some work the Microsoft Mobile Line of Business CRM team, and it also uses a similar model.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Revolution is on the horizon&lt;BR&gt;&lt;/B&gt;With all the complications and half way solutions, you have to wonder what's the real answer to all this mess.&amp;nbsp; Will this problem just go away because we'll have high speed internet available everywhere?&amp;nbsp; Even if you could be guaranteed internet access everywhere, do we think that every service will be available all the time?&amp;nbsp; As the world gets more connected, will systems be more reliable and capable of enlisting in massive distributed transactions?&amp;nbsp; Or, will computing systems evolve to what every other large scale system as evolved to. Queuing, Caching, Reserving, Buffering, Acknowledgement, Conflict Detection &amp;amp; Resolution and Notifications.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;While I talked a bit about the food supply earlier, this is also a bit like the VB Classic to Web transition.&amp;nbsp; For those old enough to remember the great 90's there was a big transition from "fat clients" to "thin clients".&amp;nbsp; No subtle suggestion of which is better there J&amp;nbsp; When developers first started building ASP Classic (pre .net) apps they simply moved their session state to the ASP Session object.&amp;nbsp; Which meant web servers could serve about 5-10 people before falling over.&amp;nbsp; Not exactly the promise we had all hoped for.&amp;nbsp; It took a while to realize the app models had to change. But, moving from Client apps to Web apps was a bit more obvious.&amp;nbsp; Mostly because the UI changed (for the worse), but at least users could get their work done because we couldn't get the VB apps deployed.&amp;nbsp; (yes, I'm over simplifying things, but run with me for a minute).&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Since developers had to re-write their UI anyway, it was an obvious change.&amp;nbsp; Making the transition from online to offline mode apps isn't as obvious.&amp;nbsp; The only UI required is the UI really telling them when problems occur.&amp;nbsp; Who wants that?&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;The reality is things are a changing.&amp;nbsp; Nothing to announce, nothing to promise, but there is a revolution on the way.&amp;nbsp; Revolutions take time for people to live through denial that it's coming, but it comes as a wave of reality that just smacks you with "duhh, I guess that was a stupid assumption".&lt;/P&gt;
&lt;P mce_keep="true"&gt;While we all wait for the revolution, you can look at things like ADO.NET Sync Services, the Sync Framework, Astoria Offline, and lots of goodies the Patterns and Practices team has done.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Steve&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9003995" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevelasker/archive/tags/Microsoft+Synchronization+Platform/default.aspx">Microsoft Synchronization Platform</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/Sync+Services/default.aspx">Sync Services</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/OCS/default.aspx">OCS</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/offline/default.aspx">offline</category></item><item><title>First look at the Visual Studio Orcas Sync Designer</title><link>http://blogs.msdn.com/stevelasker/archive/2007/03/22/first-look-at-the-visual-studio-orcas-sync-designer.aspx</link><pubDate>Thu, 22 Mar 2007 03:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1928112</guid><dc:creator>Steve.Lasker</dc:creator><slash:comments>16</slash:comments><comments>http://blogs.msdn.com/stevelasker/comments/1928112.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevelasker/commentrss.aspx?PostID=1928112</wfw:commentRss><description>&lt;P mce_keep="true"&gt;Here's part 1 of the new Sync Designer.&amp;nbsp; In this screen cast I walk through how to cache lookup tables locally.&amp;nbsp; In this screencast I use the 2 tier sync, starting simple.&amp;nbsp; In the next screencast I'll show how to take the same designer, and split it across N tier to keep the intimate knowledge of the server, connection string, queries, passwords, etc. from the client.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A class="" href="http://channel9.msdn.com/posts/SteveLasker/Visual-Studio-Orcas-Sync-Designer-for-Caching-Data-in-SQL-Server-Compact-Edition/" mce_href="http://channel9.msdn.com/posts/SteveLasker/Visual-Studio-Orcas-Sync-Designer-for-Caching-Data-in-SQL-Server-Compact-Edition/"&gt;http://channel9.msdn.com/posts/SteveLasker/Visual-Studio-Orcas-Sync-Designer-for-Caching-Data-in-SQL-Server-Compact-Edition/&lt;/A&gt;&lt;A href="http://channel9.msdn.com/ShowPost.aspx?PostID=293600" mce_href="http://channel9.msdn.com/ShowPost.aspx?PostID=293600"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Just as a note, this screencast shows an internal build of Visual Studio Orcas between the Feb CTP and Beta 1.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Steve&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1928112" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevelasker/archive/tags/Presentations/default.aspx">Presentations</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/SQLce/default.aspx">SQLce</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/MSP/default.aspx">MSP</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/Microsoft+Synchronization+Platform/default.aspx">Microsoft Synchronization Platform</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/Sync+Services/default.aspx">Sync Services</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/SQL+Server+Compact+Edition/default.aspx">SQL Server Compact Edition</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/OCS/default.aspx">OCS</category></item><item><title>Additional Q&amp;A on the Visual Studio Orcas Sync Designer</title><link>http://blogs.msdn.com/stevelasker/archive/2007/03/21/additional-q-a-on-the-visual-studio-orcas-sync-designer.aspx</link><pubDate>Wed, 21 Mar 2007 20:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1926933</guid><dc:creator>Steve.Lasker</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/stevelasker/comments/1926933.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevelasker/commentrss.aspx?PostID=1926933</wfw:commentRss><description>&lt;P&gt;&lt;B&gt;Q: Why does the Orcas Feb CTP Typed DataSet designer not work on Vista?&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;A: &lt;/B&gt;Visual Studio Orcas is not yet fully compatible with Vista.&amp;nbsp; In the Feb CTP there are several issues with something we call "red bits".&amp;nbsp; These are changes to the runtime that shipped in .NET 3.0 which shipped with Vista.&amp;nbsp; For our own internal testing, we do have fixes allowing us to test on Vista and all the scenarios are working.&amp;nbsp; However, due to the way the dlls are signed and shipped in Vista, and the time crunch we're working under, we weren't able to get the work done in such a way that we could service a Vista box that had the Feb CTP installed.&amp;nbsp; This was a very tough decision as we do not want to set the expectation that Visual Studio Orcas won't be Vista compatible.&amp;nbsp;&amp;nbsp; But, it was felt more important to make sure that anything we ship, including the CTP must be serviceable.&amp;nbsp; As we all know, we're working on to maintain our schedule, and since CTP's are not meant to reflect the final quality, it was determined to ship the Feb CTP without full Vista support.&amp;nbsp; As those that have seen my demos, we do have Vista working, and we will have full support for Vista.&amp;nbsp; I believe, but not sure, that B1 will be fully Vista compatible.&amp;nbsp; So, for now, if you're using Vista, the Feb CTP should be run in a VPC.&amp;nbsp; In general, it's not a bad practice anyway.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Q: Will the Sync Designer generate time based sync?&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;A:&lt;/B&gt; This feature was unfortunately cut.&amp;nbsp; We had some great designs, and even some prototypes that I've demo'd previously.&amp;nbsp; However, we just didn't have the time to do all the background task, network resource detection, and timer work.&amp;nbsp; Rather than hack something together we didn't have time to fully design, dev and test, we've had to cut this feature altogether.&amp;nbsp; Of course this doesn't mean developers aren't smart enough to do this work with a combination of the BackgroundWorker, Timer and Network events.&amp;nbsp; It just means we don't have a checkbox to do all the work automatically.&amp;nbsp; We will have samples on how to do this, and we're in discussion with Patterns &amp;amp; Practices group on filling these gaps ‘till we have fully integrated runtime components that make this "just work".&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Q: Will tombstone records be automatically cleaned up?&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;A:&lt;/B&gt; This was another cut we made in the sync designer with Visual Studio Orcas.&amp;nbsp; Tombstone records are how we track deletes.&amp;nbsp; If you sync on Monday and get the full product catalog, and then sync again on Wednesday, how can the server answer the question of "what was deleted".&amp;nbsp; There are many ways to handle this.&amp;nbsp; You can mark the main record with a status of Active = False, or you can physically delete the row and in the Deletion Trigger copy the PK to a [Table]_Tombstone record.&amp;nbsp; The later is what the Visual Studio Orcas Sync Designer does.&amp;nbsp; We had planned to create a Scheduled Task to automatically purge these deleted records, but since SQL Server Express doesn't have the Agent, we felt this was going to be too confusing.&amp;nbsp; We also expect developers will do some additional work between their development and production boxes, so for now we punted this.&amp;nbsp; We're not yet talking in detail about our SQL Server Katmai release, but you can expect we're doing some cool things here.&amp;nbsp; So, for now, you'll have to create a scheduled task to purge the tombstone records that are say older than 30 days.&amp;nbsp; Stay tuned, and we'll have more exciting things to discuss about the upcoming Katmai rlease.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Q: How do I get my cached tables to be synchronized in a single transaction?&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;A:&lt;/B&gt; The Orcas Sync Designer is focused on download scenarios.&amp;nbsp; You can absolutely extend the sync designer generated code to do uploads as well, and in fact we even generate the upload SyncAdapter commands.&amp;nbsp;&amp;nbsp; For download only scenarios it was felt we should keep things simple by default and enable the ability to easily recover from dropped connections.&amp;nbsp; So, by default, the Sync Designer synchronizes each table individually.&amp;nbsp; As one table is finished, the next table is synchronized.&amp;nbsp; This means if table 1 finishes, and the connection drops during table 2, that the next time a sync occurs, Table1 is likely already complete.&amp;nbsp; To put all the tables in a single transaction, expand the [advanced] expando button and choose the sync all tables in a single transaction option.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;For the Feb CTP, the Sync Designer generated a SyncGroup for each table.&amp;nbsp; This wasn't necessary as the SyncAgent knows to place each in it's own SyncGroup when one isn't specified.&amp;nbsp; This has since been changed so you'll only get a SyncGroup when placing all in a single transaction.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Q: Once all the tables are placed in a single transaction, how do I control the order the tables are updated to handle parent/child relationships?&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;A:&lt;/B&gt; The Sync Runtime will apply inserts, updates and deletes based on the order of the SyncTables and SyncAdapters in their respective collections.&amp;nbsp; This isn't fully implemented in the Orcas Feb CTP, or the Jan Sync CTP.&amp;nbsp; However, we do now have that updated internally and will be releasing it soon in the CTP. &amp;nbsp;&amp;nbsp;In an upcoming screen cast you'll see the current updates to the Sync Designer, including the ability to move items in the collection up and down.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Q: Does the sync runtime create relationships locally within SQLce?&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;A:&lt;/B&gt; No, I touched on this here: &lt;A href="http://blogs.msdn.com/stevelasker/default.aspx#constraints"&gt;http://blogs.msdn.com/stevelasker/default.aspx#constraints&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;B&gt;Q: Does the sync runtime work with server side identities for PK's?&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;A:&lt;/B&gt; No, no, and maybe.&amp;nbsp; In general, despite the fact that many of our own samples depend on the Identity feature to manage the primary key, identities are an overall poor design.&amp;nbsp; Building offline apps is only the extreme of the problem.&amp;nbsp; How do you create a new row on the client, assign it a primary key when the client won't actually know the PK until it posts it to the server?&amp;nbsp; However, the problem exists in "connected" stacks as well.&amp;nbsp; Say you're creating a Order with a collection of OrderDetails.&amp;nbsp; The standard model is to have the OrderDetails table reference the PK of it's parent, than add another sub key, say line number.&amp;nbsp; You can't actually create the OrderItem records until the Order record is posted first.&amp;nbsp; This creates complications for connected development.&amp;nbsp; Sure, you can use the @@scope_identity value, but you still have to do a bunch of updates.&amp;nbsp; Sure, you can wrap this in a sproc, but it's still a PITA.&amp;nbsp; Now, consider you're building a high availability system.&amp;nbsp; You have multiple server nodes managing the creation of data.&amp;nbsp; Who owns the master identity range?&amp;nbsp; We see this in rollup scenarios all the time.&amp;nbsp; Each branch maintains their own data.&amp;nbsp; Each uses identities.&amp;nbsp; When the data is rolled up to corporate, you have collisions, requiring you to add the branch id to the corporate database.&amp;nbsp; Now, you could partition the identity values, which is what we do in Merge Replication, but now we've introduced additional problems.&amp;nbsp; Prior to joining Microsoft we deployed many mobile applications.&amp;nbsp; If a person is in the field, using Merge Replication, and is working with their partition of IDs, what happens when they use them up?&amp;nbsp; They have to re-synchronize with the server to get a new allocation, which they may not be able to do at the time they've run out.&amp;nbsp; So, the app is dead.&amp;nbsp; Another client doesn't use up their allocation and leaves "holes" in the server.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;B&gt;So, what's the solution?&lt;/B&gt;&amp;nbsp; There are two ways, the simple but not always the most efficient, and the complex.&amp;nbsp; The simple is to simply use GUIDs.&amp;nbsp; SQL Server and SQLce both have UniqueIdentifier data types.&amp;nbsp; You can either set the IsRowGuid property, or create your own GUID with Guid.NewGuid().&amp;nbsp; The other is to create your own hashing.&amp;nbsp; Each client is given a hash when the initially connect to the server.&amp;nbsp; They then create incremental counters, possibly even with Identity within their hash.&amp;nbsp; Now when you push up the new values, voila, no conflicts.&amp;nbsp; If you still want incremental counters, say for that single, simple OrderId, you could still use the Identity feature, just don't make it the primary key.&amp;nbsp; You upload a new order from the client.&amp;nbsp; The client assigned a primary key using it's hash.&amp;nbsp; When that order is uploaded to the server, the server applies the identity value to the non-pk column.&amp;nbsp; The update is then brought back down to the client.&amp;nbsp; Life is good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Steve&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1926933" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevelasker/archive/tags/Code+Samples/default.aspx">Code Samples</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/Q_2600_amp_3B00_A/default.aspx">Q&amp;amp;A</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/SQLce/default.aspx">SQLce</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/MSP/default.aspx">MSP</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/Microsoft+Synchronization+Platform/default.aspx">Microsoft Synchronization Platform</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/Sync+Services/default.aspx">Sync Services</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/SQL+Server+Compact+Edition/default.aspx">SQL Server Compact Edition</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/OCS/default.aspx">OCS</category></item><item><title>Q&amp;A on OCS &amp; Sync Services for ADO.NET</title><link>http://blogs.msdn.com/stevelasker/archive/2007/03/18/QAforOCS_2D00_SyncServicesForAdoNet.aspx</link><pubDate>Sun, 18 Mar 2007 17:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1907415</guid><dc:creator>Steve.Lasker</dc:creator><slash:comments>47</slash:comments><comments>http://blogs.msdn.com/stevelasker/comments/1907415.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevelasker/commentrss.aspx?PostID=1907415</wfw:commentRss><description>&lt;P&gt;Not surprisingly we've been get a lot of great questions about specific features and scenarios for our new Sync Services for ADO.NET (OCS).&amp;nbsp; &lt;A class="" href="http://www.syncguru.com/" mce_href="http://www.syncguru.com/"&gt;Rafik&lt;/A&gt; has been fielding most of these on the &lt;A class="" href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&amp;amp;SiteID=1" mce_href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&amp;amp;SiteID=1"&gt;Sync Services forums&lt;/A&gt;.&amp;nbsp; Since the Q&amp;amp;A for SQLce seemed popular, I thought I'd do the same here.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: How does Sync Services compare to Merge Replication and RDA?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;U&gt;Merge replication &lt;/U&gt;&lt;/STRONG&gt;is our developer oriented, feature rich, SQL Server based database "replication" product.&amp;nbsp; It's designed for a DBA to configure a publication on the database exposing a set of tables (articles) enabling filtering and rules.&amp;nbsp; Clients then "subscribe" to the publication and receive a local database reflecting the publication.&amp;nbsp; It's a very powerful and mature product that we will continue to invest in.&amp;nbsp; From the server side (publications), Merge Replication is a SQL Server only feature that is available in our SQL Server Workgroup, Standard and Enterprise SKUs.&amp;nbsp; Merge Replication, as a publisher, is not available in the free SQL Server Express SKU.&amp;nbsp; Merge replication supports 2tier sync and sync over HTTP(s)&amp;nbsp; to enable internet synchronization.&amp;nbsp; However, I wouldn't say that Merge is SOA oriented in that you don't have much control of what's sent or received across the wire, nor do you have the ability to support additional transports.&amp;nbsp; It's a fantastic end to end replication product that handles a lot of complicated scenarios.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Remote Data Access (RDA)&lt;/STRONG&gt; is a developer oriented, simple but RAD sync technology.&amp;nbsp; It works over HTTP, so it enables internet protocol sync, but again, it's not very SOA friendly.&amp;nbsp; While the client doesn't directly open a connection to SQL Server, it does require the client provide the connection string and query to be executed on the server.&amp;nbsp; So, it pretty much violates the notion of keeping the server information from the client.&amp;nbsp; While it is limited, you can't deny it's popularity for it's simplicity.&amp;nbsp; We continually hear many people implementing RDA rather than merge as theire requirements are simple and RDA just worked great.&amp;nbsp; Which brings me to Sync Services for ADO.NET&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Sync Services for ADO.NET &lt;/STRONG&gt;is our answer to this dilemma of having to choose between the dba focused powerful features of Merge, the simplicity of RDA, and the developer motivation for them to write their own.&amp;nbsp; When designing Sync Services we used RDA as our user model.&amp;nbsp; Debra Dove and her team did an excellent job with RDA, and we wanted to take it to the next level.&amp;nbsp; We used the provider and developer programming model of ADO.NET and wanted to leverage all the great transport, security and protocol work others were doing. &amp;nbsp;Essentially, rather than build additional solutions to existing problems, we wanted to scope the solution to what we needed to solve, and leverage others who were experts in their field.&amp;nbsp; The Sync Services for ADO.NET features are built by the same team that delivers Merge Replication.&amp;nbsp; I've been truly amazed at the knowledge these guys have.&amp;nbsp; It's because of their experience that I have a hard time calling Sync Services a 1.0 product.&amp;nbsp; It's really a culmination of all the great work from Merge, RDA, file synchronization, and even the WinFS sync work.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;The quick bullet for Sync Services is it's a componentized synchronization framework, built on ADO.NET, but factored to provide a common sync platform for Entities, Files, and other formats.&amp;nbsp; Sync Services for ADO.NET is our first delivery in our Microsoft Synchronization Platform.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The key advantages of Sync Services is its developer focus, w/DBA empowerment.&amp;nbsp; Rather than force your DBA to understand all the details of how you're going to synchronize data within your application, you engage the DBA for the portions that touch the server database.&amp;nbsp; The transports are up to you, and we have a great WCF designer integrated story, but you can use other transports as well.&amp;nbsp; The local database schema/structure is up to the developer to decide as it's their apps database.&amp;nbsp; Of course you can engage your DBA as well, but you don't get what you get as the result of a synch operation.&amp;nbsp; You can use just the client components and use Java and Oracle on the server, or you can use just the server components and other technologies on the client.&amp;nbsp; If your data is locked up in Oracle, you can still use Sync Services to synchronize that data directly from Oracle to your client.&amp;nbsp; You don't have to put SQL Server in the middle just to enable sync.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The point here is regardless of what cards you've been dealt, we want to help you get your app done to make your users happy.&amp;nbsp; The more Microsoft products you use, the better the experience we can provide, but we're not locking you in, or out of our platform just because something is out of your control.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: What's the roadmap for Merge, RDA and Sync Services&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Merge replication &lt;/STRONG&gt;will continue to be our database replication product and will have Katmai investments in the next release.&amp;nbsp; Merge will be the DBA tool for replicating a database, and those that are already using Merge shouldn't feel like we're abandoning them by any means.&amp;nbsp; If Merge is working for you, don't worry, we're continuing to take feature work and making improvements.&amp;nbsp; In fact, many of the Sync Services features will work into Merge as well.&amp;nbsp; That's about all I can say for now.&amp;nbsp; We'll announce more about Katmai later on.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;RDA &lt;/STRONG&gt;will eventually be phased out.&amp;nbsp; We truly believe the Sync Services features address the simplicity of RDA, but don't have any of the limits imposed by RDA.&amp;nbsp; Specifically, incremental changes, ability to synchronize several tables in one transaction handling all the interleaving of inserts, updates and deletes.&amp;nbsp; Support for other ADO.NET Providers, etc.&amp;nbsp; If you're already using RDA, we're not killing it yet, but we won't be doing any new work there either.&amp;nbsp; We do expect to deprecate it within the next release or so as Sync Services are released.&amp;nbsp; If you haven't yet deployed RDA, but are looking into it, definitely look at the Sync Services CTP.&amp;nbsp; If you need to go into production now and can't wait ‘till Sync Services are released, than by all means use RDA.&amp;nbsp; It's not like it has that much functionality that you won't be able to easily switch to Sync Services later on.&amp;nbsp; &amp;lt;g&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Sync Services &lt;/STRONG&gt;is where we're doing a lot of our investments.&amp;nbsp; It's just the first delivery in our new Microsoft Synchronization Platform.&amp;nbsp; I'll write a different blog post on our naming.&amp;nbsp; (I love discussing naming, ...not).&amp;nbsp; Sync Services are our developer oriented, SOA enabled data synchronization features.&amp;nbsp; We won't have all the database replication features of Merge, as we really focus on synchronizing data.&amp;nbsp; Sync Services provides and end to end story, but is a componentized model allowing you to get in the middle, or completely replace one end.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: Can I use Merge and Sync Services together?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;As we've all seen with our &lt;A class="" href="http://blogs.msdn.com/stevelasker/archive/2006/11/08/comparing-sql-server-express-and-compact-editions-whitepaper.aspx" mce_href="http://blogs.msdn.com/stevelasker/archive/2006/11/08/comparing-sql-server-express-and-compact-editions-whitepaper.aspx"&gt;SQLce and Express discussions&lt;/A&gt;, one size doesn't fit all.&amp;nbsp; But we also don't believe you need 10 ways to solve the same problem.&amp;nbsp; Just as with Express being our entry point to our Data Service platform and SQLce being our client/embedded platform, we expect Merge and Sync Services to address the needs of two types of scenarios.&amp;nbsp; It's likely that some scenarios, such as a branch office may actually use both Merge and Sync Services.&amp;nbsp; Merge to replicate data between the branch office and the corporate office, and Sync Services to enable branch workers to go out into the field.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: Does Sync Services support N Tier?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Absolutely.&amp;nbsp; The beauty about the N, is it could imply 1 to many.&amp;nbsp; With Sync Services we have Server and Client Providers.&amp;nbsp; Actually, we like to think of them as local and remote providers as we currently focus on hub/spoke, but we'll be enabling p2p as well in the future.&amp;nbsp; You can start with 2 tier and move to N tier.&amp;nbsp; You can intermix 2 tier and N tier based on where the clients are connecting from.&amp;nbsp; When you first start working with Sync Services you may ask why you have to specify the tables your synchronizing on the client and server providers.&amp;nbsp; That's because we want to make sure you can easily split the client and server code to different tiers.&amp;nbsp; All the "intimate" knowledge of the server can easily be moved to the mid tier, while the client provider configuration is maintained on the client.&amp;nbsp; Even the Sync Designer allows you to easily split the client and server provider code.&amp;nbsp; It's quite sweet when you see it.&amp;nbsp; Screen cast coming soon...&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: What transports do you support?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;: What do you want?&amp;nbsp; As noted above, the sync team wants to get out of the transport business.&amp;nbsp; We have many bright people in Microsoft thinking about those problems.&amp;nbsp; In Orcas the Visual Studio designers will focus on enabling WCF, but you can use Web Services, SSE, SyncML or if you can figure out how to convert Jelly Beans to .NET objects, you can use those as well.&amp;nbsp; Essentially, you simply plug in a matching service and a proxy, and you're good to go.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: Do you support column level tracking?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Not yet.&amp;nbsp; For this first release, we only support row level tracking.&amp;nbsp; We are working on column level tracking, but it does require additional functionality on the server, and we wanted to make it easy for developers to start synchronizing data from their existing databases.&amp;nbsp; As with any good database design, you should think about how you partition your tables.&amp;nbsp; For various reasons, it's good to separate images, or other large blobs from your primary table into other tables and maintain a 1:1 relationship.&amp;nbsp; It's not meant to be an excuse, and we will be implementing column level tracking in the future.&amp;nbsp; Using features like ADO.NET V3 entities you can roll up the 1:1 mappings into a single object allowing your developers to work in a normal fashion, while managing performance and isolation in your database.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: Do you support custom conflict resolvers?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Of course.&amp;nbsp; How could we not?&amp;nbsp; On both the server and client providers we expose a conflict event.&amp;nbsp; In that event you'll get the client and server rows that represent the conflict.&amp;nbsp; You can simply say force overwrite, or implement very custom logic.&amp;nbsp; Such as determining if the person who made the change is a manager, or owner of that particular customer account.&amp;nbsp; Based on that custom logic, you simply make the logical change.&amp;nbsp; All this is in managed code, with your favorite .NET language.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: Do you support partitioning/filtering?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Of course.&amp;nbsp; We don't really expect people to synchronize terabytes of their data to all their clients.&amp;nbsp; The partitioning is the normal horizontal and vertical partitioning.&amp;nbsp; You simply provide the query that represents the filter you wish to support.&amp;nbsp; You can do joins, etc.&amp;nbsp; It's just a query.&amp;nbsp; The client sends up as many parameter values as you need.&amp;nbsp; There's no limitation on the number of parameters.&amp;nbsp; In fact, you can even intercept calls on the server and set sync parameter values based on other logic.&amp;nbsp; In WCF you can determine who the client is, and based on that info, send them their customers without exposing the SalesPersonId to the client to substitute another value.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: Does the server track each client individually?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;No.&amp;nbsp; This is one of the major differences when compared to Merge.&amp;nbsp; One of the powerful features of Merge is it knows all its clients, so when the client connects, it already has the data ready for it, and easily supports "data repartitioning". In Sync Services, the server has no idea who all the clients are.&amp;nbsp; The benefit here is Sync Services don't have the same scalability constraints.&amp;nbsp; You can synchronize as many clients as your server can handle queries.&amp;nbsp; The server doesn't necessarily know it's a publisher, but rather it's just answering queries.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: Does Sync Services support multiple publications&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Yes/no.&amp;nbsp; Sync Services doesn't utilize the pub/sub model per se.&amp;nbsp; You can configure the server provider to offer 20 tables you want to synchronize.&amp;nbsp; The client simply say it cares about 3.&amp;nbsp; Another client cares about a different 3.&amp;nbsp; Another client cares about 4, which overlap the first two clients.&amp;nbsp; In fact, we also support a client dynamically adding tables.&amp;nbsp; A sales person may cover another sales person for a week and needs to bring in an additional product line.&amp;nbsp; Within the app, the developer can change the filtering query, and off they go.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: How are schema changes handled?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Unlike merge which is geared around replicating a database, Sync Services is geared around synchronizing data.&amp;nbsp; I'm not a big believer that generally speaking the DBA simply adds a column to the server and the UI automatically updates on the client and life is good.&amp;nbsp; While it can be done, most of the time I'd bet you want some control over where and how the new element is displayed, add some interaction logic to the client, tab order etc.&amp;nbsp; We really treat schema updates as an app update.&amp;nbsp; It's a holistic update of the app overall.&amp;nbsp; The model we've gone with the Sync Services are the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A new requirement is defined, say AddressLine3.&amp;nbsp; The DBA would add the column to the server.&amp;nbsp; All the normal rules apply.&amp;nbsp; If the column is non-nullable, than a default should be provided.&amp;nbsp; &lt;/LI&gt;
&lt;LI&gt;The developer involved with the sync layer would most likely create a new version of the Sync Service, say v2.&amp;nbsp; This means that apps that were using v1 can be slowly migrated, or at least be migrated within some level of control.&amp;nbsp; If the user is in the middle of an important deal, the last thing they need is a forced software upgrade.&amp;nbsp; Ever been in the middle of something important and IT forces an update that reboots your computer or app?&amp;nbsp; Software is an enabler, it should help me achieve my goals, not fight me because &lt;STRONG&gt;&lt;EM&gt;IT &lt;/EM&gt;&lt;/STRONG&gt;thinks its important now.&lt;/LI&gt;
&lt;LI&gt;The app developer updates their service proxy to point to v2 of the sync service, exposing the extra column.&lt;/LI&gt;
&lt;LI&gt;In the version check code, the app author can either choose to reset the table, or they can execute the alter table script locally adding the additional column.&amp;nbsp; They may even bring down a single data call to retrieve the values for the new column on all the existing rows.&lt;/LI&gt;
&lt;LI&gt;The developer than decides what they want to do with the new element, updating their ui, logic etc.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;So, while we didn't implement something as simple as point click, we think it tends to fit the SOA model where apps may consume services from other apps, and they should have control over how and when they consume new schema.&lt;/P&gt;&lt;A class="" title=constraints name=constraints&gt;&lt;/A&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: How are constraints, keys, and other db objects brought down to the client?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;This again falls in the category of Sync Services is about synchronizing data, not replicating a database.&amp;nbsp; Sync Services does do some schema and even database creation with SQL Server Compact Edition.&amp;nbsp; If you're starting from scratch, and you first synchronize, the SQLce database will be created based on the connection string properties, name, encryption, password, etc.&amp;nbsp; It will then create all the tables the client has said they're interested in.&amp;nbsp; Remember, just because the server exposes 20 tables, doesn't mean the client must use all of them.&amp;nbsp; The client determines which tables it wants to consume with the SyncTable collection.&amp;nbsp; When the tables are created, primary keys are created, datatypes are mapped to the clients datatypes, and nullability is applied.&amp;nbsp; No additional indexes, constraints, defaults, etc. are applied.&amp;nbsp; There are SchemaCreating/ed events fired where you can either initial create the schema to be used, or alter the schema after the tables are created.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: Does sync services handle parent/child/grandchild relationships?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Yes.&amp;nbsp; Unlike RDA where you can only sync one table at a time, Sync Services handles the hierarchical nesting of inserts, updates and deletes.&amp;nbsp; In fact you can even control it seperatly on the server from the client.&amp;nbsp; On the server, tables are placed in the SyncAdapter collection.&amp;nbsp; The order of the SyncAdapters defines the order by which updates will be applied.&amp;nbsp; Inserts and Updates are done from the top down, while deletes are done from the bottoms up.&amp;nbsp; The same is done on the client, in the SyncTables collection.&amp;nbsp; This allows the server to control its order, while allowing the client to control its order of updates.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: Can I update only a few tables at a time?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Yes.&amp;nbsp; Say you want to only synchronize your lookup tables, states, codes, etc. once a day.&amp;nbsp; You can create a specific service just for your lookups, and another for your product catalog.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Q: Can I update everything in a single operation, or can I control things more granularly?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Within the SyncAgent, you can utilize the SyncGroup to determine the grouping of updates.&amp;nbsp; In the previous example, you may choose to put all the lookup tables in their own individual groups.&amp;nbsp; If the connection drops while you're synchronizing your lookups, it can pickup where it left off next time it synchs.&amp;nbsp; However, when synchronizing Orders, you probably don't want Orders to ever go up/down without OrderDetails.&amp;nbsp; Simply put the Orders and OrderDetails table in the same SyncGroup, and you're all set.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: Does Sync Services support batching for large data sets?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Yes, but not quite yet.&amp;nbsp; We initially scoped this out of the first release, but we believe we'll be able to get it in, so look for it sometime around March 07.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: How does Sync Services track changes?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Sync Services uses an Anchor based model.&amp;nbsp; Each time a sync operation occurs it gets a reference mark from the server.&amp;nbsp; It could be the servers DateTime, or a TimeStamp (RowVersion).&amp;nbsp; The client saves that value for the next sync operation.&amp;nbsp; Each time the client synchronizes a particular SyncGroup, it first requests the server anchor.&amp;nbsp; It than executes the queries on the server using the last anchor as the low range, and the new anchor as the high range.&amp;nbsp; This gets a consistent set of changes across several queries.&amp;nbsp; In future releases of the Microsoft Synchronization Platform we'll be supporting a knowledge based sync model as well as the anchor based model discussed here.&amp;nbsp; Rafik does a great job explaining it in his &lt;A class="" href="http://blogs.msdn.com/synchronizer/archive/2007/02/20/a-nice-gift-from-sql-server-2005-sp2-to-sync-developers.aspx" mce_href="http://blogs.msdn.com/synchronizer/archive/2007/02/20/a-nice-gift-from-sql-server-2005-sp2-to-sync-developers.aspx"&gt;blog&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: How are deletes purged?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;On the server, deletes are either kept in a tombstone table, or simply tracked by some sort of active/status flag in the primary table.&amp;nbsp; Since this version of Sync Services isn't tightly coupled to SQL Server, we actually don't do anything.&amp;nbsp; In general, we'd expect the DBA to write a scheduled task to purge tombstone records on their determined interval.&amp;nbsp; You can expect us to do more in the "future", tease, tease, tease...&lt;/P&gt;
&lt;P&gt;On the client, SQLce purges deleted records once it confirms data has been sent to the server.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: Can I purge old data on the client without triggering a delete on the server?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Yes.&amp;nbsp; While we don't have a simple API to do this today, you can delete a bunch of rows on the client based on what ever criteria you decide, than simply "AcceptChanges" on the client prior to these changes being sent to the server.&amp;nbsp; Of course you could intercept these on the server an toss deletes as well to protect your server data.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Q: Does Sync Services support low bandwidth type sync scenarios?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;By low bandwidth, I mean can I synchronize only the important things now, and catch up later.&amp;nbsp; Yes.&amp;nbsp; You can either upload only, download only, or synchronize just a particular SyncGroup based on your own logic at the time.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Q: When will Sync Services ship?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Sync Services for ADO.NET will ship at the same time Visual Studio Orcas ships.&amp;nbsp; This is currently scheduled for Q4 2007.&amp;nbsp; Note: This is not meant to be the official place to get the timeframe for Orcas, but rather just saying that our current plan is to ship Sync Services within SQL Server Compact Edition 3.5, which will ship with Orcas.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Q: Will Sync Services ship on both the desktop framework and the .NET Compact Framework?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;Yes, but at different times. At current, March 16th '07, we are scheduled to ship for the full framework, but we are not planning on shipping Sync Services for the device platform in the Orcas product.&amp;nbsp; We do plan to ship the client components for Sync Services soon after Orcas, but are still working out the schedule.&amp;nbsp; The problem is the various .NET Compact Framework teams, including the Visual Studio for Devices teams and Sync teams have a lot of work to manage with many different device platforms and a very short schedule, and we haven't been able to get all the appropriate ship level test coverage complete.&amp;nbsp; We have designed, and done preliminary testing with the client components working and synching over Web Services.&amp;nbsp; We are still hopeful we can pull it in, but at this point, we're just not ready to commit to Orcas, but rather shortly thereafter. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Q: Will Sync Services or SQL Server Compact Edition be in the .NET Framework, or .NET Compact Framework?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;No, we are not shipping within either framework, but rather shipping as an add-on component.&amp;nbsp; Why?&amp;nbsp; Because we wanted more flexibility with our ship schedule.&amp;nbsp; SQLce will ship 2-3 times between .NET 2.0 and .NET 3.5.&amp;nbsp; While it would be nice to ride the distribution of the frameworks, with the embedded/private deployment options of SQLce and Sync Services, we felt it was better to have more flexibility with our schedule.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Q: Are these the only questions?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A: &lt;/STRONG&gt;I doubt it.&amp;nbsp; So, keep them coming, and I'll update this FAQ as I receive them.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Thanks for all the great questions.&amp;nbsp; Keep them coming as they help us make sure we're shipping the right features in the right order.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Steve&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1907415" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevelasker/archive/tags/Q_2600_amp_3B00_A/default.aspx">Q&amp;amp;A</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/SQLce/default.aspx">SQLce</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/MSP/default.aspx">MSP</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/SQLev/default.aspx">SQLev</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/Microsoft+Synchronization+Platform/default.aspx">Microsoft Synchronization Platform</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/SQL+Server+Everywhere/default.aspx">SQL Server Everywhere</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/Sync+Services/default.aspx">Sync Services</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/SQL+Server+Compact+Edition/default.aspx">SQL Server Compact Edition</category><category domain="http://blogs.msdn.com/stevelasker/archive/tags/OCS/default.aspx">OCS</category></item></channel></rss>