Norwegian Cruises To Record Profits With Reactive
How Lightbend Enabled the Technology Innovation that Catapulted the Cruise Industry’s Hottest Company
Business is booming for Norwegian Cruise Line. In its most recent earnings (NASDAQ: NCLH) the company reported ticket sales had surged another $300 million to just under $1 billion (up from $650 million). In 2015, Norwegian also won more accolades from the World Travel Awards - this year not only being named the "World's Leading Large Cruise Line," for the fourth consecutive year, but also being recognized as “Europe’s Leading Cruise Line” for the eighth year in a row, as well as the “Caribbean’s Leading Cruise Line” for the third straight year.
Behind Norwegian's dramatic success is its game-changing strategy, "Feel Free" - the pricing and packaging flexibility that provides guests with the freedom to choose between many different options in their cruise experience. It’s a customer experience vision that Norwegian seized ahead of its competitors.
But before Norwegian could change the game and dominate the cruise industry by becoming more responsive to its customers, its technology team (Forrest Snell, Mariana Mazzero, Marcos Savory, Chris Marsh, Narin Persad, David Porto and Dennys Aldana) needed to rethink its entire software infrastructure approach to support that vision. According to Gartner, "the fundamental shift to digital business requires 50% of software in the next five years to be built with a new model." Norwegian is a leading example of how Reactive and the new way of building software lifted a business to new heights.
A More Reactive Software Infrastructure Needed for Innovation and Growth
Two years ago, Norwegian's software infrastructure was becoming an obstacle to delivering on the company's vision. In a position that many hyper revenue growth companies find themselves, Norwegian had quickly accumulated technical complexity and system dependencies that were beginning to negatively affect developer productivity. Fidel Peréz -- Director of Enterprise Architecture and Performance -- was tasked to right the ship.
- Too many back ends and code bases— Norwegian had three different back end systems and five different code bases, written in multiple languages.
- Legacy / Monolithic Codebase—Through the years, Norwegian’s code bases had become massive monoliths with hidden dependencies and steep learning curves for developers.
- Multiple API Clients—Multiple API clients meant even more complexity for developers interacting between back end systems and endpoints.
- Slow Development Cycles—The overall complexity of Norwegian’s numerous deployment strategies and different production environments resulted in slow development cycles. Even making a simple change to the website could take weeks from implementation to testing and deployment.
- Operational Challenges—The company also had operational challenges with website traffic during “wave season” (the high season for the cruise industry) and during peak site traffic.
Why Scala, Play and Reactive
Our two greatest goals in modernizing Norwegian’s software infrastructure were (1) to create more agility for the developer team to support the businesses with more frequent release cycles, and (2) to create a more stable site to sell cruises. With the heart of the business strategy tied to a vision that required rapid development of new features and functionality -- with lost revenue for any downtime on the site potentially reaching hundreds of thousands of dollars -- Norwegian needed to go Reactive.Fidel PerézDirector of Enterprise Architecture and Performance
After a careful review of all languages and application architecture options, Peréz’s team decided to rewrite its code bases in Scala and Play Framework for the following reasons:
- Type Safety— Scala’s type safety gives useful program documentation, where types act as a safety net for error detection and refactoring at compile time.
- Immutable Types and Stateless Applications—A stateless application decouples the requests from a particular server, minimizing the impact of server failures. It also enables a team to make code deployments during the day with increased business agility.
- Loose Coupling—Play’s APIs and the Reactive characteristics of Scala offered a path to loose coupling between Norwegian’s three back-end systems and its web site and other endpoints.
- Professional Support and Subscription from Lightbend—Full life cycle support from the creators of the Scala language and Play Framework gave Norwegian the assurance of a safety net during its ambitious development, staging and production deployments.
Today Norwegian is a heavy user of Scala, Play and Akka. Two thirds of ncl.com site is written in Play-Scala, which is also the front-end layer to Norwegian’s partner API.
Through its use of the Lightbend Reactive Platform and support services, Norwegian has converted its monolithic legacy architecture into a modern service oriented architecture with well-defined boundaries. Where previously the architecture tried to mask the complexity of back-end systems by building and maintaining complicated new abstractions - today the Norwegian team leverages the principles of Reactive and Scala language patterns to sufficiently isolate clients from back-end systems.
The company has reported:
- Isolation from the back-end— Norwegian has built services layers in front of its clients that allow isolation from complexity and failures on the back-end. Backend services outages no longer cascade to the rest of the system.
- Increased Developer Velocity—A more modern development model in Scala that emphasizes proper service isolation has allowed Norwegian developers to more easily reason with back end services and roll out new features and bug fixes. Previous deployment cycles were weekly or monthly. Today the company deploys 400% more frequently by Perez’ estimate.
- More Fluid Operations—Stateless services allow Norwegian to deploy during business hours by adding and removing servers from the production pool. In the past, the team was required to deploy after midnight to avoid service interruption.
- Better Failure Management and Overall Performance—The old code did not have the built-in mechanisms to handle contention or failing backends, and a downstream system failure usually created a high number of threads on the upstream systems that would ultimately cause those systems to consume all resources on the servers. With Ligtbend Reactive Platform, Norwegian’s new systems utilize hardly any cpu (thanks to the built in asynchronous IO) and simply stop sending traffic when an error condition is detected.
- Outstanding Uptime—Over the last year, Norwegian had over 65 code deployments with no crashes. According to Pérez, the uptime comes from the resiliency of the actor model and the fact that errors are propagated to the supervisor and not to the caller, allowing more sophisticated error handling mechanisms.
Pérez and the team had so much success with Scala, Akka, and Play Framework that it also targeted Reactive innovation on payment devices on it ships using Akka. Where previously changes to payments systems on casino, arcade, and vending machines had to be administered via serial cable, today these changes are simple remote configurations to Actors.
According to Pérez, Norwegian has been using Akka for two years in production, without a single crash from the reactive systems. In any case of failure on the back-end, the devices just “wait” and are still fully functional for passengers. Norwegian sees this resiliency as the foundation for building future technology-driven innovation for passenger experiences and new revenue opportunities.
Inspired by this story? Contact us to learn more about what Lightbend can do for your organization.