Was this page helpful?
This guide will show you how to create an IoT app from scratch and configure it to use Scylla as the backend datastore. It’ll walk you through all the stages of the development process, from gathering requirements to building and running the application.
As an example, you will use an application called CarePet. CarePet allows pet owners to track their pets’ health by monitoring their key health parameters, such as temperature or pulse. The application consists of three parts:
A pet collar with sensors that collects pet health data and sends the data to the datastore.
A web app for reading the data and analyzing the pets’ health.
A database migration module.
You can use this example with minimal changes for any IoT application.
migrate
- Creates the CarePet keyspace and tables.
sensor
- Generates pet health data and pushes it into storage.
server
- REST API service for tracking the pets’ health state.
The example application uses Docker to run a three-node ScyllaDB cluster. You can also use Scylla Cloud as your database. Claim your free Scylla Cloud account here.
Each pet collar has sensors that report four different measurements: temperature, pulse, location, and respiration.
The collar reads the measurements from the sensors once per second and sends the data directly to the app.
The application has two performance-related parts: sensors that write to the database (throughput sensitive) and a backend dashboard that reads from the database (latency sensitive).
This example assumes 99% writes (sensors) and 1% reads (backend dashboard).
SLA:
Writes: throughput of 100K operations per second.
Reads: latency of up to 10 milliseconds for the 99th percentile.
The application requires high availability and fault tolerance. Even if a ScyllaDB node goes down or becomes unavailable, the cluster is expected to remain available and continue to provide service. You can learn more about Scylla high availability in this lesson.
Using the ScyllaDB Cloud Terraform provider, you can easily spin up new ScyllaDB Cloud clusters. Complete this tutorial quicker by creating a new t3.micro
cluster (the smallest instance) in ScyllaDB Cloud. Go to Deploy in ScyllaDB Cloud with Terraform for instructions.
Scylla Essentials course on Scylla University. It provides an introduction to Scylla and explains the basics.
Data Modeling and Application Development course on Scylla University. It explains basic and advanced data modeling techniques, including information on workflow application, query analysis, denormalization, and other NoSQL data modeling topics.
Scylla users slack channel
Add Sizing
Add Benchmarking
In a real-world application, it would be better to aggregate data in an internal buffer and send it once a day to the application gateway in a batch, implying techniques such as delta encoding. It could also aggregate data at a lower resolution and take measurements less frequently. The collar could notify the pet’s owner about suspicious health parameters directly or via the application.
Add location tracking info to send alerts when the pet enters/leaves safe zones using known WiFi networks.
Use the measurements to present to the pet owner health alerts, vital signs, sleeping levels, activity levels, and calories burned.
Was this page helpful?
On this page