Dynamic filter (multiple) RRS feed

  • Question

  • Hello.

    How does the sync framework help in the following scenario:

    There are some, let's say 10, really huge tables all containing a DocumentId column.
    When a user logs in, one knows, that only the DocumentIds 5, 10, 23, 50, 51, 52, 53, 55, 59, 61, 66, 89, 5000 and 10000 are important for that current user and that only these entries need to be synced.
    How can one tell the sync framework to sync all these 10 tables but only for the DocumentIds mentioned above?

    The best I've found was parameterized filtering but I don't want to created hundreds or thousands of scopes and in this case one does not know the amount of Ids.
    So I don't think parameterized filtering makes sense here...

    Any ideas?

    Thanks a lot, really a lot, for any kind of information!!!

    Sunday, June 19, 2011 1:21 PM

All replies

  • are the document id's for a particular user stored in a table?

    assuming it stored in a table UserDocuments with a columns UserId and DocumentId,

    you can write your filter for the document table to something similar to this : DocumentId IN (SELECT DocumentId from UserDocuments_tracking WHERE UserId = @UserId)

    is this what you're after?


    Monday, June 20, 2011 1:12 AM
  • Hi JuneT,

    first of all - thanks a lot for your help!
    I think I would be fine with your assumption but I don't see how this solves the problem.
    If I understood this parameterized filtering correctly I still have the same problem, hundreds of scopes, if I got hundreds of users...
    Or am I missing a point? I surely hope so! :)

    The only solution I see is that the client sets the parameter value - but it seems that this is not possible.
    But is my scenario so special? I don't think so. So I really hope that there is a solution out there! :)

    Thanks again!!!

    Monday, June 20, 2011 6:57 PM
  • if you use filtered scope templates, you'll only end up with one row for each scope you defined. not much in terms of storage and they'll share all the other sync fx objects like triggers, select changes sp, triggers and insert/update/delete SPs.

    in terms of performance, your scope knowledge will be smaller per scope than having one scope with all the synchronizing user's knowledge in it. if you want to drop or initialize a specific client's scope, you have an isolated scope that you drop or initialize without affecting the others. if you have multiple clients synching, there wont be contention in the same scope_info row since they will have their own row.

    now, if you're up to some adventure, here you go: https://jtabadero.wordpress.com/2010/03/05/passing-dynamic-filter-values-to-sync-framework-collaboration-scenario-sync-scopes/  :)

    Tuesday, June 21, 2011 12:40 AM
  • We have the same scenario and I was surprised when the only solution seemed to be creating a scope for each device.  We have done this now using a scope template and creating a scope from the template (appending the name with _ and the device name).  This works really well - we have 4 scopes in the sync template and we currently have 100 devices meaning that we have 400 scopes.
    Thursday, June 30, 2011 8:52 AM