How Turnit ensures the scalability of the Swedish National Distribution System

Exploring the Technological Foundation

In this article, we'll take a deep dive into the inner workings of Turnit Hub, the technological foundation of the National Distribution System (NDS) in Sweden. We'll explore the technical components that make Turnit Hub a robust platform, providing insights into how it efficiently meets and exceeds demanding performance standards. With our in-depth exploration of Turnit Hub's technical underpinnings, we aim to provide a clear understanding of its capabilities.

Meeting Global Demand: A 1 Billion Passenger Request Goal

Turnit is building Sweden's central National Distribution System (NDS), to streamline ticket sales and ensure swift and efficient responses to requests from various external mobility services distribution partners, including GDS's, MaaS platforms, OTA's, and more. This system will serve as the central hub for the Swedish national multi-modal distribution of transportation services, improving travel and connectivity.

Turnit Hub - Process Illustration - Blue BG

Turnit HUB process diagram

To meet the dynamic demands of the industry and cater to a user base not only in Sweden but worldwide, we have set an ambitious goal for Turnit Hub - to facilitate up to 1 billion requests annually. The validation of this goal is based on our thorough load testing and is essential to meet the growing needs of the global passenger transportation industry. The expected volume of passengers for Sweden's NDS is 20 million, which is just a fraction of the capacity that Turnit Hub is engineered to manage and serve.

Diving Into Load Testing Details

Over the past year, we have constantly optimized Turnit's platform to guarantee consistent results, high availability, and robustness. As the NDS project approaches its go-live stage, we are conducting final performance and load testing to validate the system's capabilities. 

Our team utilized JMeter for load testing to ensure reliable performance of our Turnit Hub distribution solution. To optimize our infrastructure from a cost and performance perspective, we also instrumented our code with New Relic. This step enabled us to identify bottlenecks and optimize our codebase, ensuring a smooth and consistent data flow and efficient use of server resources. 

Our operational toolkit included Prometheus and Grafana, enabling us to monitor various infrastructure and business-related metrics and establish alerts based on specific thresholds. These tools are pivotal in our routine monitoring tasks and are critical in interpreting results during our load-testing phases.

Turnit Hub Load Test Graph

Snapshot from one of our load tests

The utility of Prometheus and Grafana extends beyond internal use and load testing, also serving as a basis for our Service Level Agreement (SLA) reporting. We believe in maintaining transparency with our customers concerning the performance and reliability of Turnit solutions. Hence, we employ these dashboards not only to monitor and uphold our standards but also to validate and report our adherence to stipulated SLAs.

Goal #2: Efficiency with Cost-Effective Hardware

In our pursuit of efficiency, we prioritize high-performance standards achieved with cost-effective hardware. Our load-testing environment reflects this approach. In an operational environment consisting of four general-purpose virtual machines, each equipped with 4 cores and 16GB of memory within Azure Kubernetes Service, we refrained from implementing enhancements explicitly tailored for the load test. Instead, we aimed to provide an authentic representation of low-end operating conditions. The deliberate choice of this setting provides the foundation for results that can be effectively multiplied to meet dynamic requirements.

High Throughput: Managing 400 Offer Search Requests per Second.

We managed a throughput of around 400 offer search requests per second with maintainable low response times under these conditions, demonstrating Hub's ability to handle the load efficiently. We purposefully conducted the test without autoscaling triggers to have an honest and accurate assessment of our infrastructure's capability to handle the load efficiently in a real-world scenario, which highlighted the infrastructure's capability, requiring only minimal pod-level scaling to manage surges.

Scalability and Large Volumes of Data

Turnit Hub - Diagram - Blue BG

Turnit Hub adheres to the Open Standard for Data Mobility (OSDM) and integrates with external platforms and travel agent systems.

Upon closer examination of our system's performance metrics, it is clear that Turnit Hub can scale and handle large volumes of data. Based on our calculations, Turnit Hub can theoretically handle up to 12.6 billion search requests annually. These results align with the specific operational needs of our clients, who typically maintain a look-to-book ratio of 12.5 to 1, which equates to the system's ability to serve up to one billion passenger bookings annually. With a 15ms processing time, it guarantees rapid responses to external partner requests even under significant loads, demonstrating its readiness to meet dynamic demands.

Exploring Our Technological Stack

Our well-crafted stack brings together Microsoft Azure's vast cloud capabilities, PostgreSQL's robust data storage and retrieval systems, and Redis's efficient data caching and storage. Within the Azure ecosystem, we employ Azure Kubernetes Service (AKS) for streamlined management of our microservices, ensuring optimal load distribution and performance. Additionally, Azure Service Bus facilitates seamless message transmission, while Azure Front Door and Defender enhance our security posture. PostgreSQL and Redis, celebrated for their robustness and reliability, safeguard our data with high availability and geographic redundancy, delivering a steadfast data backbone for our platform.

Microservices: Scalability, Efficiency, and High Availability

At the core of our solution lies a pragmatically designed microservices architecture, implemented with Azure Kubernetes Service (AKS) to prioritize scalability, efficiency, and high availability (HA). This design choice is more than a trend – it's a strategic decision that enables each component of our system to scale independently according to its individual demand.

For a tangible perspective, consider our offer search and booking creation services during high-traffic scenarios, such as peak booking periods. These critical services can autonomously scale up to manage the increased load, ensuring timely and smooth user interactions. Conversely, other services that may not be under the same pressure conserve resources, operating with just the necessary computational power to function effectively.

This microservices model not only ensures economical use of infrastructure but also enhances the reliability of our system. With each service operating independently, potential issues can be isolated and addressed without impacting the overall system, assuring uninterrupted service and consistent user experiences.

Unleashing the Hub’s

As we look to the future, it's evident that Turnit Hub's potential surpasses Sweden's borders. The Swedish National Distribution System, while showcasing the platform's capability and versatility, also highlights that this technology goes beyond the confines of a single country. Sweden, a vital and dynamic market, is just the starting point. Turnit Hub's latent capacity and unparalleled scalability position it to address not only Sweden's challenges but also those on a global scale.