Several questions, such as this one, discuss whether to store only lat/long in the database & calculate the street address every time it is needed, but they seem to miss a few points & seem to be opinion, rather than authoritative.
Hence this question, seeking a final, definitive clarification, with justification.
1) reverse geocode every time
pro – smaller database size (why should everyone duplicate Google's database?)
cons – might occasionally fail whereas storing the result will not
2) store address in the database
pro – less likely to hit a Google imposed limit on the number of requests
con – could be a large amount of data. A few hundred vehicles storing a new location every 5 minutes or so, 16 hours per day… probably more coding
If I take approach 2), I plan a new MySql table for addresses, indexed by lat/long and storing the street address. Every time a vehicle reports position, look for a matching address. If none, calculate & add.
In addition: later, when a client requests movement history, if the address is blank, attempt to calculate & store if found.
I am restricted to using a MySQL database.
Best Answer
You cannot legally cache or store results from Google's Map API (with pretty narrow exceptions).
From the Terms of Service (with emphasis added):
So option 1 it is, unless you only use the geocoding for the purposes described in the Maps API ToS, and only temporarily cache.