?
Solved

Which is faster - Restful Services or regular queries?

Posted on 2014-04-03
1
Medium Priority
?
253 Views
Last Modified: 2014-04-12
Which scenario is faster?

Java (fx) front end communicating with a Derby database on a Glassfish server by
doing regular database queries (i.e. SELECT * FROM TABLE...)

or

Java (fx) front end communicating with a Derby database on a Glassfish server by
way of Restful Services / Servlets?

(Glassfish server is not local)
(database contains info such as names  and numbers)
0
Comment
Question by:pdering
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 36

Accepted Solution

by:
mccarl earned 2000 total points
ID: 39976961
There's not really enough information to say definitively, but more than likely the first alternative (direct database queries) is probably faster. I say this because in the second alternative, you still need to query the database, but you are just adding another layer to the process, ie. the REST service layer. However, the difference is probably so small that other factors would probably outweigh these, ie. the fact that your servlet could "hide" the implementation details of the database, and/or include common business logic for managing the data in the database in the one single place.

Where the situation might be reversed though (so that the second alternative might be faster), is dependant on exactly what you might be doing with the data. For example, say you are retrieving a substantial amount of data from the database and then operating on that data. In the first situation, you need to move all that data across the network from the database to the front end and so THIS may be the bottleneck, where as in the second alternative, the data is retrieved locally and THEN operated on before sending (via REST) just the small result of those operation to the front end.

So, as you can see, a definitive answer to your question would depend on a lot of factors!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question