If you want to build an app that utilizes data
from wearable devices like a smartwatch, stick around,
I'll show you the services that you need, to get your app off the ground.
Alan is the founder of Texila, a startup based in Rodney, Canada,
that wants to empower users with insights from wearable devices.
Alan wants to build an app
that notifies the user of abnormalities in their health data.
Let's hear from Alan.
Hello, I believe that we all can benefit tremendously
from the continuously monitoring of vital signs.
But the problem is that today's solutions are either too expensive, or reactive,
meaning either you have to get sick or be hospitalized
in order to have them prescribed to you by your physician, or caregiver.
But most of today's health conscious consumers
like to empower themselves to take charge of their health,
so they can manage it proactively.
I would like to build an affordable and highly secure solution
to help these consumers to do just that,
but using a smartwatch and a cell phone.
You also really have a secure access to your medical records,
regardless of your device, time of the day,
and wherever you happen to be in the world.
Thank you.
In this episode, I'll show you the services that can help you
ingest and analyze wearable data.
I'll also show you how to send push notifications to your users
based on data you define.
Let's dive in.
I'm assuming that the wearable devices that you're working with, have an SDK.
If your use case revolves around IoT,
then make sure you check out my episode
on building an IoT app at the bottom of the video.
Your app will ingest data from the user's device to the cloud
using Amazon Kinesis Data Streams.
Kinesis enables you to collect, process and analyze data streams in real time.
Kinesis Data Streams is just a feature of Kinesis.
If you're new to Kinesis,
I want to clear up any confusion on the features of Kinesis,
so when you hop into the AWS Console, you're good to go.
If you need to perform custom processing on your data stream,
use Kinesis Data Streams.
If you just need to move data from your data stream into AWS,
then use Kinesis Data Firehose.
You can use Kinesis Data Streams with Kinesis Data Firehose.
You would do something with the data in Kinesis Data Streams,
And then Kinesis Data Firehose would buffer the data
and send it off someplace.
This is common in these three use cases.
When you're starting out,
you might not know what data you actually want to keep.
you can analyze the data from the stream in real time using Kinesis Data Analytics.
Kinesis Data Analytics allows you to query real time data
using SQL or Java.
By the way, you can use Kinesis Data Analytics on Kinesis Data Streams,
or on a Kinesis Data Firehose.
When you use it on Kinesis Data Streams,
you can look at the data and decide if it's worth keeping.
The second use case for using Kinesis Data Streams with Kinesis Data Firehose
is when you want to aggregate data from the stream.
Let's say, you want to summarize a user step count every five minutes,
don't ask me why someone would want to do that.
Maybe someone wants to build an app
that encourages people to walk in place during virtual meetings.
Go back to that slide, can you go back to the side?
Yeah, I'm almost, I just need to hit by 1000.
All right, I'm almost there I swear, and then I'll be done.
You would build the application logic to aggregate the step count data
in Kinesis Data Streams,
and then push that data to Kinesis Data Firehose.
The last use case is when you're debugging your application
and want to replay the stream.
You can only replay the stream in Kinesis Data Streams,
before pushing it to Kinesis Data Firehose.
In all of these use cases,
you'll push the data from Firehose to Amazon S3.
S3 is durable object storage in the cloud.
There are other places that you can push the data to,
but for long term storage, I suggest using S3.
While all of this is going on, you might want to send a notification
to the user if something's abnormal in their data.
An example of this would be to compare the user's current heart rate
to their max heart rate per day for the past seven days.
If the heart rate is above the historic max,
then send a notification to the user.
Kinesis Data Analytics will trigger an AWS Lambda function
when anomalies in the data are detected.
Lambda allows you to run code without managing servers.
The Lambda function retrieves the data from the JSON message
and triggers Amazon Simple Notification Service.
Simple Notification Service is a scalable notification service in the cloud.
Simple Notification Service will send a push notification to the user
with detailed information about their heart rate.
You'll also want to create a process to store and analyze all the data,
so you can show your users' trends.
You'll want to think about your access patterns
in order to decide if you should just store the data into S3,
or if you need a database.
To help you make that decision, check out the video below
on how to pick the right database for your use case.
If were building this, I would go with a time series database.
Amazon Timestream is a fast and scalable time series database.
Now if you're used to using a relational database, you might be wondering,
why I'm recommending a time series database over a relational database.
With a relational database, you have to define a schema.
you might not know what the schema should be for wearable device data,
if the device manufacturer makes updates
for customers preferences change,
you'll want to change the data model.
Time series databases offer that flexibility.
Also, relational databases are inefficient at processing time series data.
A time series database like Timestream,
will have built-in functions that help you identify trends
and patterns in near real time.
The last piece is embedding visualizations of the user's health data into your app.
Amazon QuickSight is a scalable business intelligence service,
that you can use to embed dashboards into your web and mobile apps.
QuickSight can even use machine learning to detect anomalies in the user's health data,
and display those in an eye-catching way.
The entire architecture is serverless, which means you're not managing servers,
and compute capacity will automatically scale up and down.
You're also only going to pay for what you use.
I know I covered a lot.
Make sure you check out the links at the bottom of this video before you get started.
If you're building a health care app for the US market,
then you'll definitely want to check out my video on HIPAA.
I've dropped a link to that below the video.
Before you go there, I'll recap what I covered.
Use Amazon Kinesis Data Streams to stream and transform your data.
Analyze the data in real time using Amazon Kinesis Data Analytics.
Use Amazon Kinesis Data Firehose to buffer the data from Kinesis Data Streams.
Store your streaming data in Amazon S3.
If there's an anomaly, use an AWS Lambda function
to trigger Amazon Simple Notification Service
to send a push notification to the user.
Store and analyze all the device data in Amazon Timestream.
Embed fancy dashboards of the user's health data in Amazon QuickSight.
That's what you need to get your app for wearable devices off the ground.
It doesn't matter when you start, as long as you just get started.
Thanks for hanging out with me, see you soon.