client/server app: how?

Hi experts

I'm creating an application to schedule vehicles. it will be created with sql server 2005 and c# using winForms.
so basically it's a simple thing. client talks to server etc.
but: I need almost live updates. If User1 modifies a record all other users should be notified as soon as possible about the change.
Secondly our application (or server) talks with an external server through an interface. the external server forwards our communication to the vehicles and they send messages back to the external server. so, those returned messages need to go to the clients (like above, as soon as possible).
so far so good.

My idea was to have our server talk to the external server and distributes incoming messages to the client (and vice versa) via wcf.
now the other thing would be distributing client updates to all the other clients.
Here I'm not sure whats the way to go.
I thought about database triggers, which call a c# app that notifies the clients about the updates (wcf).
Should the clients make direct call to the database (with dataset etc., quite normal) or should I send all calls to a service located on the server which handles it (seems a bit complicated to me, since I have never done a client/server app like described above).

What do you think?
Am I on the right track, or do you have some other/better ideas?

thanks
LVL 3
ArikaelAsked:
Who is Participating?
 
LopsyCommented:
Whether the clients make direct calls to the DB depends on the number of clients. If there are not many clients , u can keep it simple and request datasets to the clients.

On the other hand , a more robust solution will be to use a windows service.
The windows service will
1. poll your external server for the returned messages,
2. Keep those messages on the sql server database where the clients can fetch it.

For the clients to receive the messages,
1. U can use a timer interval to fetch d messages as datasets from the server to refresh the clients.
2. u can make d server drop updates as xml files in a location and then make the clients 'watch ' the location (using FileSystemWatcher ) for changes... if u dont want too many connections to your DB.

I hope i'v helped a little.
Let me know if u need further clarification.
Contrary to the belief, windows services are not complicated.
0
 
ArikaelAuthor Commented:
Hi Lopsy

There are only 5-6  people who will use this app heavily and approx. 4 users who will use it from time to time (every day)

You are talking about the messages from the external server, right?

what do you think about updates coming from the clients itself (inserts, updates etc.).
Would you do that directly or also via a windows service?
0
 
Carl TawnSystems and Integration DeveloperCommented:
It sounds like SQL Notification Services might suit your needs.

An introduction can be foudn here: http://www.codeproject.com/KB/dotnet/sqlns.aspx
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
ArikaelAuthor Commented:
thanks

sounds interesting.
Am I correct that all I have to do on the client side is registering a listener which will automatically detect changes?
Does it detect every change which would affect the query I used in my command?
like here -> http://support.microsoft.com/?scid=kb%3Ben-us%3B555893&x=17&y=21

Unfortunately microsoft decided to remove this feature in sql server 2008, do you know if sql server 2008 offers similar capabailites. Just in case we'd update to sql server 2008 in the future
0
 
Carl TawnSystems and Integration DeveloperCommented:
Couldn't really tell you the specifics as i've never used it in anger, i'm just aware of what it does.

Microsoft have released a component pack which adds SSNS support to SQL 2008, so its there if you need it. Their idea is to replace the functionality by extending Reporting Services, but i don't think it's quite there yet.
0
 
ArikaelAuthor Commented:
thanks

I digged through some articles about notification services.
But I fear that our application will cause very much traffic.
There are actually only 4-6 people who use it as their primary tool. But they update data very often (worst case: every 10 seconds is an update to a record).

I don't know if realtime communication is even possible without performance issues.
0
 
StealthyDevCommented:
The best method would be something like this:

  1. Use a timer control to update the client interface for about 1/2 minutes. (Use XML)
  2. Provide a Refresh / Sync button to the client which they may click whenever they require updates.
  3. Put all your logic in the server (not in client), may be you need to use XML transactions. (If you rely on SQL, use Procedures) (Even if client lies you, SQL throws it as an exception)
Regards.

0
 
ArikaelAuthor Commented:
thanks for your advices
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.