Hello all, welcome to an episode of 'This is My Architecture.'
My name is Ayesha, and with me today I have Brian joining us from ResMed.
- Hi, Brian. - Delighted to be here.
Brian, can you tell us a little bit about ResMed.
Absolutely yeah.
ResMed is a med-tech company which specializes in sleep apnea therapy.
So we build medical devices and digital solutions.
Recently, you underwent a major migration,
where you migrated your on-premises monolithic architecture
for your product, myAir, to a completely serverless environment on AWS.
Can you talk a little more about that?
Yes, myAir is our patient engagement platform.
So this consists of mobile apps, website,
a medical device, and our back end system.
And this allows our patients to engage and track their therapy.
Okay, so you brought your architecture with us, let's dive straight into it.
Absolutely yeah.
So the first thing, though, is this is a fully serverless solution.
And that's direction we wanted to go with for low operations costs.
So for any user here using our mobile app,
the communication is over Graph QL, M2 AppSync.
AppSync and manage Graph QL server.
We wanted to take advantage not just of Graph QL,
but we also wanted to take advantage of the synchronization infrastructure
that comes out of the box with AppSync.
We didn't want to have to rebuild this.
Any requests that come in here, they'll basically go through something called VTL,
which is a velocity translation language.
So this then basically writes it to a particular Lambda,
we have multiple Lambdas.
And then these Lambdas call into DynamoDB, to either write or read,
and they execute a bunch of business logic.
Okay, this slide there seems like a very robust architecture.
Can you talk a little bit about how you scale for this?
Yeah, absolutely yeah.
So these are all managed services, which really helps on the scaling side.
So we have about 60 million Lambda invocations every day.
And at peak load, we're hitting about 4000 Lambdas, concurrent Lambdas.
So it's incredible to see it in operation.
That's definitely very impressive.
Can you talk a bit about how does this IoT device right here fit into this architecture?
Absolutely yeah.
So we have our own EMM solution currently,
within them within ResMed which handles IoT.
The difference with this project is, is we now write this data,
and we publish this data real-time into Kinesis.
There's little bit of transformation, we get this data,
and then we write this into DynamoDB via Lambda polar,
which does a bunch of statistical analysis.
Okay, so it seems like DynamoDB right here,
is acting like a centralized repository,
not just for users pulling in data,
but also any data that you collect, based on their performance from the IoT device.
Is that right? That's exactly correct.
Okay, so how does SNS fit into this?
Yeah, so as soon as this data arrives in here,
we're taking advantage of DB Streams.
And what we're doing is we have another Lambda here,
and which essentially interrogate the data that's just been written,
to understand what is the most important information that we need to tell the user
about how they slept last night, or any issues they were having.
This then puts it onto an SNS topic.
And then this gets sent out to the user,
either as a push notification, or we can send an email off to SES.
Okay, so not only are users tracking and monitoring their health performances,
but they're also getting notified in real-time
based on any anomalies or any important information
that they need to know about their health.
Absolutely yeah, correct.
And was there any performance improvement
that you saw with this kind of deployment right here?
Yeah, so obviously, the database access is incredible, incredibly fast.
The data that comes through the system from the medical device.
So what happens when someone wakes up in the morning,
that's when we send up the data to the cloud.
Typically, in the past, it was taking a few minutes for this dataset to arrive.
So it was measured in minutes.
So right now, this data is less than 10 seconds to make it all the way to our system.
That's impressive.
And finally, I see CloudFront and S3 here.
So what are these two components doing here in this architecture?
Yeah. So within here, we have a lot of static content,
that we basically stored in here.
This static content is things like videos, images, and any other assets, which drive the mobile applications.
So we support currently, right now we support about 30 countries and 20 languages.
So potentially, any asset in here
could be represented 600 times based on that matrix.
So when a when the app calls in, we have CloudFront in front of S3.
So we have a Lambda@Edge here.
And this Lambda@Edge interrogates the headers within that request,
and determines what language, what country?
And it has a lookup table, which then basically tells CloudFront here,
this is the URL within S3 that you need to call,
and it calls that.
And then this reduces instead of having the 600 potential assets, we have about 60.
So 10X reduction, so for maintenance, that's very, very beneficial.
That's very, very impressive, Brian.
So I can see that you have users across 30 countries across the globe.
So anything that he wanted to talk about the global scale of this architecture?
Yeah, well, I mean, it scales incredibly
and a lot of it is out of the box because it's serverless.
So we didn't have to do too much tweaking on that,
and to be able to hit these numbers, it's just amazing.
Okay, thank you for sharing this with us, Brian.
No problem at all.
Thank you for watching, 'This is My Architecture.'