Implement a cache to store geolocation queries

×

Statusmeldung

You are not a member of this team. If you want to be part of this team, click on 'Subscribe to this team'.

Currently we are exceeding our daily quota of queries (we use the Google Geolocation API for that, which allows us o do 2500 queries per day). We submitted an application to the Google for Non-Profit Program which if accepted will give us a much higher quota. This has been submitted and is now being reviewed by Google.

But even if we get the extra quota for free from Google, it's good to implement a cache to locally store these queries. This will help reduce the amount of queries and will make the platform more efficient (saving network bandwidth as the queries will be resolved locally via the cache). This ticket is about implementing this cache.

Kommentare

Bild des Benutzers Labdoo
Gespeichert von Labdoo am Fr, 03/31/2017 - 23:29

This is now implemented. As a result, we now see a reduction on the number of geolocation queries, bringing our current daily usage below the maximum quota. With this fix and our current traffic usage, we no longer exceed the quota which means that all our geolocation queries are now correctly resolved. See the attached usage quota showing the reduction throughout the past days (note: on March 29 i cleaned up the cache while doing some more debugging tests, that's the reason that day we exceeded the quota as our geolocation module had to repopulate the cache which takes a few hours.)

In addition to this optimization, we have also applied for the Google API Grant program for non-profits (https://support.google.com/nonprofits/answer/3367237?hl=en) to get a higher usage quota. Good news there too, we just got a reply that our application has been accepted :).

Code committed: https://github.com/Labdoo/Labdoo/commit/34b74296898b3b134610e73a8ef2e289...

Bild des Benutzers jordi
Gespeichert von jordi am Di, 04/11/2017 - 09:22

Since we were awarded Google's API Grant on March 31, we have been enjoying unlimitted geolocation queries, which means that we no longer get unresolved geolocation maps in some of the maps. Attached the new usage charts from March 31. As you can see from comparing this graph with the previous one (see previous comment), we are no longer constrained by a limit of 2,500 queries a day as we used to be. Specifically, on April 8th we had a day with a lot of activity (multiple dootronic taggings from different regions) and queries spiked to 11,351 in one day. On the other hand, you can also see the effect of the new cache implementation, which reduces the daily queries on normal days (around 1,000 queries, down from more than 2,500 without the cache optimization).