Test map application developed on Node.js.
It requires the MAP_KEY environment variable set to the LocationIQ API token.
A small application that updates the UK map based on 2 independent continuous streams of events:
- around 2000 risk areas (Heat map) updated every second
- 100 moving vehicles updated every 2 seconds.
./readfile.sh {heatmapfile} | node server.js {lab} {vehicles} {rate}
*Lab = Type of simulation. Valid Values: 1, 2, both. Default: both
*Vehicles = Number of vehicles to track. Defaul: 10
*Rate = Vehicles real refresh interval in seconds. Default: 60
*example: ./readfile.sh test.csv | node server.js both 10 2
localhost:8080
-
I have chosen Node.js to implement this sample application due to its event-driven, non-blocking I/O model rather than one-thread-per-connection. For such an I/O-bound use case, I believe Node.js asynchronous programming model will be more scalable despite being extremely lightweight.
-
Push notifications using WebSockets. I believe only WebSockets (or Server-Sent Events) are viable options to meet the required UI update rate.
-
Binary protocol. Protbuf is used for client-server communication to optmise the bandwidth.