Samtrafiken logo

Building a Scalable Solution for Digital Ticket Distribution Using AWS with Samtrafiken

"Using serverless AWS, we were able to start our venture of digitizing tickets due to the latency benefits and ease of use.”

—Lotta Dorph, product owner, Samtrafiken

Samtrafiken developed a digital ticket distribution solution using AWS services, delivering a modern ticketing experience to travelers on Sweden’s national railway line. Samtrafiken coordinates ticketing for multimodal transport throughout the country’s 21 regions. To fulfill its mission of connecting all the public transportation entities, Samtrafiken needed a cloud solution that was scalable and simple to use. By using serverless AWS solutions, Samtrafiken maintains 99.99 percent uptime, reduces network latency, and boosts developer productivity.

Delivering a Seamless Travel Experience for Users
As a whole, the transportation industry continues to rely on a conventional infrastructure, which in many cases is hosted on premises and is not agile enough to keep up with changing business needs. Individually, Swedish PTAs increasingly have been implementing their own digital solutions, which has been a primary motivation for Samtrafiken to adopt serverless AWS technologies to connect all the digital tickets. “The issue with legacy systems is that they don’t provide the agility to create modern solutions for travelers,” says Lotta Dorph, product owner at Samtrafiken. “We wanted to be able to create smart tickets to streamline travel for everyone.”
Samtrafiken started using AWS in 2018 and is currently deploying a number of systems on AWS. One example is a support system for Trafiklab, which is Samtrafiken’s open platform for providing public transport data. Another example is a reference implementation of BoB, Samtrafiken’s ticketing standard. The BoB Standard is now used by almost all of Sweden’s 21 PTAs.
In response to the Stockholm PTA’s changes, Samtrafiken began work on a new digital ticket system in which the Stockholm PTA integrates seamlessly with the SJ application. Samtrafiken believes a successful integration with the ticket system in Stockholm proves that this service can be effectively expanded across the country. Samtrafiken aims to combine digital tickets in individual regions so that travelers can use digital tickets anywhere in the country. “We have high expectations because we want to be a role model in public transport,” says Kristian Dahlander, chief information officer at Samtrafiken. “It is our mission to support and develop a seamless ticket travel experience.”
Increasing Reliability and Availability Using Serverless AWS
Samtrafiken’s solution on AWS serves as a proxy server, working in the background to connect otherwise incompatible travel apps from SJ and the Stockholm PTA. “Our travelers have really high expectations,” says Thomas Ulveland, software engineer at Samtrafiken. “It’s critical that our ticketing system works seamlessly. When users are at the gates trying to activate a ticket, it should be really fast and always work.” The new digital ticketing system features backup protection and storage for tickets, which means that they can be retried on another application if necessary. To store the tickets, the company uses Amazon Aurora Serverless, an on-demand, autoscaling configuration for Amazon Aurora, a database that provides high performance and availability at global scale with full MySQL and PostgreSQL compatibility.
The improved scalability of using serverless AWS provides the potential for Samtrafiken to scale up to higher workloads as ticket volumes increase. Having AWS Availability Zones in the Europe region—particularly in Stockholm—also means that Samtrafiken can store data locally while reducing latency. “It would have been very challenging to do this without the cloud solution,” says Dorph. “Using serverless AWS, we were able to start our venture of digitizing tickets due to the latency benefits and ease of use.”
By using AWS Fargate, a serverless, pay-as-you-go compute engine that lets teams focus on building applications without managing servers, the development team reduces its operational burden and shifts those resources toward testing and development. Because developers don’t have to manage infrastructure, they can work independently and focus on improving the features of the solution. Using Terraform as an infrastructure-as-code tool, the team automatically provisions, manages, and updates its infrastructure on AWS. “The simplicity of using AWS makes it very convenient for us developers,” says Tobias Hägglund, software engineer at Samtrafiken. “Using AWS Fargate, we don’t have to deal with details of server configuration, we just specify CPU and memory.”
So far, travelers who are using the digital ticket in Stockholm have moved more lightly than before between local transport and SJ. They can travel with confidence, knowing that their tickets won’t cause them issues. By using AWS, the development team maintains high reliability and stability of its solution, with nearly 99.99 percent uptime. “Uptime is crucial to delivering a seamless experience on our applications,” says Ulveland. “We want to deliver on user expectations that tickets will work without issues at the gate.”

Shaping the Future of Travel in Sweden

With about 2,000 digital tickets in circulation in Stockholm, Samtrafiken aims to expand the seamless digital ticketing solution to all 21 PTAs across Sweden. By 2025, Samtrafiken plans to have connected all the existing systems. The infrastructure is in place, and the company is eager to integrate the rest of the country’s transportation network into its solution. This successful launch also sets the stage for future innovations that cater to all travelers’ needs.

“It’s important to show the public that we are ready, we want to expand the solution, and we believe very strongly in it,” says Dahlander.

Leading Cloud Innovators in Europe

Learn how leading organizations in Europe across industries trust AWS to drive innovation at every level of their business. 

AWS Customer Success Stories

Organizations of all sizes use AWS to increase agility, lower costs, and accelerate innovation in the cloud.

More Travel Customer Stories

no items found 


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.