Migrating off of an existing code base that is using somewhat older tech is not an easy decision to take. Besides the costs, you have to take into account how long it will take before your users see the benefits of the new system in place, and possibly you do not want to have to wait for the whole migration before that happens. Additionally, you want to make sure your service remains stable across the journey and that it can evolve, either by fixing bugs or implementing new features.

Five years after the initial development of their platform, that was exactly the case for Medium, as Solomon explains,

Migrating an entire system to new tools and frameworks isn’t an easy task. And doing that while not impacting feature development? That’s even harder

The Medium engineering team devised a path forward to the migration of their service that aimed to let people start using the new system as soon as possible, and at the same time not hinder changes to the existing system.

The first step of the migration was rewriting Medium’s client app with React.js and relying on GraphQL as an interface layer to the existing API. As a GraphQL client-side framework, Medium is using Apollo Client.

In this phase, both the old and the new system coexisted, with each serving a different set of pages. This approach had the benefit of not requiring a full server-side rewrite and not affecting the development of new features for the old system. A key decision the Medium team took was using protocol buffers to describe the legacy API as a schema for interfacing with GraphQL.

In a second phase of the migration, which according to Solomon is starting soon, server-side code will be refactored into services to feed the GraphQL layer, which will use Sangria as its GraphQL server-side framework.

The use of GraphQL is expected to bring here a big advantage, since its more granular structure maps directly into more modular and simpler services, which in turns is expected to improve their performance as well. The new services, that will use gRPC to talk to the GraphQL service, can be built in a totally independent way from the old services, while the old services are kept in places to power the old API.

InfoQ Weekly Newsletter

Join a community of over 250 K senior developers by signing up for our newsletter. If you are based in the EEA, please contact us so we can provide you with the protections afforded to you under EEA protection laws.

Is your profile up-to-date? Please take a moment to review and update.

Email Address

Note: If updating/changing your email, a validation request will be sent

Company name:

Keep current company name

Update Company name to:

Company role:

Keep current company role

Update company role to:

Company size:

Keep current company Size

Update company size to:

Country/Zone:

Keep current country/zone

Update country/zone to:

State/Province/Region:

Keep current state/province/region

Update state/province/region to:

Subscribe to our newsletter?

Subscribe to our architect newsletter?

Subscribe to our industry email notices?

You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.

We notice you're using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.