2U, Inc. is a global leader in education technology and a trusted partner and brand steward of great universities. 2U builds, delivers, and supports more than 400 digital and in-person educational offerings, including graduate degrees, professional certificates, Trilogy-powered boot camps, and GetSmarter short courses. Together with their partners, 2U has positively transformed the lives of more than 225,000 students and lifelong learners.
Source: 2U.com
Stitching kit
The 2U team defines their identity as “a diverse collection of innovators, dreamers, and doers all working to improve lives through higher education technology.” This authentic and vibrant diversity culture embraces both the organizational and technical levels.
Basically, 2U is a massive distributed platform with many advanced features, deployed to the Amazon Web Servers cloud. A query language they use to power the platform is, of course, GraphQL, since this schema-based technology simplifies and pushes on all engineering processes. This factor is crucial for 2U, as their development is driven by multiple self-organized engineering teams. They work on different microservices and juggle multiple languages from JavaScript and Python to Ruby, Elixir, and Clojure—whatever fits best the task at hand.
Seamless service integration is a king in this situation. This process was initially grounded on a single unified GraphQL API, powered by a schema stitching technique and deployed to cloud cluster (the team is planning to migrate to AWS Elastic Kubernetes Service). But something went wrong.
Perfect for distributed services at the start, this technological choice was gradually blunting effectiveness in keeping the stitching gateway in good shape. Almost any change in underlying services required a symmetrical gateway update. All that did not contribute much to the separation of concerns principle and eventually turned the distributed services into the notorious Monolith.
Apollo-gizing
Afer the Apollo GraphQL Federation had been announced, 2U decided to adopt it and move away from the monumental central planner to the bright distributed future. This cutting-edge technology leverages a declarative programming model to organize proper coordination between multiple GraphQL services, granting them independence from the single gateway. Each team can now foster its service and domain logic without investigating the neighboring services and their bottlenecks.
There was just one little thing left: turn a stitched GraphQL monolith into the Apollo Federation, cover it fully with tests and experience no failures during the migration. Big things have small beginnings. The 2U team asked Martians to plan the first-ever service to be federalized against the backdrop of a 1-month deadline and strict performance requirements: less than 10ms response time at the 95th percentile and a low memory footprint under thousands of requests per minute. To do it in a genuinely federated manner, we chose Node.js since Apollo Federation is primarily a technology based on the JavaScript stack.