DEV Community

Cover image for Rust in Production: Qovery
Serokell
Serokell

Posted on • Originally published at serokell.io on

Rust in Production: Qovery

In this article of our Rust in Production series, I interview Benjamin Chastanier, a senior software engineer at Qovery.

We talk about Qovery, the pros and cons of Rust, and what developers should keep in mind when working on Rust projects.

Interview with Benjamin Chastanier

Could you tell us more about Qovery and your role there?

Cloud providers came on the scene in the early 2000s to allow anyone to start a tech company and manage infrastructure. Over the years, these providers have become increasingly complex and expensive to manage. For example, AWS, which started with three services, now has over 200 each with its own specificity. As a result, in growing tech companies, developers not only have to manage their tech development but also these complex infrastructures that are wasting time, energy, and resources.

Qovery aims to solve this pain allowing users to focus on their products. We are building the next generation of application deployment and management. Something as simple as your grandma could use!!!

I’m working as Senior Software Backend Engineer at Qovery, mainly focusing on extending the Qovery engine, which is an open-source abstraction layer library on top of cloud providers.

card

Where do you use Rust in your stack? How big of a part of the Qovery codebase is written in Rust?

We use Rust in a wide variety of places from tooling to core engine (which is 100% written in Rust) in charge of most of Qovery special sauce.

Not all the stack is written in Rust, we just try to fit it where its usage would make sense. For example, we are about to start a new low-level log message proxy, and Rust sounds like the perfect tool for it.

As of today, Qovery CLI (CLI used by devs to interact with Qovery) and Pleco (a tool allowing us to clean old cloud resources) are written in Go, and Qovery backend is mostly written with Kotlin.

How did you decide to choose Rust? Are there any specific requirements that made you choose it?

In the beginning, the Qovery product was based on a Python stack which has grown incredibly fast, supporting the need for new product features. Codebase started to be hard to properly maintain and test due to its empirical design. It was hard to continue to extend it. At this point, a rewrite was on the table, and Rust looked very appealing for a lot of reasons.

Here are the main ones:

  • Rust is a strongly typed language, allowing a lot of checks at compile time, meaning: no more runtime errors.
  • Rust is focused on security and safety without impacting speed and performance, even if products are not meant for performance.
  • Low memory footprint. This is a great advantage for Qovery since our solution is deployed on the customer infrastructure. Reducing our infrastructure needs is one of our main goals.
  • Safe by design.
  • Amazing toolchain. Cargo, compiler, fmt, clippy, just to name a few.
  • Error handling. Rust strongly enforces to acknowledge the eventuality of errors happening along the way at compile time.

Are there any Rust libraries or frameworks that you found useful and would like to feature?

  • Meilisearch: Algolia and Elasticsearch search engine alternative.
  • Sonic: Lightweight Elasticsearch alternative.
  • Sled: Storage engine written in Rust - alternative to RocksDB.
  • IsomorphicDB: PostgreSQL clone - it is a good experimental project written in Rust.
  • Raft-rs: Raft consensus protocol implemented in Rust by PingCap.
  • Tracing: Instrument Rust programs to collect structured, event-based diagnostic information.

Did Rust help you accomplish something that would be hard to accomplish with any other programming language?

As explained earlier, one of Qovery’s goals is to optimize its customers cloud usage by reducing costs by allocating and scaling their infrastructure based on their needs.

Because Qovery is deployed on customers’ infrastructure, it’s very important to keep Qovery’s footprint as low as possible. Rust does an amazing job at this, allowing it to run on a very minimal setup (128 Mo RAM and >1 vCPU).

It wouldn’t have been as easy to achieve this in such a short period of time with C or C++, which allow to do so but don’t expose such a high-level API, or with Go, Python, or other managed language that might require more resources.

Another big advantage is the Rust type system prevents us from having runtime issues which would be very annoying while running on our customers’ cloud infrastructure because it can be tricky to debug. The Rust compiler guarantees stability and does a great job at avoiding runtime failures.

Are there any places where Rust has fallen short (ecosystem support, productivity, etc.)?

I am thinking about two as of today:

  • The ecosystem is still young, and there are obviously fewer libraries as of today than in other ecosystems such as Go or Python, especially on the infrastructure part of things. Some libraries are there but haven’t reached version 1 yet and might be unstable in the sense their API might have to change before reaching v1.
  • Compilation time might be a bit long. This is not really inconvenient because the compiler is doing a lot of leg work for you and prevents 95% of bugs from happening in production, but long compiles times require us to be creative with our CI/CD pipelines not to slow down the shipping time too much. For example, we introduced a build cache, which reduced the build time by ~5 times.

Which companies or projects should check out Qovery for their own use?

Basically, Qovery is perfect for any online company that needs to stay focused on its business. In 18 months, we have 6500+ developers from 120+ countries who are using Qovery. The promise is simple: get the Heroku experience on top of your AWS account.

What are the future plans of Qovery?

Future features are listed in our public roadmap. On the other side, Qovery stands to build the future of the Cloud. Stay tuned – our initiative called “meta.cloud” will be announced within the coming weeks.

Any tips you would suggest for those wanting to launch their own open-source Rust project (can be both technical and non-technical)?

  • Rust is an amazing language.
  • Learn and understand the main concepts (ownership, borrowing, lifetime, etc.).
  • Do not expect to master it before 3 to 6 months – even if you are an experienced developer.
  • Share your enthusiasm and what you have learned with the community – it will help to promote this great language.
  • Build a product/project you enjoy working on.
  • Enjoy Rust. :)

I’d like to thank Benjamin for the interview! If you want to learn more about Qovery, go straight to their website.

For more info on how Rust is used in industry, be sure to check out our series of interviews, where we talk with companies like 1Password and MeiliSearch.

And if you would like to be notified about new Rust articles that we publish, we’re on Twitter, Medium, and Dev.

See you around! 👋

Top comments (0)