Skip to main content

Data Base application with JWS

3 replies [Last post]
manyce400
Offline
Joined: 2006-04-24

I come from a j2ee background. Am working on an application for a client which am considering building in JWS.

My only concern is how slow will fetching data from the remote db running on the server to the client app running on client machine. The client will have high speed access but I am researching ways to make this as fast as possible.

In what ways can this be done. We have to avoid actually installing the db on the client app for security reasons and all the problems associated with the desktop.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
neilweber
Offline
Joined: 2003-06-25

Running code on a desktop which queries a remote DB is pretty normal. There are a number of ways to do this.

You could go "fat client" and have the desktop code actually make a database connection and query the database. For very simple applications this is probably good enough.

You could go "rich client" or "service oriented architecture (SOA)" and have the desktop code make RMI or web service calls to a server. The server code would actually make the database connections and query the database. Results are sent back over the network. This approach is more complex than "fat client" because there are more moving parts, but it's generally the preferred approach.

SOA will probably give the best performance. For SOA, you can use Hibernate or some other caching mechanism to reduce database queries. If multiple fat clients connect to the same database, no caching can be done (there is no way to ensure the independent caches are up to date). With SOA, there will be only one cache and thus no synching problems.

Also, better performance is gained because the code that makes the queries will not have to go over the network to do so. For example, suppose you have some operation that needs to use the results of one query to perform a second query. In the fat client approach, the intermediate results are sent over the network while in the SOA approach, the intermediate results won't be.

I hope that helps.

Neil

manyce400
Offline
Joined: 2006-04-24

Cool, I like your response. It was really intuitive and helpful. Could you shine more light on how soa in particular will be more efficient and fast and also could you point me to any article for more info.

evickroy
Offline
Joined: 2004-07-23

[i]"Also, better performance is gained because the code that makes the queries will not have to go over the network to do so. For example, suppose you have some operation that needs to use the results of one query to perform a second query. In the fat client approach, the intermediate results are sent over the network while in the SOA approach, the intermediate results won't be."[/i]

One additional comment on this statment is that typically you would want to have the database server do any processing that required multiple result sets. Even in a rich client scenario since it wouldn't make sense to fetch data to a client machine, or a middle-tier server, to just process the data and send it back to the database. Letting the database handle this type of processing, if possible, is always the better choice.

Erik