Using MongoDB to store your device’s tracking data
MongoDB is a document-oriented NoSQL database that stores the information using JSON format. It also has the capability to store location data. In this use case, we are going to use MongoDB to store our geolocation data; this means storing all coordinates (latitude and longitude) that the GPS captures on the devices for later reports. MongoDB can perform some special manipulation for geolocation data, but in this case, we will use it just to store data in JSON format. To install MongoDB in the cloud, follow the next steps:
- Create a PersistentVolumeClaim for MongoDB, to persist data:
$ cat <<EOF | kubectl apply -f - apiVersion: v1 kind: PersistentVolumeClaim metadata: name: db-pv-claim-2 spec: accessModes: - ReadWriteOnce #storageClassName: your_driver resources: requests: storage: 5Gi...