Hello and welcome to this episode of This is My Architecture.
I am Achraf from AWS and I am delighted to be here today with Charles from Pernod Ricard.
Hello Charles. - Hello, Ashraf.
- Charles, for starters, can you tell me about Pernod Ricard
and your role in the company?
- Of course. So, Pernod Ricard is the co-leader in wines and spirits.
So, we own great brands like Absolut, Chivas and Ricard of course.
And I'm a Tech Lead.
- That's great. Today you're going to tell us about your URL shortener service.
Which is known as "URL shortener", in English.
Can you tell me how it is used in your business?
- Of course. So, we use these URL shorteners for several purposes.
Notably for QR codes or NFC chips that we will apply on our bottles
and also on our social media posts.
- All right, great, well, let's move on to this beautiful architecture.
Let's imagine I'm in a supermarket and I have a bottle, I scan it...
what happens next?
- So, we're going to scan the bottle, here we have our users.
This request will be sent back to CloudFront.
CloudFront will then trigger a Lambda@Edge.
This Lambda will digest this request
and will query DynamoDB
in order to find the destination URL to which we want to send the users.
So, Lambda retrieves this data and sends back to the user the new URL to visit.
- But why do you use Lambda@Edge?
- First, Lambda@Edge allows us to be replicated worldwide by being attached to CloudFront.
And also, to use DynamoDB Global Table, which is also replicated
in order to gain efficiency and speed.
- All right. And how do you choose which DynamoDB table to send the query to,
from Lambda@edge?
- Well, we'll determine that from the CloudFront query. We're going to find out what region we're in.
Well, we're going to choose the Dynamo table in that region,
in order to make it more efficient.
- Great. I also see that there's a lot
of architecture involved. Can you tell me a little bit about that part?
- Yes, I can. So, we're going to get the CloudFront logs that we're going to send in an S3 bucket.
So, we're going to transform these CloudFront logs via a lambda.
We will convert the IP into a country, a city; we will convert the User-Agent
with data, such as the type of device, the browser...
and data that can be found in that data.
We will send all this to Firehose.
Then, once they're sent here, we're going to send them to S3.
- All right. And... So, once it's in S3, how do you use that data?
- Well, starting from this new user case, so the contributors,
who are going to visit a site first and request a Gateway API,
this Gateway API is going to call on Lambdas.
These Lambdas will allow us to manage all the user permissions
that we will store in RDS Aurora.
And also, to transform our short URLs that are in DynamoDB.
- All right.
- We're also going to be able to query the log data.
So, we're going to use Athena for that. So, Lambda's going to call Athena.
And it is going to query our data that's stored in S3.
- Okay. - That data on S3 will also be
ingested by Glue, which is going to transform the files
so that they're optimized for Athena queries.
- Great.
From Pernod Ricard's point of view, what were the benefits of this architecture?
- Well, the big benefit is that we've already become more efficient.
We started with a proprietary solution, which was a bit of a black box.
So, we regained control of our application.
Above all, we've gained in scalability,
we can serve all our customers worldwide.
- Right. And in terms of costs, has there been an impact on your costs?
- We've reduced costs almost by a factor of 100 compared to the previous solution.
- Oh, great. Cool. What are the future developments of this architecture?
- We're going to use the data transformation system we have here,
we're going to add it into our Lambda@Edge,
in order to use geographic and user data: which device, which browser
within Lambda@edge, in order to achieve multiple redirections.
So, I'm going to be in Singapore, and rather than sending me to the global
Absolut site, well I'm going to send the user to the right Singapore Absolut page
because I'm located in Singapore. - Okay. So, this is customization...
- Exactly. - ...and localization of content. That's great.
Well, thank you very much, Charles, for sharing your architecture.
And thank you very much for watching this episode of This is My Architecture.
I hope you enjoyed it.