- Every successful business
starts with a great idea.
Today, moving from concept to reality,
is easier than ever before.
Join us, as we travel around the world
to meet developers, architects, and innovators,
to learn how they're building on the AWS cloud.
Welcome, to "This is my Architecture".
This is Jakarta, the capital of Indonesia.
Located in the north west corner
of the most populated island in the world.
Rapid urbanization,
coupled with competitive investment in infrastructure,
has made traffic pretty intense around here.
That means getting to a hospital can sometimes take hours.
And that's just the travel time.
Hospital queues can be so bad,
some people make a living
holding a place in line for others.
In Indonesia there's only two doctors
for every ten thousand people.
It's no wonder most Indonesians
only consider going to the doctor when they're really sick.
So what if there was a way to see a doctor,
without having to get onto these busy streets?
Let me show you.
- Hello Adrian, so I'm Doctor Nisa,
show me how you feel today.
- Well Doctor Nisa,
I was, you know outside today, its quite a warm day.
And just outside (muffled speaking).
This is Halodoc,
a company and app,
that allows you to interact with a doctor
right from your phone.
So, how is Halodoc good for your patients?
- So you know, in Indonesia,
there are many people lives in rural areas, right,
and they have restricted access to health care facilities.
Some would have to travel hours
to get the the nearest health care facilities.
So, with Halodoc,
you can just minimize the travel things,
and then like in Jakarta
you have traffic jams all over the place, right?
So you don't have to travel,
and you get to reduce the waiting time
to get to the health care facilities, and go to doctor.
- That's fantastic,
thank you so much, doctor, for helping me today.
- Thank you Adrian, hope you get well soon.
- Thank you.
- An app that makes it possible
for a country of 264 million people,
with 50% internet penetration,
must have some serious technology behind it.
And now I'm going to find out how it works.
This is the nerve center at Halodoc,
where right now dozens of doctors are fielding inquiries
from all around the country.
As an island nation,
80% of calls are coming from outside the city
where access is much more difficult.
- And to learn about how all of this works,
I'm joined by Abhilash,
The Chief Technology Officer for Halodoc.
Hi Abhilash, thanks for joining me today.
- Thanks for having me.
- So, I'm really keen to get underneath
the covers of the architecture,
but before we do that,
tell us a bit about how it all started.
- At Halodoc, we started building our tech stack
about three years ago.
Our initial version
was a simple monolith, one compute,
backed by a simple database.
- Wow, and obviously, things have changed since then
as you've continued to grow,
so, walk us throw some of those changes.
- Since our inception,
Halodoc has started launching new business lines,
one of the business lines is you can buy medicines online.
Second business line is you can talk to doctors online.
As soon as we started launching new business lines
it was obvious to us a monolith will not cut it
and we had to go the micro service route
as soon as possible.
- So it sounds like,
all these new interactions that your users were having,
became new micro services in your architecture.
- Each micro service has a couple of compute instances,
backed by assistance, we use RDS MySQL database.
So, one group could be buying medicines online,
the second group could be talking to a doctor online.
And so on and so forth, at the moment,
we have 40 to 50 micro services on production
- So you've gone from using a single class of EC2 instance
to now having multiple different classes
based on user interactions.
Given that each of these micro services
have their own databases, I'm keen to understand,
how did you think about data partitioning?
- For certain use cases,
we had to ensure that the data is consistent
across different micro services.
A good example is, users' data.
As a user, you could buy medicines or talk to a doctor,
and these belong to different micro services
so what we did was we used DynamoDB
to save all of our user data.
- So I imagine,
all of these services would use identity quite often
so having a low latency database,
and being able to share that across all these micro services
is a big benefit.
Now I see another service there,
the simple notification service, something that we see
quite often in micro services architectures.
How are you using it?
- So when we started our micro service journey, I believe
it was when we had about 10 micro services on production,
we started noticing that we were having
unnecessary tight coupling between our micro services.
One micro service would know about the other micro service
and would do a sync call.
Right, so we wanted to kind of avoid that
and bring in the asynchronous flexibility.
So we essentially decided to build an event bus,
and that's where the SNS journey started.
- Now, you've obviously gone from virtual machines
to micro services.
But I see you've gone even further,
and you're using server-less technology,
so I'm keen to understand what is Lambda doing over here?
- Oh, lets take an example,
lets say you spoke to a doctor,
and doctor issued a electronic prescription to you, right?
So, the consultation service would raise an event into SNS,
and SNS would trigger Lambda.
- Right, so you're using Lambda
to go and curate some of the data in your event bus
but, also to create some stuff here as well.
- And then, so, the Lambda enriches the event raised,
it pulls medicine names, the doctor name, the patient name
and then generates the PDF,
which can be used by the patient to buy medicines.
- Fantastic, now what is this second Lambda doing over here?
- So one of the business use cases we had
is real time visibility on how certain metrics are doing.
For example,
availability of a doctor,
how many consultations a doctor is doing,
and so on and so forth.
That was a requirement from the business side.
So the way we solved it is,
each of these micro services would raise events,
it would go into SNS,
from SNS we would send it to Lambda,
Lambda would do the enriching we spoke about earlier,
and once the data is enriched it would go into Kafka,
and on top of Kafka we built Flink,
then an elastic search, and then Grafana for visualization.
- The genius of Halodoc,
was a merging of a network of doctors and pharmacists.
They connect 22000 doctors and 1500 pharmacies,
across 50 cities in southeast Asia.
After a teleconference with a patient,
doctors upload the medical prescriptions
to the pharmacists,
where they can be picked up and delivered.
Good morning.
- Good morning
- So, Elisa how has Halodoc changed your pharmacy business?
- So how is it easier for your patients?
- That's great, so how does it all work?
- So these are the Gojek drivers,
they're the ones that pick up the medicines
that patients need and deliver them
right to their front door.
And Teddy over here--
- (speaks foreign language)
- Is going to show me just how it's done.
Let's go.
- Okay.
(high intensity percussion music)
- These Gojeks are small, swift, and very maneuverable.
They can get potentially life saving medication to patients
in under 40 minutes.
No wonder they're so popular.
And it's all part of a growing sector of the economy,
ride sharing.
- Another expanding sector of the Indonesian economy,
is eCommerce.
Each has increased by 60% over the last five years,
and Halodoc is riding both those waves.
So Abhilash,
it's clear that Halodoc really deals with a lot of data,
not just in volume, but also in type.
Let's start with what you do with the transactional data.
- [Abhilash] So from all the individual RDSs,
we are moving the data into Redshift using DMS.
- [Adrian] To the Database Migration Service?
- Yes.
And on the Redshift, the business analyst can run queries
for monthly reports or weekly reports,
and things like that.
- Fantastic,
obviously a very scalable data warehouse solution.
Now how do you keep that RDS instance performant?
- We want to ensure that medical records are saved.
We want to ensure that historical record is kept safe,
so the way we do it is from RDS
older data gets moved into Glacier,
for record keeping.
- I imagine a lot of your analysts
want to ask questions about how the business is operating,
tell me a little bit about how you help them.
- Good question,
so lets say I'm an analyst who is responsible
for ensuring them there are enough doctors on the platform.
I want to know how many doctors that are online,
at the given moment.
For this we built out a real time pipeline,
so the data from Kafka,
gets ingested into Elastic Search,
which acts as the persistent layer,
and for the visualization,
that's what the analyst is going to use,
we are going to use Kibana and Grafana.
- I've noticed that you're using a lot of
open source software here,
why is that?
- Open source, there were two reasons
one is the comfort developers have with the tool,
and second is the customizability,
and the flexibility these tools offer.
- When I was using the app,
one of the things I really liked,
was the different ways I can actually interact.
And one of those ways was I could actually upload photos.
Let's dig into how you manage that large image repository.
- Sure, let's say you're talking to a doctor,
or a dermatologist in this case, and you have a skin rash,
so in the app you take a photo of your skin,
and upload it to the S3 bucket, right?
So once the image is uploaded to an S3 bucket,
so it kicks in the image recognition algorithm
where we try to determine
whether this is medically relevant or not.
- So why actually filtering the images?
- We want to ensure that the doctors on the platform
do not get inappropriate images
from the users.
- And Rekognition is automatically trained to be able
to remove potentially unsafe images in the repository.
- Yes, when we checked it on our data set,
we found that we didn't have to retrain the model,
because the Rekognition did a really good job
of classifying the images.
- Health care is not a single product,
but a series of interactions
between patients, doctors, pharmacists, and drivers.
This was all previously done by hand.
Halodoc had to create
all the connecting tissue to make it work.
- Abhilash, five million users in just three years,
you're changing the face of healthcare in this country,
but I'm curious to understand
what were some of those challenges
that you've had to overcome along the way?
- When we started building technical solutions
for business problems,
we kind of had to challenge a lot of assumptions.
When we launched ability to talk to a doctor online
we kind of assumed that
the data connectivity would be solved for us.
But when we actually launched,
we were seeing significant error rates up to 20%,
but then we moved our stack to cloud,
and to the MQTT protocol,
after that we saw significant success.
- What is some of the other interesting areas
that you want to take your product into?
- Technically, two areas that we are focusing on
is on containerization and Kubernetes,
and a lot of investment around AI/ML,
because we believe that its going
to kind of empower the whole ecosystem.
We want to kind of personalize our app and website
to who the user is.
To give one example we have health content,
we don't want the same health content
to be served to all users,
for example, if you're a diabetic,
we want to serve this diabetic content for you,
and we believe that we can achieve that using AI/ML.
- What is the future for Halodoc?
- At Halodoc we believe that we can use
the power of technology to change healthcare in Indonesia.
We are working with Bill and Melinda Gates Foundation,
we have about 40000 midwives on the platform.
We are building technology solutions
to better enable midwives to give infant care,
in rural areas.
- That's fantastic,
a big vision, not just for Halodoc,
but also for this great country, Abhilash thank you so much
for letting me share this day with your team,
and also with yourself.
- Thanks a lot.
- I've learned a lot here
in the last couple of days,
and the citizens of Indonesia are learning too.
With access to healthcare in rural areas
so difficult to access, and with busy cities like this,
Indonesians now have an option,
Halodoc is changing things with its convenience,
and time savings.
So, if people did more of this,
they could avoid a lot of that,
saving lives in the process.