Railway Plans to Simplify Infrastructure for Developers
Railway’s goal is to make infrastructure simpler for developers, and one step it recently took to achieve that was revamping its CLI (command line interface) from Go to Rust.
“Our message for the frontend and for web developers is that we’re making infrastructure tasks into buttons that you just press to get what you want,” David Banys, product marketing manager at Railway, told The New Stack. “If you want a database, for example, it’s as simple as clicking a button and a few seconds later, you have a fully configured and operational database ready. The most common feedback we get is that Railway is the fastest way to spin up a database or to spin up a new service.”
Banys demoed spinning up a Postgres database at the click of a button — it took less than 10 seconds to deploy, as promised. Banys said other services devs can spin up include a messaging queue, Redis for cache, databases such as MongoDB or MySQL, or any other backend service that frontend devs might need. There are also templates available, for example, to spin up a Django app or Flask, which is a Python module that lets coders develop web applications easily. He added that developers can bring their own Docker container or deploy one from the site.
“This is something that in the infrastructure world can be much more complicated, having to provision resources, permissions, all the sorts of hoops that you have to jump through to do something like this on a big cloud service,” he said. “We try to make it really fast and easy.”
One use case would be providing a place to deploy an internal app, service or website that might require backend infrastructure.
“We would use Railway just to spin it up on infrastructure that automatically scales so the benefit is that you don’t have to provision infrastructure,” he said.
CLI Rewritten in Rust
Railway recently attracted attention from the Rust community after announcing in March that it had rewritten its Go-based command line interface “from the ground up” in Rust. Support Engineer Adarsh Krishna explained that rehabilitating the Go CLI introduced a number of challenges, including two interesting quirks:
- In Go, “GraphQL types are separate from queries/mutations,” he wrote. That creates issues when the developer forgets to update the types. “Because we were undergoing a major API overhaul, we wanted to make sure that we would keep type safety moving forward,” he wrote.
- “The CLI parser library we were using in Go (Cobra) defined commands dynamically using functions that were called at init. In layman’s terms, this allowed you to grab an arg that didn’t exist, which caused problems.”
He then listed a series of reasons that Rust worked better, including:
- An “outsized focus on normalization of types” by the new Public API;
- Rust provides “great hooks into strongly typed GraphQL queries”;
- Rust’s libraries “provide UX improvements in the CLI out of the box, like tables, loading states, and error handling”; and
- “Rust’s focus on DevEx philosophically fits with Railway’s mindset,” he said.
Plus, Krishna added, Rust is fun to write.
Railway was created in 2020 “to make it trivial for engineers to deploy code without thinking about servers. No Ph.D. in Kubernetes, No AWS, No yaml,” according to a 2022 Railway blog post. Railway founder Jake Cooper had been a software engineer at Uber and was working on several different ideas. He discovered it was difficult to iterate quickly on existing infrastructure clouds. While he was exploring his ideas, he kept expanding the provisioning agent he’d created. He started sharing the software with other people and found that it resonated with them. Railway.app launched officially in 2021.
“Hobby Developers, Indie Hackers, Small Startups, Series A/B/C/etc Startups, Fortune 500 companies, random oil & gas companies in eastern Europe; it didn’t seem to matter. They were all asking to simplify their infrastructure,” the blog post stated.
One area where Railway is making a name for itself is as a Heroku replacement.
Theo Browne, the CEO of Ping Labs who posts YouTube videos under @t3dotgg, looked at possible solutions after Heroku had dissolved its free tier. Railway was one of his top mentions, ranked as “easy” against with Render and Fly.io, both of which he rated as “medium” difficulty.
He ranked Railway as easy among hosting databases competitors Planet Scale, Supabase, CockroachDB and Atlas as well. Finally, he ranked Railway as easy when it came to docker image host options, which included Render and Fly.io (both medium) and AWS (hard). The only category he did not rank Railway was in hosting a website, where he ranked Vercel, Netlify and Github as easy, Render and Cloudflare as medium, and AWS/GCP as hard.
For more on streamlining infrastructure for developers, check out these stories:
- Brev: Infrastructure-as-a-Service Co. Spins Up AI Templates
- Coherence Strives to Streamline Cloud Developer Experience