[music]
Hi, welcome to another episode of ‘This is My Architecture.’
I'm Jack and I'm joined here by Aaron.
How are you doing, Aaron?
--Doing well. --Awesome.
So, you've got something pretty cool laying in your hands there.
You want to tell us all about it?
Absolutely. So, this is an internet connected small garden.
And I've got a little computer chip in there with an associated mobile application.
Sends you notifications on when to water and provides you guidance
on how to grow plants.
Excellent. So let's go through kind of,
what's inside the garden first.
So, what kind of AWS services do you have running in there?
Absolutely. So here on our garden,
inside we're running FreeRTOS
with a variety of Amazon libraries and SDKs inside of the garden.
We use it for device provisioning as well as the Device Shadow service
which sends consistent state across the rest of our architecture.
As well as you know, OTA updates, jobs frameworks,
that sort of thing. --Okay.
And how do those OTA updates, you know,
how do you provide connectivity to AWS?
Yeah, absolutely. So, from our garden we connect directly
to IoT Core. And we're using the,
again, the Device Shadow here to replicate garden state.
So you know, things here, right? We've got water level that comes in,
we've got relative humidity, we've got temp;
are all ratings, amongst others, that come from sensors on the device.
We have a variety of them. Two temperatures, you know,
relative humidity, water. We have an advanced water sensor.
There it's taking electrical connectivity readings
through the water and all that information is being sent up to Amazon IoT Core
through the Device Shadow. So, it sounds like you got a bunch
of sensors inside of the garden itself taking these,
--Yeah. --And then those get sent through IoT.
So, I imagine these are processed by Lambda and then sent
into Pinpoint. So, I imagine that's also the smarts
of the garden. --Sure, absolutely.
So, what's really important about IoT Core for us is the ability
to associate a topic rule.
So, we've got a topic rule here that monitors a MQTT.
You know, Device Shadow underneath the scenes is MQTT.
And so, we've got a topic rule that monitors a very specific Q
from a MQTT associated with updates and triggers a Lambda for us.
Okay. That Lambda is all about responding
to state changes of interest from the garden.
So if the water level goes down and gets really low,
then we're monitoring that with a topic rule,
a Lambda fires, and then it's going to go
over to Pinpoint and tell Pinpoint,
"Hey, the owner of this garden," users can have many gardens,
"The owner of this garden has low water." And so we need to go ahead
and reach out to them and let them know,
via push notification, that they need to do something
to address their low water. Ideally fill it.
Yeah, I've been told many times to fill my garden before.
So, tell us a little bit more about Pinpoint
and how the internal architecture of that works.
--Sure. --I imagine this couldn't have been easy.
Yeah, so, you know,
adjusting behaviors for us is really important
by the time you get down to the end user,
because although plants are pretty hearty,
they do require some amount of interaction from the end user,
and our way to do that is through Pinpoint and push notifications.
The Lambda here that listens to state changes
also mixes in quite a bit of metadata
from our other systems.
And these are things such as
the date, time of when the plant was planted,
the type of plant that was growing,
other information along those lines
associated with the particular garden and the particular user.
So if we were to get an update here,
a topic rule gets triggered, Lambda gets updated.
We combine all this information on Lambda Launch
into a table for Pinpoint
that is based on endpoint attributes.
And those endpoint attributes
guide Pinpoint for doing more complex workflows
through journeys, campaigns, segmentations.
So, it's a real nice decoupling from state,
which is sort of all this side.
And what IoT Core, our firmware and everything is just
sort of sitting here updating state, updating state, updating state.
And Pinpoint, when it hits an attribute of interest,
say we've got a plant that's on day 10 of growth,
and we know it's associated with this garden right here,
then what happens is Pinpoint has created a segment
off of that, and that segment then gets populated with all endpoints associated
with the owner of this garden, right here.
So this is kind of how, say,
I had a low water alert earlier this morning,
so I went and filled it. And so, does that make Pinpoint
effectively splice off into another journey?
Saying "okay, now this user has finally watered their garden."
Resume this journey." That sort of thing?
Yes, absolutely. Yes.
So, what happens is, as you described, we get a low water notification
and as opposed to knowing that the plant is on basil day 10 here,
and true. Instead you know,
we understand that water level is low.
You know, and we set another attribute
that signifies that water level is low and a journey can be watching a segment
or get a real-time event fired and launched the same way.
Again, notifying the user that they're out of water.
Got you, well you know, I'm glad this is around
so my plants don't die, but I do want to know,
is there anything new for ēdn with Pinpoint, Lambda
and the rest of the architecture that you have here?
Sure. So, what we're working on here is,
this is one part of our design
to encourage users to take care of their plants,
but as we all know, we have days of low motivation, right?
And what we want to do there is,
if you're constantly ignoring our notifications here,
we want to be able to push whether or not you have taken an action,
you know, check or not, and feed that back
through our API Gateway, associate that meta information,
and then the next time through, whenever we get any sort
of additional readings, these fire about every 10 minutes,
for our gardens, we'll notify Pinpoint.
And Pinpoint can get a little bit more aggressive
about how it asks you to water.
Or in the positive case, we're going to give you lots of credit
for taking good care of your plants.
Well, I'm always open to positive feedback.
Aaron, thank you for coming. --Thank you.
And thank you for watching another episode of
‘This is My Architecture.’
[music]