views:

80

answers:

3

Hi, Currently we got a web service up and running that handles all our C.R.U.D calls to our database, and pretty much every interaction between user and the database.

(starting with checking the database to see if there's an update for the particular version of the end users application, checking credentials, checking/reading various other application settings, ect, ect)

Pretty much everything our desktop application does (written in c# with WPF .net framework 3.5) it makes a call to the web service. Problem is that on slower machines this takes way too long. Some of users have to wait up to 3 minutes for the app to cold start (this is probably partly because of .net frameworks slow load time...but the web service calls don't help anything).

I guess since our applications are more or less a fancy front end to a database (SQL SERVER 2005), should we be using something else to communicate with it besides a web service? What else is there? I choose the web service because it's the only thing I knew how to do. (besides connecting directly to the database) What do other similar apps use?

Thank You

A: 

Profile Profile Profile. Don't make assumptions.

Chris Marisic
+1  A: 

As mentioned by @Chris Marisic, first profile to ensure that the problem is in the web called. Assuming that it is, there are a few things you can try (I don't know WPF so you will have to see how they work with the framework).

  1. Batch similar items. For example instead of loading 1 row at a time from table (or equivalent), load several.
  2. May web calls asynchronous. If you have to send out a bunch of independent calls to the web service, send them asynchronously so that multiple requests are going across the network at once.
  3. Cache values. This can add a lot of complexity if you are not careful (depending on how much you care if the cache is up to date). The ability to listen to the server for changes (or the ability to have the server push changes) makes this one easier to handle.

I had a similar problem on a different framework and I got quite a bit of speedup just with #1.

Kathy Van Stone
Another thing I could add to your list since it is a very good list is potentially adding second level memcaching to the server so that the service is never waiting for database interaction. If you use an ORM like NHibernate many easily support adding second level caching.
Chris Marisic
A: 

By "web service" do you mean "SOAP service"? Profiling will tell you whether or not SOAP is buying you something.

It's likely that latency and (n+1) query is killing you. It should be easy to measure.

duffymo