Welcome to 'This is My Architecture: New Zealand.'
I'm Ondrej and here with us is Dean from Freightways.
Hi.
Dean, can you tell me about Freightways?
Yeah, absolutely.
Freightways is a leading provider of express package delivery services in New Zealand.
In fact, we deliver in excess of 50 million parcels around New Zealand
in a year both by land and air.
That's an amazing number of parcels.
How do the drivers scan them?
So they have these little handheld devices
that when they pick up the parcels or drop them off or put them in the depot,
they scan them so that allows us to keep track of the freight for our network.
I see. So what is the architecture that is funneling all this?
So scalability is really key to us because they don't scan consistently during the day.
So for the morning, when they come in they may have a peak.
We average at about 500 scans per minute.
During the busy times it jumps up to about 1,500 scans per minute.
So we need something that can cope with the difference in loads.
So, an API built in the Fargate service
allows us to consume those scans from the different sources
and persist them within the DynamoDB.
So the driver goes to Fargate and then stores it in the DynamoDB.
And what made you choose DynamoDB?
It was easy to integrate with,
it's performance copes with the different loads during the day,
it's really cost-effective,
and also allows us to feed on through DynamoDB Streams
to services down the stream that are interested in the scans.
Great to hear that it was a good fit for your use case.
So at this point you have the scans stored.
How do you process them after that?
We have a Lambda that picks it out of the DynamoDB Streams
and in fact then it passes it on to a...
down to SNS which then fans it out to SQS
for processing by other services.
I see.
That's an interesting pattern of having SNS with multiple SQS queues.
What made you arrive to this solution?
Well we have lots of different services implemented so it allows us to iteratively add new features to our stack
such as a service that processes all images that comes from the scans as well.
So it passes off to another Fargate service that does process images.
I see, so it enables your rapid feature development.
How did you start in this journey?
Did you start with this or did you have evolution here?
In fact, we started with Amazon MQ
but that wasn't able to cope with the 1,500 scans per minute.
So we were able to pivot fairly easily to SNS and SQS
which is also a software as a service so that's quite attractive as well.
I think that's a great example of where you have been able to change the integration of the services
when the business needs arise.
So, what does this bring to your customers? Why are you doing all this?
Visibility.
Visibility of the freight is really key to us.
One of our key metrics is that freight is available 95% of the time
within five minutes of arriving on the scan and being on our public website.
This infrastructure has actually allowed us to hit, pretty consistently, a 99% of the freight
is visible within five minutes.
So that's been really successful.
I think that's great.
I know that I love to see where my packages are when I order things,
especially during Christmas and on Black Friday.
I can imagine that's a super busy period for you. How do you handle that?
Christmas is a really busy period for us,
a massive increase in freight.
So all this infrastructure here has allowed us to go
from an average of doing 500,000 scans a day
to jumping up to 1 million, in excess of a million.
And all the technology we trace scales really well and just happens by magic.
Wow, this is an amazing jump
and all that with the ability to rapidly add features and scale up and down.
Thank you for sharing this architecture.
Thank you.
Thank you for watching 'This is My Architecture.'