Click here to Skip to main content
15,886,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Am going to make a application in C#, but am confused in few things.
Application is client server, i ll use WCF on server. problem is


1). dont u think having All record on server side ll make application very slow? i mean every time i save a record or get a large record from server for reporting ll make application very slow? what is alternate or solution for it?

2). What if Client got disconnected from internet for few hours how can i store records in offline mode. if i make local DB for temporary Records in-case of offline mode then how ll i synchronized?
Posted

Ans 1: Web-services/WCF services are very responsive once they are initiated, you can use them Asynchronously so that if larger amount of data is sent/received, a progress bar/indicator can be implemented. Next thing is implementation efficiency. Only required amount of data should be traveling between machines. e.g,
      a:   If your business layer uses intermediate results and then saves them back to DB, keep that logic on server side so that only final result should travel back to client.
      b:   Do your possible data validations on client side.
      c:   If you have to execute a web-method multiple times in a loop etc, create another method that contains that loop and executes that web-method as normal local method.
      d:   Implement Asynchronous calls of web-methods for responsive UI.


Ans 2: Above mentioned answer is very true. e.g. If you have added a record in local database and next possible primary key is assigned to it. Now suppose another client has added another record in local or global database capturing the same primary key because system doesn't know that you have captured that key at your local DB, what will happen when you will synchronize your records will global database, and if you are the first one to sync and done successfully, what other client will do having same primary ID in his local DB? These kind of problems are solvable but require alot of effort. People still rely on web applications even the exception of dead network is there, in the same way the user should tackle this problem and ask user to accept this genuine limitation.
 
Share this answer
 
1) It depends on what you are doing, but generally no. It is best to fetch as few records as possible from the server in any case.

2) Semi connected applications require a lot of thought and planning. Read the following (it is in vb.net) it will help you out : Northwind unplugged[^]
 
Share this answer
 
Comments
kiran dangar 20-Oct-11 4:40am    
Agree with Mehdi..
Mehdi Gholam 20-Oct-11 4:55am    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900