views:

117

answers:

2

Is it best to use a webservice to pull data from a database and load it into my entity object, then send the entity objects to my winform app?

Will this make any performance difference over going direct to the database and pulling a datareader back to the winform client, then loading the entities on the client? Some of the users will be in China accessing a database in the US.

Are there better options?

Thanks

A: 

This is subjective, but in general, you will find better performance going directly to the database. That's not good for separation of concerns, however.

Given the highly distributed nature of your system, using web services (or at least an SOA approach) makes sense to me. However, I would go an extra step and have the business logic in at the web services tiers, not just data access, but again, that depends highly on the situation. I just think that the less places you have to change code and re-deploy to if coding changes are needed, the better,

Is there a reason this has to be a client app and not a web application? it would make keeping your distributed users up-to-date a bit easier.

David Stratton
A: 

The best option is probably to have distributed databases and/or distributed servers. No matter how you go from a client app in China to a database in the US, the network will be a massive bottleneck and performance will likely be pretty horrible. If you can put a replicated database in China, that would make a huge positive difference.

Whether you have a webservice or not is not going to be a huge factor here. Sure, adding a webservice adds a network hop, which is going to negatively impact performance, but as I said, I don't think that will be your performance bottleneck.

Michael Maddox