Using Redis to store GPS coordinates data
As we explained in Chapter 10, SQL and NoSQL Databases at the Edge, Redis is a key-value database that is pretty lightweight when using resources. Redis exclusively uses RAM memory to store its data but can persist when using snapshot configuration, which basically stores this data on the disk. Redis can also store geolocation data, storing GPS coordinates and tuples with latitude and longitude values. Redis stores this information with the field’s latitude, longitude, and a name. Redis also calls this data a geospacial index. Redis also includes the ability to return coordinates close to a circular area with this type of data. In this use case, Redis will be used to calculate all this information. For this specific use case, we are going to use the GEOADD
and GEOSEARCH
commands to implement our geolocalization application. But first, let’s install Redis in the cloud to store some geolocation data. For this, follow these steps...