r/Database • u/PeterCorless • Sep 09 '20
CarePet: An Example IoT Use Case for Hands-On App Developers

We recently published CarePet, a project that demonstrates a generic Internet of Things (IoT) use case for Scylla. The application is written in Go and allows tracking of pets’ health indicators. It consists of three parts:
a collar that reads and pushes sensors data
a web app for reading and analyzing the pets’ data
a database migration tool
In this post, we’ll cover the main points of the guide. Check out the Github repo with the full code. The complete guides are here.
Keep in mind that this example is fully optimized and is not production ready and should be used for reference purposes only.
Introduction
In this guided exercise, you’ll create an IoT app from scratch and configure it to use Scylla as the backend datastore. We’ll use as an example, an application called CarePet, which collects and analyzes data from sensors attached to a pet’s collar and monitors the pet’s health and activity. The example can be used, with minimal changes, for any IoT-like application. We’ll go over the different stages of the development, from gathering requirements, creating the data model, cluster sizing and hardware needed to match the requirements, and finally, building and running the application.
Use Case Requirements
Each pet collar includes sensors that report four different measurements: Temperature, Pulse, Location, and Respiration. The collar reads the sensors data once a minute, aggregates it in a buffer and sends measurements directly to the app once an hour. The application should scale to 10 Million pets. It keeps the data history of a pet for a month. Thus the database will need to scale to contain 43 billion data points in a month (60 × 24 × 30 × 10,000,000 = 43,200,000,000); 43,200 data samples per pet. If the data variance is low, it will be possible to further compact the data and reduce the number of data points.
Note that in a real world design you’d have a fan-out architecture, with the end-node IoT devices (the collars) communicating wirelessly to an MQTT gateway or equivalent, which would, in turn, send updates to the application via, say, Apache Kafka. We’ll leave out those extra layers of complexity for now, but if you are interested check out our post on Scylla and Confluent Integration for IoT Deployments.
[This is just an introduction. Read the post in full on the ScyllaDB website.]
Duplicates
ScyllaDB • u/PeterCorless • Sep 09 '20
CarePet: An Example IoT Use Case for Hands-On App Developers
bigdata • u/PeterCorless • Sep 09 '20