The new byTimeRequest (will be named as byGeoTimeRequest) returns {geoID, day, count}. Caching datasets dsStatePopulation, dsCountyPopulation and dsCityPopulation: {geoID, population, …}, we can obtain map results (byGeoRequest results) {geoID, count, population} from byGeoTimeRequest.
HTTP Request
There are currently 2 approaches to this issue:
(a) Send JSON request to datasets
(b) HTTP request to local files
Although the retrieve from database design would work, we decided on the taking the http request approach for the following reasons:
(1) Low ratio of access to the datasets
Since the main goal is to replace the byGeoRequest with byGeoTimeRequest and a population cache module, the population dataset is not accessed as frequently as before. The byGeoRequest requests from population datasets once per user movement, whereas in the current case, each geoId is accessed at most once during one section of using Cloudberry.
(2) Faster local access
Http request to local population data is in most cases faster than a json request, it also does not require the time and space for data injection to the database.
Therefore, it may not be necessary to inject them to the database.
p.s. A similar case is the geo polygon load.
Overview
The new byTimeRequest (will be named as byGeoTimeRequest) returns
{geoID, day, count}
. Caching datasetsdsStatePopulation
,dsCountyPopulation
anddsCityPopulation
:{geoID, population, …}
, we can obtainmap results
(byGeoRequest results){geoID, count, population}
from byGeoTimeRequest.HTTP Request
There are currently 2 approaches to this issue: (a) Send JSON request to datasets (b) HTTP request to local files
Although the
retrieve from database design
would work, we decided on the taking the http request approach for the following reasons:byGeoRequest
withbyGeoTimeRequest
and apopulation cache module
, the population dataset is not accessed as frequently as before. ThebyGeoRequest
requests from population datasets once per user movement, whereas in the current case, each geoId is accessed at most once during one section of using Cloudberry.Therefore, it may not be necessary to inject them to the database. p.s. A similar case is the
geo polygon load
.Experimental Results
Based on the results in the following link, this change will decrease the time on waiting for cloudberry server response: https://docs.google.com/spreadsheets/d/1fmmRAUjLcdHqb7C6Q8BGLuGU_PM5rzFLiYRgQBNKtoA/edit?usp=sharing