Customer Stories / Travel & Hospitality / United Kingdom, France, Italy, Spain 

2024
Trainline logo

Reducing Complexity and Costs Using Amazon CloudFront with Trainline

Learn how Trainline, a global digital rail and coach ticket sales app, migrated its CDN infrastructure using Amazon CloudFront.

18 months

to migrate all CDN infrastructure to AWS

100% automation

of CDN

Reduced time

to onboard new domains from days to hours

Increased security

observability and monitoring

Optimized

costs

Overview

Getting from point A to point B is much easier for travelers when they can use their phones to gather routes, prices, and travel times. Trainline, Europe’s number-one most downloaded rail travel app, has over 55 million cumulative app downloads and makes it simple for its customers to search, compare, and buy rail and coach tickets from more than 270 operators in 40 countries. To satisfy 24/7 usage and security, the company’s website and mobile app needed a highly available and scalable content delivery network (CDN). Trainline met those demands by consolidating its CDN infrastructure using Amazon Web Services (AWS).

Trainline began evaluating using a different CDN provider in 2021. It decided to use Amazon CloudFront to securely deliver its static and dynamic content with low latency and high transfer speeds. Trainline migrated all its CDN infrastructure to AWS in 18 months. The single-solution approach helped the company streamline business operations, offer efficiencies, improve security observability and monitoring, and optimize costs. Trainline reduced IT effort around working with multiple vendors and manual configurations while maintaining 24/7 availability.

Woman working on mobile phone in the station

Opportunity | Using Amazon CloudFront to Remove Manual Upkeep of the Trainline CDN

Launched in 1997 and headquartered in London, Trainline is a one-stop shop for European train and coach travel. In 2024, the company celebrates the twenty-fifth anniversary of its first website. Trainline launched its mobile app in 2009, has offices in London, Paris, Edinburgh, Milan, and Barcelona, and has more than 1,000 employees from over 60 countries.

Prior to the migration, Trainline worked with third-party vendors, each managing different services, such as hosting infrastructure, issuing certificates, or logging and hosting the company’s CDN. The setup was challenging to manage and required manual upkeep from the Cloud Operations teams. For instance, the CDN service provider handled all logging, and if Trainline wanted additional monitoring rules, it had to wait for the provider to make those changes. The company also wanted increased visibility into all its traffic and direct alerts to any suspicious activity. To make updates to certificates, Trainline had to submit a request to another provider and wait for it to be fulfilled. Troubleshooting the complex setup required specialist knowledge of each third-party tool, which involved a steep learning curve for new engineers. The company acknowledged this complexity as a challenge that it wanted to solve.

Trainline was already working on adopting a cloud-centered approach using several AWS solutions, and in 2021, it decided to investigate alternative CDN providers. The company spent the first 6 weeks planning, researching other CDNs, assessing and mapping configurations, and testing Amazon CloudFront with a proof of concept. “We were looking ahead to fit this within our overarching strategy of implementing infrastructure as code as well as streamlining our key functionalities into a single system,” says Andrew Dike, senior engineer at Trainline. “AWS was a natural choice.”

kr_quotemark

Working alongside AWS has definitely been a good experience. AWS put effort into verifying that it could help make our product a success.”

Andrew Dike
Senior Engineer, Trainline

Solution | Migrating to 100% Automation for Simpler Administration across Teams

Trainline migrated to Amazon CloudFront in stages, beginning with lower-traffic or less critical endpoints and then moving on to domains with higher traffic. During the first stage, Trainline implemented Lambda@Edge, which runs code closer to users and charges the company only when the code is running. Later, when Amazon CloudFront Functions were released, Trainline migrated some of the functionality using Lambda@Edge to Amazon CloudFront Functions, which helped the company reduce its CDN spending.

By the end of 2022, Trainline had migrated 99 percent of its infrastructure to AWS. “The migration to Amazon CloudFront was surprisingly seamless, given the complexity and traffic volumes involved,” says Merlin Taylor, senior engineer at Trainline.

Migrating to Amazon CloudFront means that multiple Trainline team members know the CDN well and can make changes or solve problems. “The distribution of knowledge across the team is definitely a big benefit,” says Dike. “We don’t have a potential single point of failure.” The 100 percent automation achieved with this migration also means that even new team members can be confident in their roles. “We can easily perform peer reviews on all changes, and the high level of automation means that rollbacks can be done quickly if required,” says Keerthivasan Kannan, CDN subject matter expert at Trainline.

Application security and availability were primary concerns during the CDN migration. By using AWS WAF, which protects web applications from common exploits, Trainline maintains control over its security. It protects all its domains with a standardized AWS WAF setup and can onboard a new domain in half a day, as opposed to several days previously. “Using AWS WAF, we have the freedom to add any custom rules into monitoring mode so that we can observe their impact on production traffic before activating them,” says Kannan. Trainline also uses AWS Shield Advanced, which provides additional detection and mitigation against large and sophisticated distributed denial-of-service attacks, near real-time visibility into attacks, and integration with AWS WAF. The team can also quickly issue new certificates for new domains using AWS Certificate Manager (ACM), which provisions and manages SSL/TLS certificates with AWS services and connected resources.

Outcome | Fine-Tuning the Security Posture Using AWS WAF to Maintain Application Security

Following the successful migration, Trainline continues to regularly meet with AWS to update and fine-tune its AWS WAF configuration to maintain domain security. “Periodic reviews with the AWS team have helped us to update our configurations and adjust them to our use cases accordingly,” says Kannan. “It’s not just the support. The product has also evolved.”

Trainline’s team also offers feedback on AWS services and provides suggestions on helpful ways to shape these services. The AWS team keeps Trainline updated on new features that can move both its business and its customers forward. “Working alongside AWS has definitely been a good experience,” says Dike. “AWS put effort into verifying that it could help make our product a success.”

About Trainline

Trainline, Europe’s number one most downloaded rail travel app, sells tickets from over 270 rail and coach operators in 40 different countries. It is headquartered in London and has offices across Europe.

AWS Services Used

Amazon CloudFront

Amazon CloudFront is a content delivery network (CDN) service built for high performance, security, and developer convenience.

Learn more »

AWS WAF

AWS WAF helps you protect against common web exploits and bots that can affect availability, compromise security, or consume excessive resources.

Learn more »

AWS Certificate Manager

Use AWS Certificate Manager (ACM) to provision, manage, and deploy public and private SSL/TLS certificates for use with AWS services and your internal connected resources.

Learn more »

AWS Shield Advanced

Shield Advanced provides additional detection and mitigation against large and sophisticated DDoS attacks, near real-time visibility into attacks, and integration with AWS WAF, a web application firewall.

Learn more »

More Travel & Hospitality Customer Stories

no items found 

1

Get Started

Organizations of all sizes across all industries are transforming their businesses and delivering on their missions every day using AWS. Contact our experts and start your own AWS journey today.