Live data from Hacker News

Avoiding Flat Tires in your Web Application

phase2technology.com

11–14 of 14 posts

Re: Avoiding Flat Tires in your Web Application

#11

Interesting, and useful info. I am developing a similar application with a map and live data generated dynamically by my server. The difference with my app, is that the data will be global, not for one city. The Citi Bike Map appears to load all of the data available regardless of map extent, which can be practical with a small dataset. How do you deal with caching when the extent of the user's map is constantly chan…

You should look into vector map tiles! Basically, you create a little JSON snippet for every image that the map server returns, and then overlay it in the client. There's support for JSON tiles in Polymaps ( " rel="nofollow">http://polymaps.org/> ).

Cool! I've not heard of Polymaps before, and will look into it. For the time being, I am using Google Maps.

Do you have any recommendations on how to create the tiles?

The most important thing, is that when a user clicks the markers in my map(whether or not they are real vector markers or rasters passing themselves off as markers), the marker's associated attribute values need to be available to be fed into a popup.

Re: Avoiding Flat Tires in your Web Application

#14

Earlier quoted context omitted.

I wouldn't worry about the caching, as your app is unlikely to get the same news coverage as the citi bikes program. I think the author misdiagnosed the citi bikes problem. My guess is they just had too few apache processes. If there was just one database table, the database's query cache should have been able to handle this load. His suggestions of cron based caching are likely redundant and overkill. Even if that w…

Are you saying that PostGIS has a way of handling the marker clustering rather than dealing with clustering in the browser (like I am now doing)? If so, that would lighten up the data being sent back from the server significantly.

yes!see here: http://workshops.opengeo.org/postgis-intro/clusterindex.html
Post reply on HN