Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Our front-end developers have requested that the RESTful Java web services to support delta queries. The use case for this is to handle periodic ajax refresh of the screen to bring in new data (deltas). I can see a few advantages of this:

  • Makes front-end logic simple (i.e. no complicated deduping logic)
  • Reduce network traffic (i.e. response size is smaller)

However, there are some concern as well:

  • supporting delta will require the service to be stateful, which impact scalability
  • heavy use of caching (results cached per user per query, to determine the delta)
  • heavy processing on the server

My questions are:

  1. Are there additional advantages of the delta queries?
  2. What's a good implementation to for delta queries that would eliminate some of the disadvantages (you can assume we are welling to drastically refactor our code)
share|improve this question

1 Answer 1

up vote 3 down vote accepted

supporting delta will require the service to be stateful, which impact scalability

Not necessarily. The front-end can provide state information back. After all, a list of results that's sent in pages is a kind of "delta" query. A request merely has to include a "maximum" key or timestamp. Something like ?max=last_seen_key. Everything after this is part of the delta refresh.

heavy use of caching (results cached per user per query, to determine the delta)

Not necessarily. See above. The client can send state information back to determine what was already seen.

heavy processing on the server

Completely false.

Are there additional advantages of the delta queries?

No.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.