I have a spatial table in PostGIS that gets written (Insert/Update/Delete) by a production web app. Almost every minute there's write to the table. The app shows the geometry of the table on web client via database query in the form of 'untiled clear-text-geojson'. The BBOX extent depends on the current client's bbox.
This way of delivering geojson to client now proves to be not efficient as the geojson gets bigger as the points count grow. I would like to try different way. One of them is with Geoserver Vector Tile. I was thinking that with binary data and tile, the required data sent to client potentially becomes smaller.
So I published the table as geoserver layer and activated the 'application/x-protobuf;type=mapbox-vector' under the Tile Caching tab of the layer.
With OpenLayers 5.1.3 I could visualize the geometry from the table, based on this article.
Next I ran a small test with QGIS adding 2 rows (with points geometry) directly to the table. The aim is to get to know whether the points got rendered to the vector tile.
Here's the step (some with corresponding picture):
Add 1 point (point 'A') with QGIS into the PostGIS table.
- Panning left and right on the map does not change the VT to show point A.
Add 1 more point (point 'B') with QGIS into the PostGIS table.
- Panning left and right on the map does not change the VT to show point B (similar to step 3).
- Zooming-in exactly 1 level upto Zoom level 20, and stop. Now point B and A are shown.
- Zooming-out exactly 1 level to Zoom level 19. The tile shows only point A and not B.
Last step: a double check with another browser on another client machine shows exactly similar symptoms:
- Zoom level 20 shows point A and B
- Zoom level 19 shows only point A
- Zoom level 18 shows none of point A & B.
Now to the question:
How to make Geoserver render these added points to the tile that have been generated (and shown) before?
Is the above symptoms are normal with Geoserver Vector Tile?
Is Geoserver Vector Tile appropriate for the above use case (showing points in a table that gets written dynamically)?