389: Migrating a Ruby on Rails GraphQL API to a Go GraphQL API

CodePen Radio

Episode | Podcast

Date: Wed, 02 Nov 2022 20:57:44 +0000

<p>One thing that's been keeping us very busy at CodePen is moving our main API. We decided on GraphQL long ago and it's served us pretty well. We originally built it in Ruby on Rails alongside a lot of the rest of our app. But while Rails served us well, we've been moving off of it. We like our React architecture and we're better served leaning into that, with frameworks like Next, than staying on Rails. We proved out this combination of technologies for ourselves, building a whole set of admin tools with it. Now we're ready to keep that train going as we build out more of CodePen with the same stack. But removing Rails means moving off of our Rails-based GraphQL implementation. This means re-writing that API in Go, another bit of tech we've had a lot of luck with. </p> <p>Turns out that re-writing an API is more time-consuming than writing it to begin with, especially as we need to run them side-by-side and behave identically. No refactoring allowed! Unless of course we want to refactor it on both sides and take even more time. </p> <p>Dee joined me this week in talking about all this. It's a huge job! But we've been doing well at it, building our own tooling, doing lots of testing, and ultimately proving that it works by releasing it in small areas on the production site. It's all working out how we hoped it would: fast, cheap, and easier to reason about.</p> <h3 id="h-time-jumps">Time Jumps</h3> <h3 id="h-sponsor-equinix-metal-s-startup-partner-program">Sponsor: <a href="https://srv.buysellads.com/ads/long/x/TCKXB5SDTTTTTTHSVTOCCTTTTTT2PR7IKKTTTTTTP3CINYYTTTTTTWIWQWSUPLB357TIV77UGQICEIDB27V662BV5RKT">Equinix Metal’s Startup Partner Program</a></h3> <p><a href="https://srv.buysellads.com/ads/long/x/TCKXB5SDTTTTTTHSVTOCCTTTTTT2PR7IKKTTTTTTP3CINYYTTTTTTWIWQWSUPLB357TIV77UGQICEIDB27V662BV5RKT">Equinix Metal’s Startup Partner Program</a> helps early stage companies level up. Their experts work with startups like Koord and INVISV to build their competitive edge with infrastructure. Equinix Metal provides real time guidance and support to help startups grow faster. With up to $100,000 in infrastructure credit, access to Equinix’s global ecosystem of over 10,000 customers and 1,800 networks, they might just be what you need to take your startup global.</p> <p>Visit <a href="https://srv.buysellads.com/ads/long/x/TCKXB5SDTTTTTTHSVTOCCTTTTTT2PR7IKKTTTTTTP3CINYYTTTTTTWIWQWSUPLB357TIV77UGQICEIDB27V662BV5RKT">metal.equinix.com/startups</a> to take your startup to the next level.</p>