Strategy for big queries

Asked

Viewed 31 times

-1

I’m working on an application that features a map and needs to render hundreds of thousands of markers. The data for rendering is in the database and the query is costly.

There is also the challenge of rendering all these markers on the map without harming the speed of the application, which has been a problem.

One of the implementations I made was a conditional rendering according to the part of the map that is being viewed by the client, so the application will render everything little by little (still has the problem of in case the user gives a zoom-out very quickly, which will be treated).

Bottom line: all markers need to be rendered (filtering is not an option). I’m thinking of bringing this data gradually, a kind of pagination but it’s still unclear to me the interval and Trigger that will trigger a new request to fetch more data (It is not like a conventional paging where the client navigates through information pages and a next request is tied to a click action for example).

Is there a more assertive strategy for these cases?

1 answer

0


An idea for you:
Since you have no code, images and other things to describe better I won’t be able to help you much.
But an interesting idea is to render the markers by level, equal to the rendering of google maps.

for example, if Voce is with a zoom-in high, are loaded all the streets of the screen, but if you give a zoom-out higher the map does not carry all the streets of that area, but only relevant data that will be seen as blocks, neighborhoods or city depending on zoom size.


Although there are thousands of restaurants in that area only 1 has been rendered Embora existam milhares de restaurantes naquela area apenas 1 foi renderizado


But as you zoom in it renders more points

Mas a medida que você dá zoom ele renderiza mais pontos

Like I see that you want to render hundreds of thousands of markers, How to view all of them at once would not be very feasible, depending on the Voce zoom can show a Marker in some locations with the number of locations in that region. and as you zoom in you pull from the database more markers just from a certain quadrant (where is the viewer’s view).

Although the idea seems simple, applying it can be very complex even with a high level of knowledge.

but I hope to have helped you at least give you a light.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.