How Ryanair used S3 Object Lambda to deliver their COVID-19 wallet
Ryanair Holdings plc, Europe’s largest airline group, is the parent company of Buzz, Lauda, Malta Air and Ryanair. Carrying 149 m guests p.a. (pre Covid-19) on more than 2,500 daily flights from over 80 bases, the Group connects over 225 destinations in 37 countries on a fleet of 450 aircraft, with a further 210 Boeing 737s on order, which will allow the Ryanair Group to lower fares and grow traffic to 200 m p.a. over the next 5 years. Ryanair has a team of over 16,000 highly skilled aviation professionals delivering Europe’s No.1 on-time performance, and an industry-leading 35-year safety record. Ryanair is Europe’s greenest cleanest airline group and customers switching to fly Ryanair can reduce their CO₂ emissions by up to 50% compared to the other Big 4 European major airlines.
On 10 March 2021, Ryanair launched a new Covid-19 Travel Wallet, which is available from their mobile application. Ryanair customers can use the Covid-19 Travel Wallet to upload their negative PCR tests, Covid vaccination certificates, and other Covid documents that may be required for EU travel. Documentation uploaded by customers is securely stored in Amazon S3.
While allowing a single point to store and associate all Covid-19 documents to a passenger boarding pass, it also provided peace of mind in case the hardcopy was lost on the way or while navigating through the airport. This new feature included functionality inside the boarding pass that could be used at the gate by the staff to check the digital version or the hard copy.
S3 Object Lambda and the Ryanair Covid-19 mobile wallet
When you store data in Amazon S3, you can easily share it for use by multiple applications. However, each application has its own requirements and may need a different view of the data. For example, a dataset created by an e-commerce application may include personally identifiable information (PII) that is not needed when the same data is processed for analytics and should be redacted. On the other side, if the same dataset is used for a marketing campaign, you may need to enrich the data with additional details, such as information from the customer loyalty database.
With S3 Object Lambda, you can add your own code to S3 GET requests to modify and process data as it is returned to an application. This allows developers to use AWS Lambda functions to modify the data returned by standard S3 GET requests to filter rows, dynamically resize images, redact confidential data, and much more.
In the case of Ryanair, this new feature allowed a shift in the development effort into the backend in AWS rather than spending significant development effort in the mobile app. This allows their mobile app customers to store all Covid-19-related travel documentation in a centralized place within the application.
When downloading documentation from S3, conversion of PDF file types happens on the S3-GET request to ensure a standardized image format within the mobile application.
When customers request their boarding pass within the mobile application, a request goes to Amazon API Gateway, which initiates an associated AWS Lambda function to validate the request and authorize the process. The boarding pass is then generated with S3 public URLs and an associated TTL. The app will then be responsible for downloading all images to display at the boarding gate and/or border control.
“As early adopters we felt this was simple to integrate in a few hours for a single developer and worked smoothly,” said Joaquim Oliveira, Head of Mobile Development, Ryanair Labs, “For specific use cases it provides a useful extra layer for our serverless solutions.”
Architecture diagram of the Ryanair COVID-19 mobile wallet with S3 Object Lambda
Ryanair COVID-19 and S3 Object Lambda architecture explained
- Mobile app requests information for the reservation.
- API Gateway triggers AWS Lambda with the information supplied.
- Lambda generates boarding passes and S3 URLs for PDF COVID files.
- App requests COVID documents using the returned S3 Access point URLs.
- S3 Object Lambda checks if the PDFs have already been converted, if so, respond.
- If the PDF was not already converted to an image, Lambda converts, stores and responds with the image.
Reducing development effort
By shifting this logic to AWS and leveraging S3 Object Lambda, Ryanair was able to include PDF files without any app changes in under 3 days. Customers can use the Ryanair mobile app to move through a booking quickly. The Ryanair team initially evaluated S3 Event Notifications to invoke a Lambda function, but the time between the user uploading Covid-19 wallet documents and requesting the COVID documents wasn’t long enough for the invoke to be completed, which could have caused errors. This introduced another complexity level since the session time wouldn’t work for the vast majority of the users. It would require the Ryanair app to keep retrying the request until the transformed document was available in the given format, and until the documents were downloaded. Along with the extra work involved it would increase the number of requests and costs across services. Using S3 Object Lambda, Ryanair are able to transform these documents in real time without any visible delay for the end users, ensuring the data is available offline while at the same time keep the running costs low.
In this post, we’ve shown you how Ryanair leveraged S3 Object Lambda to move quickly and deliver important features in 3 days to support their return to serving customers. This allows their customers to have all the documentation they need at their fingertips on arrival to their destination countries.
“S3 Object Lambda is a great new feature for S3, bringing Lambda to the S3 request, and the timing was right on time for the development of our Covid-19 Wallet,” said Oliveira.” It allowed us to focus on developing new features for our mobile app and left the heavy lifting for AWS, in a seamless way for our customers.”
If you have any comments or questions, please leave them in the comments section.