Tell me more ×
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.

Let's assume that we have a simple GIS-like application, which presents (using Google Maps or anything similar) recorded tracks. Each track consists of points (data portions) with geo-data and additional information, like speed, altitude and similar.

Basing on these additional params, I want to calculate some extra information, like average speed. What kind of data should web client receive and on which side is it the best to perform necessary calculations:

  • client side: client receives (via AJAX) pure array of data (points with additional params) and all the calculations are done in Javascript in browser,
  • server side: client receives a content ready to be put to propers places, like value of average speed, and all the calculations are done on server.

Personally I was always choosing (somehow automatically) first option, as I thought (correctly, if I'm wrong) this gives me more flexibility. But, right now, after reading some docs and pages, I can see clearly, that I may be wrong. So, what is the best practice in such situation?

(please, migrate to GIS, if I asked this question in incorrect place)

share|improve this question
Are the tracks pre-recorded? How likely is it that they'll change? – Yannis Rizos May 13 at 9:39
2  
How many points are we talking about? Is it quicker to download the raw data (mobile? 3G?) to the device then do the calculations, or is it better to do the calculations server side and just blip down the few bytes that the user will actually see? – Dan Pichelman May 13 at 13:25
@YannisRizos: Very likely. Future version of web app should even allow on-line update of track being recorded as viewers watch it. – trejder May 13 at 18:35
@DanPichelman: Points array size may of course vary, but at this stage of app development (design) I assume average track to have between 500 and 5000 points. – trejder May 13 at 18:38

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.