I want to use Lightstreamer for its push technology. I have a database in SQL Server and I am only familiar with .NET. That is why I need to write the adapter using VS for feeding data to lightstreamer using. I currently face a case as explained.


I have table design in the database as below:


TableA
(Code, Name)
(A0001, NameA1)
(A0002, NameA2)
(A0003, NameA3)




TableB
(Code, TableACode, TableDCode, Name, TableDCode, IsActive, Field1, Field2, Field3,...)
(B0001, A0001, D0001, NameB1, D0001, True, B1F1, B1F2, B1F3)
(B0002, A0001, D0002, NameB2, D0001, True, B2F1, B2F2, B2F3)
(B0003, A0001, D0003, NameB3, D0002, True, B3F1, B3F2, B3F3)
(B0004, A0002, D0001, NameB4, D0002, True, B4F1, B4F2, B4F3)
(B0005, A0002, D0002, NameB5, D0003, True, B5F1, B5F2, B5F3)
(B0006, A0003, D0003, NameB6, D0003, True, B6F1, B6F2, B6F3)
(B0007, A0003, D0001, NameB7, D0003, True, B7F1, B7F2, B7F3)




TableUserView
(Username, TableBCode)
(User0001, B0002)
(User0001, B0003)
(User0001, B0001)
(User0001, B0007)
(User0002, B0004)
(User0002, B0005)
(User0002, B0006)
(User0002, B0007)




TableD
(Code, Name)
(D0001, NameD1)
(D0002, NameD2)
(D0003, NameD3)


TableA has approx 50 rows, TableB has approx 10000 rows, TableD has only 3 rows.


I want to make a page in the old .NET webapp using Lightstreamer. The page shows TableB with Field1,2,3,...etc and the view in each user page is based on user in TableUserView. Field1,Field2,Field3,...etc is updated frequently and every update is pushed to the client browser. If I delete (User0002,B0004) and (User0001,B0001) in TableUserView, B0001 and B0004 will be unsubscribed automatically in the User0001 and User0002 page respectively. Then if I add (User0003, B0004) and (User0003, B0001) in TableUserView, User0003 will automatically get B0001 and B0004 subscribed in his page. Then if TableB[Code=B0007].IsActive is set to false, both User0001 and User0002 will unsubscribed B0007. There are 1000 users in the system access TableB simultaneously, so each user may have different view based on TableUserView.


Based on the information above, how can I design the adapters in .NET and how is the subscription design in Javascript? Can I use Portfolio example for this case? In Javascript, FieldsLevel1 use COMMAND mode subscription with subscriptionID is username and FieldsLevel2 use MERGE mode subscription with each subscription corresponds to each TableB Code, is it OK? Actually is there any maximum number of subscriptions considering that too many subscriptions will make LS performance becomes poor? And suppose B0006 has already been unsubscribe from LS because there is no user subscribe it anymore, will B0006 be destroyed in LightStreamer Server? I notice that a new subscription is created at the first time, but it will never be destroyed after unsubscription.
Because TableB has 10000 rows, may I split them for 3 data adapters based on TableDCode (3 rows) and each data adapter has many workers (threads), each worker collects TableB rows with the same TableACode? Note that each user is only allowed to view TableB rows with the same TableDCode.


Sorry for the messy information and questions.




Regards,


Justin